diff --git a/README.md b/README.md index 5bfa96fe24..05244a20b7 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast ### Japanese Media - [Faker::JapaneseMedia::DragonBall](doc/japanese_media/dragon_ball.md) - [Faker::JapaneseMedia::OnePiece](doc/japanese_media/one_piece.md) + - [Faker::JapaneseMedia::StudioGhibli](doc/japanese_media/studio_ghibli.md) - [Faker::JapaneseMedia::SwordArtOnline](doc/japanese_media/sword_art_online.md) ### Movies diff --git a/doc/japanese_media/studio_ghibli.md b/doc/japanese_media/studio_ghibli.md new file mode 100644 index 0000000000..fab37aeafc --- /dev/null +++ b/doc/japanese_media/studio_ghibli.md @@ -0,0 +1,9 @@ +# Faker::JapaneseMedia::StudioGhibli + +```ruby +Faker::JapaneseMedia::StudioGhibli.character #=> "Howl Jenkins Pendragon" + +Faker::JapaneseMedia::StudioGhibli.quote #=> "Here's another curse for you, may all your bacon burn." + +Faker::JapaneseMedia::StudioGhibli.movie #=> "Howl's Moving Castle" +``` diff --git a/lib/faker/japanese_media/studio_ghibli.rb b/lib/faker/japanese_media/studio_ghibli.rb new file mode 100644 index 0000000000..4ebbcc9437 --- /dev/null +++ b/lib/faker/japanese_media/studio_ghibli.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Faker + class JapaneseMedia + class StudioGhibli < Base + class << self + ## + # Produces a character from the Studio Ghibli. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::StudioGhibli.character #=> "Chihiro" + # + # @faker.version next + def character + fetch('studio_ghibli.characters') + end + + ## + # Produces a quote from Studio Ghibli's movies. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::StudioGhibli.quote #=> "One thing you can always count on is that hearts change." + # + # @faker.version next + def quote + fetch('studio_ghibli.quotes') + end + + ## + # Produces a movie from Studio Ghibli. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::StudioGhibli.movie #=> "Kiki's Delivery Service" + # + # @faker.version next + def movie + fetch('studio_ghibli.movies') + end + end + end + end +end diff --git a/lib/locales/en/studio_ghibli.yml b/lib/locales/en/studio_ghibli.yml new file mode 100644 index 0000000000..a062404ece --- /dev/null +++ b/lib/locales/en/studio_ghibli.yml @@ -0,0 +1,94 @@ +en: + faker: + studio_ghibli: + characters: ["Chihiro Ogino", + "Traveling Soot", + "Yubaba", + "Haku", + "No-Face", + "Zeniba", + "Kamaji", + "Howl Jenkins Pendragon", + "Sophie Hatter", + "Witch of the Waste", + "Lettie Hatter", + "Calcifer", + "Markl", + "Tunip Head", + "Suliman", + "Pazu", + "Shiita", + "Dola", + "Louis", + "Seita Yokokawa", + Setsuko Yokokawa", + "Kiyoshi Yokokawa", + "Ponyo", + "Fujimoto", + "Granmamare", + "Sōsuke", + "Lisa", + "Kōichi", + "Ashitaka", + "San", + "Jiko-bō", + "Lady Eboshi", + "Moro", + "Nausicaä", + "Jhil", + "Yupa", + "Obaba Hisako", + "Marco Pagot", + "Gina", + "Fio Piccolo", + "Donald Curtis", + "Mamma Aiuto", + "Capo", + "Mr. Piccolo", + "Bellini", + "Jiji", + "Kiki the Witch", + "Tombo Kopoli", + "Osono", + "Ursula", + "Totoro", + "Mei Kusakabe", + "Catbus", + "Satsuki Kusakabe", + "Tatsuo Kusakabe", + "Kanta Ōgaki", + "Yasuko Kusakabe" + ] + quotes: [ + "It’s not really important what color your dress is. What matters is the heart inside.", + "We each need to find our own inspiration, Kiki. Sometimes it’s not easy.", + "Maybe I can stay and find some other nice people who will like me and accept me for who I am.", + "Something you wouldn't recognize. It’s called love.", + "Once you do something, you never forget. Even if you can't remember.", + "Here's another curse for you, may all your bacon burn.", + "I'm going up to my room now, where I may die.", + "Really, these wizards! You'd think no one had ever had a cold before! Well, what is it?", + "I give up. I see no point in living if I can’t be beautiful.", + "Life is suffering. It is hard. The world is cursed. But still you find reasons to keep living.", + "Look, everyone! This is what hatred looks like! This is what it does when it catches hold of you! It's eating me alive, and very soon now it will kill me! Fear and anger only make it grow faster!", + "These days, there are angry ghosts all around us. Dead from wars, sickness, starvation, and nobody cares. So - you say you're under a curse. So what, so's the whole damn world.", + "It's not really important what color your dress is. What matters is the heart inside.", "I think something's wrong with me. I make friends, then suddenly I can't bear to be with any of them. Seems like that other me, the cheerful and honest one, went away somewhere."] + movies: [ + "Spirited Away", + "Kiki's Delivery Service", + "My Neighbour Totoro", + "Howl's Moving Castle", + "Princess Mononoke", + "Porco Rosso", + The Cat Returns", + "Ponyo", + "Nausicaä of the Valley of the Wind", + "Castle in the Sky", + "Grave of the Fireflies", + "Arietty", + "Tales from Earthsea", + "From Up on Poppy Hill", + "The Wind Rises", + "The Tale of the Princess Kaguya", + "My Neighbors the Yamadas" + ] diff --git a/test/faker/japanese_media/test_faker_studio_ghibli.rb b/test/faker/japanese_media/test_faker_studio_ghibli.rb new file mode 100644 index 0000000000..bba9c5d455 --- /dev/null +++ b/test/faker/japanese_media/test_faker_studio_ghibli.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerJapaneseMediaStudioGhibli < Test::Unit::TestCase + def setup + @tester = Faker::JapaneseMedia::StudioGhibli + end + + def test_character + assert @tester.character.match(/\w+/) + end + + def test_quote + assert @tester.quote.match(/\w+/) + end + + def test_movie + assert @tester.movie.match(/\w+/) + end +end