From 97b8fa0a60826baa6c8dc18b60256bbb15a59d86 Mon Sep 17 00:00:00 2001 From: James Mai Date: Sat, 10 Oct 2020 08:41:37 +0800 Subject: [PATCH] Add Conan to the JapaneseMedia category (#2142) --- README.md | 1 + doc/japanese_media/conan.md | 9 + lib/faker/japanese_media/conan.rb | 48 +++++ lib/locales/en/conan.yml | 171 ++++++++++++++++++ test/faker/japanese_media/test_faker_conan.rb | 21 +++ 5 files changed, 250 insertions(+) create mode 100644 doc/japanese_media/conan.md create mode 100644 lib/faker/japanese_media/conan.rb create mode 100644 lib/locales/en/conan.yml create mode 100644 test/faker/japanese_media/test_faker_conan.rb diff --git a/README.md b/README.md index 4427019524..ded257d908 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast - [Faker::JapaneseMedia::SwordArtOnline](doc/japanese_media/sword_art_online.md) - [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md) - [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md) + - [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md) ### Movies - [Faker::Movie](doc/movies/movie.md) diff --git a/doc/japanese_media/conan.md b/doc/japanese_media/conan.md new file mode 100644 index 0000000000..2d24e0a353 --- /dev/null +++ b/doc/japanese_media/conan.md @@ -0,0 +1,9 @@ +# Faker::JapaneseMedia::Conan + +```ruby +Faker::JapaneseMedia::Conan.character #=> "Conan Edogawa" + +Faker::JapaneseMedia::Conan.gadget #=> "Voice-Changing Bowtie" + +Faker::JapaneseMedia::Conan.vehicle #=> "Agasa's Volkswagen Beetle" +``` diff --git a/lib/faker/japanese_media/conan.rb b/lib/faker/japanese_media/conan.rb new file mode 100644 index 0000000000..03d688c53f --- /dev/null +++ b/lib/faker/japanese_media/conan.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Faker + class JapaneseMedia + class Conan < Base + class << self + ## + # Produces a character from Conan. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::Conan.character #=> "Conan Edogawa" + # + # @faker.version next + def character + fetch('conan.characters') + end + + ## + # Produces a gadget from Conan. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::Conan.gadget #=> "Voice-Changing Bowtie" + # + # @faker.version next + def gadget + fetch('conan.gadgets') + end + + ## + # Produces a vehicle from Conan. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::Conan.vehicle #=> "Agasa's Volkswagen Beetle" + # + # @faker.version next + def vehicle + fetch('conan.vehicles') + end + end + end + end +end diff --git a/lib/locales/en/conan.yml b/lib/locales/en/conan.yml new file mode 100644 index 0000000000..fe07544b32 --- /dev/null +++ b/lib/locales/en/conan.yml @@ -0,0 +1,171 @@ +en: + faker: + conan: + characters: + - Shinichi Kudo + - Conan Edogawa + - Ran Mouri + - Kogoro Mouri + - Ai Haibara + - Ayumi Yoshida + - Mitsuhiko Tsuburaya + - Genta Kojima + - Hiroshi Agasa + - Sonoko Suzuki + - Eri Kisaki + - Yusaku Kudo + - Yukiko Kudo + - Heiji Hattori + - Kazuha Toyama + - Yoko Okino + - Sumiko Kobayashi + - Tomoaki Araide + - Makoto Kyogoku + - Shizuka Hattori + - Jirokichi Suzuki + - Eisuke Hondou + - Azusa Enomoto + - Subaru Okiya + - Masumi Sera + - Shukichi Haneda + - Sakurako Yonehara + - Juzo Megure + - Ninzaburo Shiratori + - Miwako Sato + - Wataru Takagi + - Kazunobu Chiba + - Yumi Miyamoto + - Naeko Miike + - Kiyonaga Matsumoto + - Inspector Yuminaga + - Shintaro Chaki + - Hyoue Kuroda + - Heizo Hattori + - Ginshiro Toyama + - Goro Otaki + - Kansuke Yamato + - Yui Uehara + - Taka'aki Morofushi (Komei) + - Sango Yokomizo + - Misao Yamamura + - Jugo Yokomizo + - Fumimaro Ayanokoji + - Rei Furuya (Bourbon) + - Hiromitsu Morofushi (Scotch) + - Yuya Kazami + - Shuichi Akai + - Jodie Starling (Jodie Saintemillion) + - James Black + - Andre Camel + - Hidemi Hondou (Kir) + - Ethan Hondou + - Mary Sera + - Tsutomu Akai + - Gin + - Vodka + - Chris Vineyard (Vermouth) + - Chianti + - Korn + - Shiho Miyano (Sherry) + - Akemi Miyano + - Elena Miyano + - Atsushi Miyano + - Tequila + - Kenzo Masuyama (Pisco) + - Calvados + - Rikumichi Kusuda + - Ki'ichiro Numabuchi + - Kaito Kuroba + - Kaitou Kid + - Aoko Nakamori + - Ginzo Nakamori + - Toichi Kuroba + - Chikage Kuroba + - Konosuke Jii + - Kaitou Corbeau + - Akako Koizumi + - Saguru Hakuba + - Snake + - Spider + - Scar Akai + - Kohji Haneda + - Asaka + - Momiji Ooka + - Rumi Wakasa + - Kanenori Wakita + - Muga Iori + + gadgets: + - Voice-Changing Bowtie + - Power-Enhancing Kick Shoes + - Glasses Modification (Microphone) + - Stun-Gun Wristwatch + - Portable Bento Box Fax + - Detective Boys Badge + - Turbo Engine Skateboard + - Criminal Tracking Glasses + - Transmitter + - Elasticity Suspenders + - Button Speaker + - Earring Cellphone + - Electronic Notebook Map + - Wristwatch Flashlight + - Kamen Yaiba Voice Changer/Pen Voice Changer + - Voice-Changing Face Mask + - Anywhere Ball Dispensing Belt + - Voice-Changing Choker + - Glasses Modification (Bullet Proof Lenses) + - Glasses Modification (Telescopic Lenses) + - Hang Glider/Paraglider + - Cuff Link Speakers + - Mini Air Tank + - Turbo Engine Snowboard + - Satellite-Telephone Wristwatch + - Drone + - Card Gun + - Hang Glider Cape + - Turbo Engine Scooter + - Turbo Engine Skates + + vehicles: + - Agasa's Volkswagen Beetle + - Yukiko's Jaguar E-Type + - Masumi's Yamaha Artesia XT400 + - Jirokichi's Harley Davidson Electra Glide + - Okiya's Subaru 360 + - Eri's Mini Cooper + - Baya's Cobra + - Jii's Vanden Plas Princess 1100 + - Fusae's Jaguar Mark 2 + - Sato's Mazda RX-7 + - Takagi's Nissan Tiida Latio + - Takagi's Skyline ER34 + - Chiba's Fiat 500 + - Chiba's Nissan GT-R R35 (2017) + - Uehara's Honda Inspire + - Gin's Porsche 356 A + - Chianti's Dodge Viper + - Vermouth's Harley-Davidson V-Rod + - Rei's Mazda RX-7 + - Vodka's Porsche 914 + - Chianti's Ducati 1098 + - Araide's Toyota Prius (XW10) + - Vermouth's De Tomaso Pantera + - Shuichi's Chevrolet C-1500 + - Shuichi's Ford Mustang + - James' Mercedes CLK320 + - Jodie's Peugeot 607 + - Hidemi's Citroën BX + - FBI's Toyota HiAce/Regius Ace + - FBI's Volvo S40 + - FBI's Lexus GS + - FBI's Mercedes CLK320 + - Isuzu Cubic bus + - Nissan X-Trail + - Toichi's Car + - Hidemi's Motorcycle + - Heiji's Motorcycle + - Snake's car + - Shiratori's car + - Kusuda's Nissan + - Yukiko's Motorcycle diff --git a/test/faker/japanese_media/test_faker_conan.rb b/test/faker/japanese_media/test_faker_conan.rb new file mode 100644 index 0000000000..55422a275f --- /dev/null +++ b/test/faker/japanese_media/test_faker_conan.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerJapaneseConan < Test::Unit::TestCase + def setup + @tester = Faker::JapaneseMedia::Conan + end + + def test_character + assert @tester.character.match(/\w+/) + end + + def test_gadget + assert @tester.gadget.match(/\w+/) + end + + def test_vehicle + assert @tester.vehicle.match(/\w+/) + end +end