Skip to content

Commit

Permalink
Hobbit characters, locations, & quotes (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
ski-climb authored and stympy committed Apr 19, 2017
1 parent bb3f8fa commit 46a85c8
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Contents
- [Faker::HarryPotter](doc/harry_potter.md)
- [Faker::HeyArnold](doc/hey_arnold.md)
- [Faker::Hipster](doc/hipster.md)
- [Faker::Hobbit](doc/hobbit.md)
- [Faker::HowIMetYourMother](doc/how_i_met_your_mother.md)
- [Faker::Internet](doc/internet.md)
- [Faker::Job](doc/job.md)
Expand Down
13 changes: 13 additions & 0 deletions doc/hobbit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Faker::Hobbit

```ruby
# Any character from the book
Faker::Hobbit.character #=> "Gandalf the Grey"

# One of the 13 dwarves from the Company, or Gandalf, or Bilbo
Faker::Hobbit.thorins_company #=> "Thorin Oakenshield"

Faker::Hobbit.quote #=> "Never laugh at live dragons, Bilbo you fool!"

Faker::Hobbit.location #=> "The Shire"
```
21 changes: 21 additions & 0 deletions lib/faker/hobbit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Faker
class Hobbit < Base
class << self
def character
fetch('hobbit.character')
end

def thorins_company
fetch('hobbit.thorins_company')
end

def quote
fetch('hobbit.quote')
end

def location
fetch('hobbit.location')
end
end
end
end
19 changes: 18 additions & 1 deletion lib/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -695,4 +695,21 @@ en:
character: ["James Tiberius Kirk", "Jean-Luc Picard", "Benjamin Sisko", "Kira Nerys", "Odo", "Jadzia Dax", "Julian Bashir", "Miles O'Brien", "Quark", "Jake Sisko", "Kathryn Janeway", "Chakotay", "Tuvok", "Tom Paris", "B'Elanna Torres", "Harry Kim", "Seven of Nine", "The Doctor", "Neelix", "Kes", "Jonathan Archer", "T'Pol", "Charles Tucker III", "Malcolm Reed", "Travis Mayweather", "Hoshi Sato", "Phlox", "Data", "William T. Riker", "Geordi La Forge", "Worf", "Beverly Crusher", "Deanna Troi", "Natasha Yar", "Wesley Crusher", "Spock", "Leonard McCoy", "Montgomery Scott", "Hikaru Sulu", "Pavel Chekov", "Nyota Uhuru"]
location: ["Qo'noS", "Romulus", "Bajor", "Vulcan", "Neutral Zone", "Alpha Quadrant", "Beta Quadrant", "Delta Quadrant", "Gamma Quadrant", "Tau Ceti Prime", "Wolf 359", "Thalos VII", "Cardassia", "Trillius Prime", "Badlands", "Betazed", "Risa", "Deep Space Nine", "Ferenginar", "The Briar Patch", "Khitomer"]
specie: ["Breen", "El-Aurian", "Jem'Hadar", "Kazon", "Ocampa", "Q", "Ferengi", "Klingon", "Talaxian", "Vidiian", "Cardassian", "Vulcan", "Borg", "Romulan", "Vorta", "Andorian", "Bajoran", "Betazoid"]
villain: ["Q", "Gorn", "Khan Noonien Singh", "Ru'afo", "Maltz", "Kruge", "Ayel", "Admiral Marcus", "Martia", "Lt. Valeris", "V'ger", "God of Sha Ka Ree", "Admiral Dougherty", "Nero", "Krall", "Tolian Soran", "Shinzon", "General Chang", "Lursa", "B'Etor", "Borg Queen"]
villain: ["Q", "Gorn", "Khan Noonien Singh", "Ru'afo", "Maltz", "Kruge", "Ayel", "Admiral Marcus", "Martia", "Lt. Valeris", "V'ger", "God of Sha Ka Ree", "Admiral Dougherty", "Nero", "Krall", "Tolian Soran", "Shinzon", "General Chang", "Lursa", "B'Etor", "Borg Queen"]
hobbit:
character: ["Bilbo Baggins", "Bungo Baggins", "Belladonna Took", "Bullroarer Took", "Gandalf The Grey", "Radagast", "Dain", "Thorin Oakenshield", "Fili", "Kili", "Balin", "Dwalin", "Oin", "Gloin", "Dori", "Nori", "Ori", "Bifur", "Bofur", "Bombur", "Elrond", "Galion", "Bard the Bowman", "Beorn", "Tom", "Bert", "William (Bill Huggins)", "Gollum", "The Necromancer", "Smaug", "Carc", "Roac", "The Lord of the Eagles", "The Great Goblin", "Bolg", "Golfimbul"]
thorins_company: ["Thorin Oakenshield", "Fili", "Kili", "Balin", "Dwalin", "Oin", "Gloin", "Dori", "Nori", "Ori", "Bifur", "Bofur", "Bombur", "Gandalf", "Bilbo Baggins"]
quote: [
"Do you wish me a good morning, or mean that it is a good morning whether I want it or not; or that you feel good this morning; or that it is a morning to be good on?",
"There is nothing like looking, if you want to find something. You certainly usually find something, if you look, but it is not always quite the something you were after.",
"In a hole in the ground there lived a hobbit.",
"It does not do to leave a live dragon out of your calculations, if you live near him.",
"May the wind under your wings bear you where the sun sails and the moon walks.",
"Where there's life there's hope.",
"So comes snow after fire, and even dragons have their endings.",
"Where did you go to, if I may ask?' said Thorin to Gandalf as they rode along. To look ahead,' said he. And what brought you back in the nick of time?' Looking behind,' said he.",
"'You have nice manners for a thief and a liar,' said the dragon.",
"May the hair on your toes never fall out!",
"The road goes ever on and on",
"Never laugh at live dragons, Bilbo you fool!" ]
location: ["Bree", "The Shire", "Rivendell", "The Misty Mountains", "Beorn's Hall", "Mirkwood", "Esgaroth", "Erebor", "Bag-End", "Under-Hill", "Mount Gram", "Green Fields", "Last Desert", "Lonely Mountain", "Withered Heath", "Country Round", "Long Lake", "River Running", "Mines of Moria", "Green Dragon Inn", "Bywater", "The Great Mill", "Wilderland", "Gondolin", "Land Beyond", "Goblin Gate", "Carrock", "High Pass", "Great River", "Grey Mountains", "Land of the Necromancer", "Long Marshes", "Forest River", "Lake Town", "Dorwinion", "Ravenhill", "Iron Hills", "Mount Gundabad"]
23 changes: 23 additions & 0 deletions test/test_hobbit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')

class TestFakerHobbit < Test::Unit::TestCase
def setup
@tester = Faker::Hobbit
end

def test_character
assert @tester.character.match(/\w+/)
end

def test_quote
assert @tester.quote.match(/\w+/)
end

def test_location
assert @tester.location.match(/\w+/)
end

def test_thorins_company
assert @tester.thorins_company.match(/\w+/)
end
end

0 comments on commit 46a85c8

Please sign in to comment.