From 543c4e7ba6015025cf12712e8fcc622a04a4b811 Mon Sep 17 00:00:00 2001 From: NickyEXE Date: Wed, 15 Jan 2020 16:20:40 -0500 Subject: [PATCH 1/8] Finished with all tests passing --- README.md | 1 + doc/music/mambo.md | 6 ++++++ lib/faker/music/mambo.rb | 22 ++++++++++++++++++++++ lib/locales/mambo.yml | 13 +++++++++++++ test/faker/music/test_faker_mambo.rb | 13 +++++++++++++ 5 files changed, 55 insertions(+) create mode 100644 doc/music/mambo.md create mode 100644 lib/faker/music/mambo.rb create mode 100644 lib/locales/mambo.yml create mode 100644 test/faker/music/test_faker_mambo.rb diff --git a/README.md b/README.md index ebbe7f3e05..4739be8754 100644 --- a/README.md +++ b/README.md @@ -268,6 +268,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast ### Music - [Faker::Music](doc/music/music.md) - [Faker::Music::GratefulDead](doc/music/grateful_dead.md) + - [Faker::Music::Mambo](doc/music/mambo.md) - [Faker::Music::Opera](doc/music/opera.md) - [Faker::Music::Phish](doc/music/phish.md) - [Faker::Music::RockBand](doc/music/rock_band.md) diff --git a/doc/music/mambo.md b/doc/music/mambo.md new file mode 100644 index 0000000000..9ac93bff7a --- /dev/null +++ b/doc/music/mambo.md @@ -0,0 +1,6 @@ +# Faker::Music::Mambo + +```ruby +Faker::Music::Mambo.name #=> "Monica" + +``` \ No newline at end of file diff --git a/lib/faker/music/mambo.rb b/lib/faker/music/mambo.rb new file mode 100644 index 0000000000..88a67d9417 --- /dev/null +++ b/lib/faker/music/mambo.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Faker + class Music + class Mambo < Base + class << self + ## + # Produces the name of someone that Lou Bega wants a little bit of, according to his hit 1999 song "Mambo No. 5 (A Little Bit of...)" + # + # @return [String] + # + # @example + # Faker::Music::Mambo.name #=> "Monica" + # + # @faker.version next + def name + fetch('mambo.name') + end + end + end + end +end diff --git a/lib/locales/mambo.yml b/lib/locales/mambo.yml new file mode 100644 index 0000000000..065f6390c2 --- /dev/null +++ b/lib/locales/mambo.yml @@ -0,0 +1,13 @@ +en: + faker: + mambo: + name: + - "Angela" + - "Pamela" + - "Sandra" + - "Rita" + - "Monica" + - "Erica" + - "Tina" + - "Mary" + - "Jessica" \ No newline at end of file diff --git a/test/faker/music/test_faker_mambo.rb b/test/faker/music/test_faker_mambo.rb new file mode 100644 index 0000000000..21ca70d915 --- /dev/null +++ b/test/faker/music/test_faker_mambo.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +class TestFakerMambo < Test::Unit::TestCase + def setup + @tester = Faker::Music::Mambo + end + + def test_name + assert @tester.name.match(/\w/) + end +end From fab29b3bd9bf81adfe2dcbf3878f769850a1dda8 Mon Sep 17 00:00:00 2001 From: NickyEXE Date: Thu, 8 Apr 2021 16:46:28 -0400 Subject: [PATCH 2/8] remove Faker::Music::Mambo --- lib/faker/music/mambo.rb | 22 ---------------------- lib/locales/mambo.yml | 13 ------------- 2 files changed, 35 deletions(-) delete mode 100644 lib/faker/music/mambo.rb delete mode 100644 lib/locales/mambo.yml diff --git a/lib/faker/music/mambo.rb b/lib/faker/music/mambo.rb deleted file mode 100644 index 88a67d9417..0000000000 --- a/lib/faker/music/mambo.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module Faker - class Music - class Mambo < Base - class << self - ## - # Produces the name of someone that Lou Bega wants a little bit of, according to his hit 1999 song "Mambo No. 5 (A Little Bit of...)" - # - # @return [String] - # - # @example - # Faker::Music::Mambo.name #=> "Monica" - # - # @faker.version next - def name - fetch('mambo.name') - end - end - end - end -end diff --git a/lib/locales/mambo.yml b/lib/locales/mambo.yml deleted file mode 100644 index 065f6390c2..0000000000 --- a/lib/locales/mambo.yml +++ /dev/null @@ -1,13 +0,0 @@ -en: - faker: - mambo: - name: - - "Angela" - - "Pamela" - - "Sandra" - - "Rita" - - "Monica" - - "Erica" - - "Tina" - - "Mary" - - "Jessica" \ No newline at end of file From c67c20e22b96c4398c02d52c202e80e4450e9854 Mon Sep 17 00:00:00 2001 From: NickyEXE Date: Thu, 8 Apr 2021 16:46:47 -0400 Subject: [PATCH 3/8] add Faker::Music#mambo_no_5 method --- lib/faker/music/music.rb | 12 ++++++++++++ lib/locales/en/music.yml | 1 + 2 files changed, 13 insertions(+) diff --git a/lib/faker/music/music.rb b/lib/faker/music/music.rb index b58a70fd27..dc44067d3c 100644 --- a/lib/faker/music/music.rb +++ b/lib/faker/music/music.rb @@ -128,6 +128,18 @@ def album def genre fetch('music.genres') end + + ## + # Produces a name from Lou Bega's Mambo #5 + # + # @return [String] + # + # @example + # Faker::Music.mambo #=> "Monica" + # @faker.version 2.17.0 + def mambo_no_5 + fetch('music.mambo_no_5') + end end end end diff --git a/lib/locales/en/music.yml b/lib/locales/en/music.yml index 3f9d64d004..bf595c056e 100644 --- a/lib/locales/en/music.yml +++ b/lib/locales/en/music.yml @@ -30,3 +30,4 @@ en: "Flashdance: Original Soundtrack from the Motion Picture", "Whitney", "Confessions", "X&Y", "High School Musical", "High School Musical 2", "Viva la Vida or Death and All His Friends", "I Dreamed a Dream", "Recovery", "Midnight Memories", "Frozen", "Lemonade", "Brand New Eyes", "All We Know Is Falling", "Riot!", "Songs About Jane", "Hands All Over"] genres: ["Rock", "Pop", "Electronic", "Folk", "World", "Country", "Jazz", "Funk", "Soul", "Hip Hop", "Classical", "Latin", "Reggae", "Stage And Screen", "Blues", "Non Music", "Rap"] + mambo_no_5: ["Angela", "Pamela", "Sandra", "Rita", "Monica", "Erica", "Tina", "Mary", "Jessica"] From 07a64b5d0e2f396cd95a73da89d91727806f1610 Mon Sep 17 00:00:00 2001 From: NickyEXE Date: Thu, 8 Apr 2021 16:48:23 -0400 Subject: [PATCH 4/8] remove reference to, tests for Faker::Music::Mambo --- README.md | 1 - doc/music/mambo.md | 6 ------ test/faker/music/test_faker_mambo.rb | 13 ------------- 3 files changed, 20 deletions(-) delete mode 100644 doc/music/mambo.md delete mode 100644 test/faker/music/test_faker_mambo.rb diff --git a/README.md b/README.md index 4739be8754..ebbe7f3e05 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,6 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast ### Music - [Faker::Music](doc/music/music.md) - [Faker::Music::GratefulDead](doc/music/grateful_dead.md) - - [Faker::Music::Mambo](doc/music/mambo.md) - [Faker::Music::Opera](doc/music/opera.md) - [Faker::Music::Phish](doc/music/phish.md) - [Faker::Music::RockBand](doc/music/rock_band.md) diff --git a/doc/music/mambo.md b/doc/music/mambo.md deleted file mode 100644 index 9ac93bff7a..0000000000 --- a/doc/music/mambo.md +++ /dev/null @@ -1,6 +0,0 @@ -# Faker::Music::Mambo - -```ruby -Faker::Music::Mambo.name #=> "Monica" - -``` \ No newline at end of file diff --git a/test/faker/music/test_faker_mambo.rb b/test/faker/music/test_faker_mambo.rb deleted file mode 100644 index 21ca70d915..0000000000 --- a/test/faker/music/test_faker_mambo.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../test_helper' - -class TestFakerMambo < Test::Unit::TestCase - def setup - @tester = Faker::Music::Mambo - end - - def test_name - assert @tester.name.match(/\w/) - end -end From 53b1d9385b09ab0bc0ae48a8dd5b736f35e89a58 Mon Sep 17 00:00:00 2001 From: NickyEXE Date: Thu, 8 Apr 2021 16:49:42 -0400 Subject: [PATCH 5/8] add #mambo_no_5 documentation --- doc/music/music.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/music/music.md b/doc/music/music.md index 022b0e12e4..09032e6229 100644 --- a/doc/music/music.md +++ b/doc/music/music.md @@ -14,4 +14,6 @@ Faker::Music.band #=> "The Beatles" Faker::Music.album #=> "Sgt. Pepper's Lonely Hearts Club" Faker::Music.genre #=> "Rock" + +Faker::Music.mambo_no_5 #=> "Monica" ``` From 82ab0a8c1c4c15fa5cc6b0c56a0d6589d0cf6f58 Mon Sep 17 00:00:00 2001 From: NickyEXE Date: Thu, 8 Apr 2021 16:50:22 -0400 Subject: [PATCH 6/8] add Music#mambo_no_5 test --- test/faker/music/test_faker_music.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/faker/music/test_faker_music.rb b/test/faker/music/test_faker_music.rb index 4a2729142f..74ae50f888 100644 --- a/test/faker/music/test_faker_music.rb +++ b/test/faker/music/test_faker_music.rb @@ -58,4 +58,8 @@ def test_album def test_genre assert @tester.genre.match(/\w+/) end + + def test_mambo_no_5 + assert @tester.mambo_no_5.match(/\w+/) + end end From 54d12c03316fd926badaaad87ed6bc345ecb4b4b Mon Sep 17 00:00:00 2001 From: NickyEXE Date: Thu, 8 Apr 2021 17:15:31 -0400 Subject: [PATCH 7/8] fix music.yml, pass tests --- lib/locales/en/music.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/locales/en/music.yml b/lib/locales/en/music.yml index cdda61b948..2f62fa518b 100644 --- a/lib/locales/en/music.yml +++ b/lib/locales/en/music.yml @@ -310,6 +310,16 @@ en: - Blues - Non Music - Rap + mambo_no_5: + - Angela + - Pamela + - Sandra + - Rita + - Monica + - Erica + - Tina + - Mary + - Jessica hiphop: subgenres: - Low Fi @@ -452,13 +462,3 @@ en: - Nate Dogg - Kurupt - Twista - mambo_no_5: - - Angela - - Pamela - - Sandra - - Rita - - Monica - - Erica - - Tina - - Mary - - Jessica From 164148d9e297c1e276140b5a7b9925444abdf20f Mon Sep 17 00:00:00 2001 From: "Nicky_Dover.exe" Date: Sun, 11 Apr 2021 18:08:18 -0400 Subject: [PATCH 8/8] Update faker version Co-authored-by: Sibi Prabakaran --- lib/faker/music/music.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/faker/music/music.rb b/lib/faker/music/music.rb index dc44067d3c..fe65f9abe1 100644 --- a/lib/faker/music/music.rb +++ b/lib/faker/music/music.rb @@ -136,7 +136,7 @@ def genre # # @example # Faker::Music.mambo #=> "Monica" - # @faker.version 2.17.0 + # @faker.version next def mambo_no_5 fetch('music.mambo_no_5') end