From 49e4c59dfb4d8cf4227a69872c56e795badd7a7a Mon Sep 17 00:00:00 2001 From: Vinicius Date: Wed, 18 Aug 2021 13:44:30 -0300 Subject: [PATCH 1/3] Adding Supernatural Tv Show to Faker --- README.md | 1 + doc/tv_shows/supernatural.md | 7 ++ lib/faker/tv_shows/supernatural.rb | 48 ++++++++ lib/locales/en/supernatural.yml | 141 +++++++++++++++++++++++ test/faker/tv_shows/test_supernatural.rb | 21 ++++ 5 files changed, 218 insertions(+) create mode 100644 doc/tv_shows/supernatural.md create mode 100644 lib/faker/tv_shows/supernatural.rb create mode 100644 lib/locales/en/supernatural.yml create mode 100644 test/faker/tv_shows/test_supernatural.rb diff --git a/README.md b/README.md index 71926e5130..f481b5bc50 100644 --- a/README.md +++ b/README.md @@ -341,6 +341,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast - [Faker::TvShows::Stargate](doc/tv_shows/stargate.md) - [Faker::TvShows::StrangerThings](doc/tv_shows/stranger_things.md) - [Faker::TvShows::Suits](doc/tv_shows/suits.md) + - [Faker::TvShows::Supernatural](doc/tv_shows/supernatural.md) - [Faker::TvShows::TheExpanse](doc/tv_shows/the_expanse.md) - [Faker::TvShows::TheFreshPrinceOfBelAir](doc/tv_shows/the_fresh_prince_of_bel_air.md) - [Faker::TvShows::TheITCrowd](doc/tv_shows/the_it_crowd.md) diff --git a/doc/tv_shows/supernatural.md b/doc/tv_shows/supernatural.md new file mode 100644 index 0000000000..fe1eab08cc --- /dev/null +++ b/doc/tv_shows/supernatural.md @@ -0,0 +1,7 @@ +# Faker::TvShows::Supernatural + +```ruby +Faker::TvShows::Supernatural.character #=> "Sam Winchester" +Faker::TvShows::Supernatural.creature #=> "Vampire" +Faker::TvShows::Supernatural.weapon #=> "Colt" +``` diff --git a/lib/faker/tv_shows/supernatural.rb b/lib/faker/tv_shows/supernatural.rb new file mode 100644 index 0000000000..41507b6346 --- /dev/null +++ b/lib/faker/tv_shows/supernatural.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Faker + class TvShows + class Supernatural < Base + class << self + ## + # Produces the name of a character from Supernatural. + # + # @return [String] + # + # @example + # Faker::TvShows::Supernatural.character #=> "Dean Winchester" + # + # @faker.version next + def character + fetch('supernatural.character') + end + + ## + # Produces the name of a hunted creature. + # + # @return [String] + # + # @example + # Faker::TvShows::Supernatural.creature #=> "Demon" + # + # @faker.version next + def creature + fetch('supernatural.creature') + end + + ## + # Produces the name of a weapon used by the hunters. + # + # @return [String] + # + # @example + # Faker::TvShows::Supernatural.weapon #=> "Colt" + # + # @faker.version next + def weapon + fetch('supernatural.weapon') + end + end + end + end +end diff --git a/lib/locales/en/supernatural.yml b/lib/locales/en/supernatural.yml new file mode 100644 index 0000000000..116f7ac28d --- /dev/null +++ b/lib/locales/en/supernatural.yml @@ -0,0 +1,141 @@ +en: + faker: + supernatural: + character: + - Abaddon + - Adam Milligan + - Alastair + - Alex Jones + - Amelia Richardson + - Anna Milton + - Arthur Ketch + - Ash + - Asmodeus + - Azazel + - Balthazar + - Becky Rosen + - Bela Talbot + - Belphegor + - Ben Braeden + - Benny Lafitte + - Bess Fitzgerald + - Bobby Singer + - Castiel + - Charlie Bradbury + - Christian Campbell + - Claire Novak + - Cole Trenton + - Constance Welch + - Crowley + - Dagon + - Dean Winchester + - Death + - Doctor Hess + - Donatello Redfield + - Donna Hanscum + - Dr. Gaines + - Dumah + - Edgar + - Eileen Leahy + - Eleanor Visyak + - Ellen Harvelle + - Eve + - Frank Devereaux + - Gabriel + - Gadreel + - Garth Fitzgerald IV + - Gavin MacLeod + - Gordon Walker + - Gwen Campbell + - Hannah + - Harry Spengler + - Ingrid + - Jack Kline + - Jenny + - Jessica Moore + - Jo Harvelle + - Jody Mills + - John Wayne Gacy + - John Winchester + - Josie Sands + - Karen Singer + - Kevin Tran + - Lady Toni Bevell + - Lilith + - Linda Tran + - Lisa Braeden + - Lucifer + - Mary Winchester + - Mary Worthington + - Meg Masters + - Metatron + - Michael + - Mick Davies + - Naomi + - Nick + - Pamela Barnes + - Raphael + - Rowena MacLeod + - Ruby + - Rufus Turner + - Sam Winchester + - Samandriel + - Samuel Campbell + - Sergei + - Susan + - Tessa + - Uriel + - Victor Henriksen + - Zachariah + creature: + - Angel + - Archangel + - Croatoan Virus + - Demon + - Djinn + - Dragon + - Elf + - Ghost + - Ghoul + - Hellhounds + - Kappa + - Khan worm + - Leprechauns + - Leviathan + - Loch Ness Monster + - Mermaid + - Monster + - Phoenix + - Poltergeist + - Shapeshifter + - Soul Eater + - Tricksters + - Wendigo + - Werewolf + - Zombie + - Vampire + weapon: + - Archangel Blades + - Brass + - Cain's knife + - Crowley's bones + - Death's Scythe + - Death's ring + - Excalibur + - Fire + - Hands Of God + - Holy Oil + - Holy Water + - Lamb blood + - Lance Of Michael + - Rabbit's Foot + - Righteous Bone + - Salt + - Silver Bullets + - Staff of Moses + - Sword of St. George + - The Equalizer + - The First Blade + - Virgin blood + - steel + - The Colt \ No newline at end of file diff --git a/test/faker/tv_shows/test_supernatural.rb b/test/faker/tv_shows/test_supernatural.rb new file mode 100644 index 0000000000..ce93556009 --- /dev/null +++ b/test/faker/tv_shows/test_supernatural.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerTvShowsSupernatural < Test::Unit::TestCase + def setup + @tester = Faker::TvShows::Supernatural + end + + def test_character + assert @tester.character.match(/\w+/) + end + + def test_creature + assert @tester.creature.match(/\w+/) + end + + def test_weapon + assert @tester.weapon.match(/\w+/) + end +end From e1dd8212f4472531a858ea75d75100480092ede1 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Wed, 18 Aug 2021 14:07:13 -0300 Subject: [PATCH 2/3] Adding the last new line to the supernatural.yml file --- lib/locales/en/supernatural.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/locales/en/supernatural.yml b/lib/locales/en/supernatural.yml index 116f7ac28d..cad3d50c2b 100644 --- a/lib/locales/en/supernatural.yml +++ b/lib/locales/en/supernatural.yml @@ -138,4 +138,5 @@ en: - The First Blade - Virgin blood - steel - - The Colt \ No newline at end of file + - The Colt + \ No newline at end of file From 73488bfaec851952be79ab572c98198d849ab865 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Wed, 18 Aug 2021 14:09:29 -0300 Subject: [PATCH 3/3] Fixing the last new line to the supernatural.yml file --- lib/locales/en/supernatural.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/locales/en/supernatural.yml b/lib/locales/en/supernatural.yml index cad3d50c2b..9d08028119 100644 --- a/lib/locales/en/supernatural.yml +++ b/lib/locales/en/supernatural.yml @@ -139,4 +139,3 @@ en: - Virgin blood - steel - The Colt - \ No newline at end of file