Skip to content

Commit 960e182

Browse files
jmkonivbrazo
authored andcommittedMay 17, 2018
adds bands, albums, and genres to music (#1211)
1 parent da29ae4 commit 960e182

File tree

5 files changed

+60
-2
lines changed

5 files changed

+60
-2
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
### Latest update: 2018-05-17
55

66
**Additions**
7-
7+
- [PR #1211](https://github.com/stympy/faker/pull/1211) Add bands, genres, and albums to Music [@jmkoni](https://github.com/jmkoni)
88
- [PR #1198](https://github.com/stympy/faker/pull/1135) Rename methods on Faker::Types to avoid shadowing ruby standard methods [@MarcPer](https://github.com/MarcPer)
99
- [PR #1135](https://github.com/stympy/faker/pull/1135) Added documentation for dumb and dumber [@cnharris10](https://github.com/cnharris10)
1010
- [PR #1142](https://github.com/stympy/faker/pull/1142) Missing i18n jobs fix [@PuZZleDucK](https://github.com/PuZZleDucK)

‎doc/music.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ Faker::Music.key #=> "C"
66
Faker::Music.chord #=> "Amaj7"
77

88
Faker::Music.instrument #=> "Ukelele"
9+
10+
Faker::Music.band #=> "The Beatles"
11+
12+
Faker::Music.album #=> "Sgt. Pepper's Lonely Hearts Club"
13+
14+
Faker::Music.genre #=> "Rock"
915
```

‎lib/faker/music.rb

+12
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ def key_types
2828
def chord_types
2929
['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5']
3030
end
31+
32+
def band
33+
fetch('music.bands')
34+
end
35+
36+
def album
37+
fetch('music.albums')
38+
end
39+
40+
def genre
41+
fetch('music.genres')
42+
end
3143
end
3244
end
3345
end

‎lib/locales/en/music.yml

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
en:
22
faker:
33
music:
4-
instruments: ['Electric Guitar', 'Acoustic Guitar', 'Flute', 'Trumpet', 'Clarinet', 'Cello', 'Harp', 'Xylophone', 'Harmonica', 'Accordion', 'Organ', 'Piano', 'Ukelele', 'Saxophone', 'Drums', 'Violin', 'Bass Guitar']
4+
instruments: ['Electric Guitar', 'Acoustic Guitar', 'Flute', 'Trumpet', 'Clarinet', 'Cello', 'Harp', 'Xylophone', 'Harmonica', 'Accordion', 'Organ', 'Piano', 'Ukelele', 'Saxophone', 'Drums', 'Violin', 'Bass Guitar', 'Oboe']
5+
bands: ["AC/DC", "Adam and the Ants", "Afrika Bambaataa", "Al Foster", "Alan Parsons", "Alex Chilton", "Amy Winehouse", "Annie Lennox", "Arctic Monkeys", "B.B. King",
6+
"Bauhaus", "The Beatles", "Beck", "Billy Idol", "The Birthday Party", "Björk", "Blinker The Star", "Blondie", "Blur", "Bob Dylan", "Bob Marley (and the Wailers)",
7+
"Brian Wilson", "Bruce Springsteen", "Buzzcocks", "Captain Beefheart", "Carlos Santana", "Cat Anderson", "Cat Stevens", "Catherine Wheel", "Chic", "Chris Isaak",
8+
"Chrissie Hynde", "Chuck Berry", "The Clash", "Cliff Richard (and the Shadows)", "Coldplay", "Cootie Williams", "Cortinas", " The", "The Cramps", "The Cranberries",
9+
"Cream", "The Cure", "David Bowie", "David Gilmour", "Deepest Blue", "Devo", "Dizzy Gillespie", "Dr Feelgood", "Duke Ellington", "Ed Sheeran", "Ella Fitzgerald",
10+
"Elton John", "Elvis Costello", "Elvis Presley", "Eric Clapton", "The Faces", "Fats Domino", "Flaming Lips", "Florence and the Machine", "Foo Fighters", "Frank Sinatra",
11+
"Frank Zappa", "Frightened Rabbit", "George Michael", "Grace Jones", "Green Day", "Guns N' Roses", "Herbie Hancock", "Horace Silver", "Hugh Masekela", "Ian Dury", "Iggy Pop",
12+
"The Jam", "James Brown", "Jeff Beck", "Jeff Buckley", "Jimi Hendrix", "John Coltrane", "John Lydon", "Johnny Borrell", "Johnny Cash", "Johnny Marr", "Joni Mitchell", "Joy Division",
13+
"K.D Lang", "Kasabian", "Kate Bush", "Keith Moon", "Keith Richards", "The Kinks", "Kiss", "The La's", "Led Zeppelin", "Lenny Kravitz", "Leonard Cohen", "Liam Gallagher",
14+
"The Libertines", "Madness", "Madonna", "Manic Street Preachers", "Marc Bolan", "Marianne Faithfull", "Marilyn Manson", "The Mars Volta", "Max Roach", "Michael Jackson",
15+
"Miles Davis", "Morrissey", "Muddy Waters", "Mumford and Sons", "Muse", "Neil Young", "New Order", "Nick Cave", "Nigel Kennedy", "Nina Simone", "Nirvana", "Noel Gallagher",
16+
"O.A.R.", "Oasis", "Offspring", "Ozzy Osbourne", "Pat Metheny", "Patti Smith", "Paul Weller", "Pearl Jam", "Pete Townshend", "Phil Collins", "Phish", "Pink Floyd", "PJ Harvey",
17+
"The Police", "The Pretenders", "Primal Scream", "Prince", "Program The Dead", "Pulp", "Queen", "Radiohead", "The Ramones", "Red Hot Chili Peppers", "R.E.M.", "Rick Wright",
18+
"Rod Stewart", "The Rolling Stones", "Rory Gallagher", "Roxy Music", "Roy Hargrove", "Rufus Wainwright", "Run-D.M.C.", "Ryan Adams", "Sex Pistols", "Simply Red",
19+
"Sinead O'connor", "Siouxsie and The Banshees", "The Slits", "The Smiths", "Sonic Youth", "The Specials", "Squeeze", "Status Quo", "Stereophonics", "Stone Roses",
20+
"Syd Barrett", "Thelonius Monk", "Thin Lizzy", "Thornley", "Tina Turner", "Tom Jones", "Tom Robinson", "Tom Waits", "U2", "The Undertones", "Van Morrison", "Velvet Revolver",
21+
"White Stripes", "The Who", "The Yardbirds", "Yumi Matsutoya"]
22+
albums: ["Thriller", "Back in Black", "The Dark Side of the Moon", "Bat Out of Hell", "The Bodyguard", "Their Greatest Hits (1971–1975)", "Saturday Night Fever", "Rumours",
23+
"Grease: The Original Soundtrack from the Motion Picture", "Led Zeppelin IV", "Bad", "Jagged Little Pill", "Come On Over", "Falling into You", "Sgt. Pepper's Lonely Hearts Club Band",
24+
"Hotel California", "Dirty Dancing", "21", "Let's Talk About Love", "1", "Gold: Greatest Hits", "Dangerous", "The Immaculate Collection", "Abbey Road", "Born in the U.S.A.",
25+
"Brothers in Arms", "Titanic: Music from the Motion Picture", "Metallica", "Nevermind", "The Wall", "Supernatural", "Appetite for Destruction", "Slippery When Wet", "Music Box",
26+
"The Eminem Show", "Hybrid Theory", "Come Away with Me", "Unplugged", "True Blue", "Legend: The Best of Bob Marley & The Wailers", "Tapestry", "No Jacket Required", "Greatest Hits",
27+
"Bridge over Troubled Water", "The Joshua Tree", "...Baby One More Time", "Backstreet's Back", "Backstreet Boys", "Millennium", "Spice", "Happy Nation", "The Sign", "Whitney Houston",
28+
"(What's the Story) Morning Glory?", "The Marshall Mathers LP", "Like a Virgin", "Cross Road", "25", "Boston", "Oops!... I Did It Again", "The Colour of My Love", "Hysteria", "Faith",
29+
"Dookie", "Can't Slow Down", "Daydream", "HIStory: Past", " Present and Future", " Book I", "Off the Wall", "The Woman in Me", "Breakfast in America", "Tracy Chapman",
30+
"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",
31+
"I Dreamed a Dream", "Recovery", "Midnight Memories", "Frozen", "Lemonade"]
32+
genres: ["Rock", "Pop", "Electronic", "Folk", "World", "Country", "Jazz", "Funk", "Soul", "Hip Hop", "Classical", "Latin", "Reggae", "Stage And Screen", "Blues", "Non Music", "Rap"]

‎test/test_faker_music.rb

+12
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,16 @@ def test_instrument
4444
def test_chord
4545
assert @tester.name.match(/([A-Z])+(b|#){0,1}+([a-zA-Z0-9]{0,4})/)
4646
end
47+
48+
def test_band
49+
assert @tester.band.match(/\w+/)
50+
end
51+
52+
def test_album
53+
assert @tester.album.match(/\w+/)
54+
end
55+
56+
def test_genre
57+
assert @tester.genre.match(/\w+/)
58+
end
4759
end

0 commit comments

Comments
 (0)