Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add how to train your dragon #2158

Merged
merged 2 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
- [Faker::Movies::HarryPotter](doc/movies/harry_potter.md)
- [Faker::Movies::HitchhikersGuideToTheGalaxy](doc/movies/hitchhikers_guide_to_the_galaxy.md)
- [Faker::Movies::Hobbit](doc/movies/hobbit.md)
- [Faker::Movies::HowToTrainYourDragon](doc/movies/how_to_train_your_dragon.md)
- [Faker::Movies::Lebowski](doc/movies/lebowski.md)
- [Faker::Movies::LordOfTheRings](doc/movies/lord_of_the_rings.md)
- [Faker::Movies::PrincessBride](doc/movies/princess_bride.md)
Expand Down
7 changes: 7 additions & 0 deletions doc/movies/how_to_train_your_dragon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Faker::Movies::HowToTrainYourDragon

```ruby
Faker::Movies::HowToTrainYourDragon.character #=> "Hiccup"
Faker::Movies::HowToTrainYourDragon.location #=> "Berk"
Faker::Movies::HowToTrainYourDragon.dragon #=> "Toothless"
```
48 changes: 48 additions & 0 deletions lib/faker/movies/how_to_train_your_dragon.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: true

module Faker
class Movies
class HowToTrainYourDragon < Base
class << self
##
# Produces a character from How To Train Your Dragon.
#
# @return [String]
#
# @example
# Faker::Movies::HowToTrainYourDragon.character #=> "Hiccup"
#
# @faker.version next
def character
fetch('how_to_train_your_dragon.characters')
end

##
# Produces a location from How To Train Your Dragon.
#
# @return [String]
#
# @example
# Faker::Movies::HowToTrainYourDragon.location #=> "Berk"
#
# @faker.version next
def location
fetch('how_to_train_your_dragon.locations')
end

##
# Produces a dragon from How To Train Your Dragon.
#
# @return [String]
#
# @example
# Faker::Movies::HowToTrainYourDragon.dragons #=> "Toothless"
#
# @faker.version next
def dragon
fetch('how_to_train_your_dragon.dragons')
end
end
end
end
end
174 changes: 174 additions & 0 deletions lib/locales/en/how_to_train_your_dragon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
en:
faker:
how_to_train_your_dragon:
characters:
- Agnar
- Agnut Thorston
- Alvin the Treacherous
- Arick Denson
- Arngrim Dammen
- Astrid Hofferson
- Axel Finke
- Axel Skeptisson
- Drago Bludvist
- Bucket
- Buffnut
- Cleftjaw
- Dagur the Deranged
- Derrick
- Eret, Son of Eret
- Fenris Thorston
- Fishlegs Ingerman
- Flora May
- Froglegs
- Gobber the Belch
- Gothi
- Gruffnut Thorston
- Gustav Larson
- Hagan Frostbeard
- Heather
- Hiccup
- Hildegard
- Ingar Ingerman
- Iron Mason
- Jens Henderson
- Jorgen Redboot
- Krogan
- Maeve
- Mala
- Mildew
- Nuffink Haddock
- Oswald the Agreeable
- Padraig
- Piglegs
- Ruffnut
- Ryker Grimborn
- Savage
dragons:
- Axewing
- Barf and Belch
- Beachcomber
- Bewilderbeast
- Blazewing
- Bonesnarl
- Bonnefire
- Borealis
- Butt and Head
- Cagecruncher
- Carnastial
- Cheesemonger
- Chompers
- Cloudjumper
- Darkvarg
- Earsplitter
- Fishmeat
- Ghostglow
- Gressjester
- Hookfire
- Icebane
- Incognito
- Irontooth
- Krustler
- Meatlug
- Nightwatch
- Obskewer
- Reignstorm
- Rhineblow
- Scardian
- Sentinel
- Skullcrusher
- Smidvarg
- Snifflestone
- Snogglewing
- Stormfly
- Thornado
- Thorntail
- Thunderfish
- Toothless
- Tripfire
- Valdwail
- Wavewight
- Windshear
- Winterwick
- Wonderclap
- Zeppla
locations:
- Algae Island
- Armorwing Island
- Askeblad Island
- Barbaric Archipelago
- Belching Bog
- Berk
- Berserker Island
- Boarhead Island
- Breakneck Bog
- Caves of Jotunn
- Changewing Island
- Clover Coast
- Dark Deep
- Dark Harbor
- Dragon Island
- Eastern Strait
- Eel Island
- Eternitree
- Everfrost Forest
- Fireworm Island
- Gronckle Island
- Hazard Island
- Hidden World
- Hobblegrunt Island
- Horrendous Point
- Hunter Island
- Huttsgalor
- Icestorm Island
- Island of Friga
- Itchy Armpit
- Jotun Hot Springs
- Knucklebone Knoll
- Maze Caves
- Melody Island
- Misty Backwoods
- Mount Ymir
- New Berk
- Northern Swamp
- Outcast Island
- Pointy Point
- Puffin Point
- Quaking Cavern
- Radiant Meadows
- Ragnarok Rock
- Raven Point
- Rookery
- Rough Sands
- Scriven Rock
- Scuttleclaw Island
- Sea of Despair
- Ship Graveyard
- Shivering Shores
- Shredstone Walls
- Snoggletog Island
- Sparkfire Mountain
- Speed Stinger Island
- Straits of Baldur
- Sullen Sea
- Sundering Wastes
- Sunken City
- Sunstone Island
- Thornbane Valley
- Thunderhead Bay
- Timberjack Hollow
- Titan Island
- Training Arena
- Trembling Faults
- Uglythug Lands
- Valhalla
- Valka's Mountain
- Vanaheim
- Viking Cliff
- Vinland
- Wild Woodland
- Windswept Ruin
- Woolly Canyon
- Wreck Reef
- Zippleback Island

21 changes: 21 additions & 0 deletions test/faker/movies/test_faker_how_to_train_your_dragon.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerHowToTrainYourDragon < Test::Unit::TestCase
def setup
@tester = Faker::Movies::HowToTrainYourDragon
end

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

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

def test_dragon
assert @tester.dragon.match(/\w+/)
end
end