From 3de9c6cba0989c574860232a979fa63588a29649 Mon Sep 17 00:00:00 2001 From: Saurabh Udaniya Date: Tue, 17 Jul 2018 23:05:42 +0530 Subject: [PATCH] Add Faker::SouthPark (#1314) * Added south park feature * Renamed south_park.doc to south_park.md * Updated README to reflect newly added SouthPark feature * Update CHANGELOG.md --- CHANGELOG.md | 1 + README.md | 1 + doc/south_park.md | 7 +++++++ lib/faker/south_park.rb | 15 +++++++++++++++ lib/locales/en/south_park.yml | 5 +++++ test/test_faker_south_park.rb | 17 +++++++++++++++++ 6 files changed, 46 insertions(+) create mode 100644 doc/south_park.md create mode 100644 lib/faker/south_park.rb create mode 100644 lib/locales/en/south_park.yml create mode 100644 test/test_faker_south_park.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index ec3d385789..0e4817dc5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - [PR #372](https://github.com/stympy/faker/pull/372) Add test_password_could_achieve_max_length [@oleksii-ti](https://github.com/oleksii-ti) ### Feature Request +- [PR #1314](https://github.com/stympy/faker/pull/1314) Add Faker::SouthPark [@saurabhudaniya200](https://github.com/saurabhudaniya200) - [PR #1313](https://github.com/stympy/faker/pull/1313) Add Faker::Restaurant [@dwhitlow](https://github.com/dwhitlow) - [PR #1307](https://github.com/stympy/faker/pull/1307) Add "exclude" method to UniqueGenerator [@mtancoigne](https://github.com/mtancoigne) - [PR #1115](https://github.com/stympy/faker/pull/1115) Add Faker::Cosmere [@JauntyJames](https://github.com/JauntyJames) diff --git a/README.md b/README.md index 9e61c6fac8..1b0bbf3ade 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ Contents - [Faker::SingularSiegler](doc/singular_siegler.md) - [Faker::SlackEmoji](doc/slack_emoji.md) - [Faker::Source](doc/source.md) + - [Faker::SouthPark](doc/south_park.md) - [Faker::Space](doc/space.md) - [Faker::StarTrek](doc/star_trek.md) - [Faker::StarWars](doc/star_wars.md) diff --git a/doc/south_park.md b/doc/south_park.md new file mode 100644 index 0000000000..ec760b06d2 --- /dev/null +++ b/doc/south_park.md @@ -0,0 +1,7 @@ +# Faker::SouthPark + +```ruby +Faker::SouthPark.character #=> "Mr. Garrison" + +Faker::SouthPark.quote #=> "I'm just getting a little cancer Stan" +``` diff --git a/lib/faker/south_park.rb b/lib/faker/south_park.rb new file mode 100644 index 0000000000..708e6dbe3d --- /dev/null +++ b/lib/faker/south_park.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Faker + class SouthPark < Base + class << self + def character + fetch('south_park.characters') + end + + def quote + fetch('south_park.quotes') + end + end + end +end diff --git a/lib/locales/en/south_park.yml b/lib/locales/en/south_park.yml new file mode 100644 index 0000000000..cd6579fc7e --- /dev/null +++ b/lib/locales/en/south_park.yml @@ -0,0 +1,5 @@ +en: + faker: + south_park: + characters: ["Sharon Marsh", "Officer Barbrady", "Jesus", "Token Black", "Dr. Alphonse Mephesto", "Stephen Stotch", "Heidi Turner", "Jimmy Valmer", "Sheila Broflovski", "Jimbo Kern", "Ike Broflovski", "Kevin McCormick", "Father Maxi", "Grandpa Marvin Marsh", "Clyde Donovan", "Butters Stotch", "Shelly Marsh", "Kyle Broflovski", "Stuart McCormick", "Carol McCormick", "Timmy Burch", "Ned Gerblansky", "Mr. Mackey", "Satan", "Moses", "PC Principal", "Bradley Biggle", "Randy Marsh", "Kenny McCormick", "Terrance and Phillip", "Mr. Slave", "Sergeant Harrison Yates", "Lemmiwinks", "Mr. Hankey", "Wendy Testaburger", "Santa", "God", "Stan Marsh", "Towelie", "Gerald Broflovski", "Bebe Stevens", "Starvin' Marvin", "Karen McCormick", "David Rodriguez", "Eric Cartman", "Mayor McDaniels", "Tuong Lu Kim", "Tweek Tweak", "Dougie", "Craig Tucker", "Mr. Garrison", "Pip", "Liane Cartman", "Scott Malkinson", "Linda Stotch"] + quotes: ["Hippies. They're everywhere. They wanna save Earth, but all they do is smoke pot and smell bad", "They took our deers", "Kenny’s family is so poor that yesterday, they had to put their cardboard box up for a second mortgage", "Without evil there could be no good, so it must be good to be evil sometimes", "Dad, Tom Cruise won't come out of the closet!", "They took der derrs", "I'm not just sure, I'm HIV positive", "I don't make the rules Kyle, I simply think them up and write them down", "I'm just getting a little cancer Stan", "Respect my authoritaahh!!!", "Your mother was worried sick and I was here drinking beer", "Hey Panda Bear! We don't take kindly to your types around here.", "You know what they say: You can't teach a gay dog straight tricks", "They took our jobs", "Maybe we should send you to a concentration camp", "Life is short butters, & thats why you have to do whatever you want all the time", "No we haven't actually seen it Tom, we're just reporting it"] diff --git a/test/test_faker_south_park.rb b/test/test_faker_south_park.rb new file mode 100644 index 0000000000..0c9479d6b1 --- /dev/null +++ b/test/test_faker_south_park.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require_relative 'test_helper' + +class TestFakerSouthPark < Test::Unit::TestCase + def setup + @tester = Faker::SouthPark + end + + def test_character + assert @tester.character.match(/\w+/) + end + + def test_quote + assert @tester.quote.match(/\w+/) + end +end