Skip to content

Commit

Permalink
adds bands, albums, and genres to music (#1211)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkoni authored and vbrazo committed May 17, 2018
1 parent da29ae4 commit 960e182
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### Latest update: 2018-05-17

**Additions**

- [PR #1211](https://github.com/stympy/faker/pull/1211) Add bands, genres, and albums to Music [@jmkoni](https://github.com/jmkoni)
- [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)
- [PR #1135](https://github.com/stympy/faker/pull/1135) Added documentation for dumb and dumber [@cnharris10](https://github.com/cnharris10)
- [PR #1142](https://github.com/stympy/faker/pull/1142) Missing i18n jobs fix [@PuZZleDucK](https://github.com/PuZZleDucK)
Expand Down
6 changes: 6 additions & 0 deletions doc/music.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ Faker::Music.key #=> "C"
Faker::Music.chord #=> "Amaj7"

Faker::Music.instrument #=> "Ukelele"

Faker::Music.band #=> "The Beatles"

Faker::Music.album #=> "Sgt. Pepper's Lonely Hearts Club"

Faker::Music.genre #=> "Rock"
```
12 changes: 12 additions & 0 deletions lib/faker/music.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ def key_types
def chord_types
['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5']
end

def band
fetch('music.bands')
end

def album
fetch('music.albums')
end

def genre
fetch('music.genres')
end
end
end
end
30 changes: 29 additions & 1 deletion lib/locales/en/music.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
en:
faker:
music:
instruments: ['Electric Guitar', 'Acoustic Guitar', 'Flute', 'Trumpet', 'Clarinet', 'Cello', 'Harp', 'Xylophone', 'Harmonica', 'Accordion', 'Organ', 'Piano', 'Ukelele', 'Saxophone', 'Drums', 'Violin', 'Bass Guitar']
instruments: ['Electric Guitar', 'Acoustic Guitar', 'Flute', 'Trumpet', 'Clarinet', 'Cello', 'Harp', 'Xylophone', 'Harmonica', 'Accordion', 'Organ', 'Piano', 'Ukelele', 'Saxophone', 'Drums', 'Violin', 'Bass Guitar', 'Oboe']
bands: ["AC/DC", "Adam and the Ants", "Afrika Bambaataa", "Al Foster", "Alan Parsons", "Alex Chilton", "Amy Winehouse", "Annie Lennox", "Arctic Monkeys", "B.B. King",
"Bauhaus", "The Beatles", "Beck", "Billy Idol", "The Birthday Party", "Björk", "Blinker The Star", "Blondie", "Blur", "Bob Dylan", "Bob Marley (and the Wailers)",
"Brian Wilson", "Bruce Springsteen", "Buzzcocks", "Captain Beefheart", "Carlos Santana", "Cat Anderson", "Cat Stevens", "Catherine Wheel", "Chic", "Chris Isaak",
"Chrissie Hynde", "Chuck Berry", "The Clash", "Cliff Richard (and the Shadows)", "Coldplay", "Cootie Williams", "Cortinas", " The", "The Cramps", "The Cranberries",
"Cream", "The Cure", "David Bowie", "David Gilmour", "Deepest Blue", "Devo", "Dizzy Gillespie", "Dr Feelgood", "Duke Ellington", "Ed Sheeran", "Ella Fitzgerald",
"Elton John", "Elvis Costello", "Elvis Presley", "Eric Clapton", "The Faces", "Fats Domino", "Flaming Lips", "Florence and the Machine", "Foo Fighters", "Frank Sinatra",
"Frank Zappa", "Frightened Rabbit", "George Michael", "Grace Jones", "Green Day", "Guns N' Roses", "Herbie Hancock", "Horace Silver", "Hugh Masekela", "Ian Dury", "Iggy Pop",
"The Jam", "James Brown", "Jeff Beck", "Jeff Buckley", "Jimi Hendrix", "John Coltrane", "John Lydon", "Johnny Borrell", "Johnny Cash", "Johnny Marr", "Joni Mitchell", "Joy Division",
"K.D Lang", "Kasabian", "Kate Bush", "Keith Moon", "Keith Richards", "The Kinks", "Kiss", "The La's", "Led Zeppelin", "Lenny Kravitz", "Leonard Cohen", "Liam Gallagher",
"The Libertines", "Madness", "Madonna", "Manic Street Preachers", "Marc Bolan", "Marianne Faithfull", "Marilyn Manson", "The Mars Volta", "Max Roach", "Michael Jackson",
"Miles Davis", "Morrissey", "Muddy Waters", "Mumford and Sons", "Muse", "Neil Young", "New Order", "Nick Cave", "Nigel Kennedy", "Nina Simone", "Nirvana", "Noel Gallagher",
"O.A.R.", "Oasis", "Offspring", "Ozzy Osbourne", "Pat Metheny", "Patti Smith", "Paul Weller", "Pearl Jam", "Pete Townshend", "Phil Collins", "Phish", "Pink Floyd", "PJ Harvey",
"The Police", "The Pretenders", "Primal Scream", "Prince", "Program The Dead", "Pulp", "Queen", "Radiohead", "The Ramones", "Red Hot Chili Peppers", "R.E.M.", "Rick Wright",
"Rod Stewart", "The Rolling Stones", "Rory Gallagher", "Roxy Music", "Roy Hargrove", "Rufus Wainwright", "Run-D.M.C.", "Ryan Adams", "Sex Pistols", "Simply Red",
"Sinead O'connor", "Siouxsie and The Banshees", "The Slits", "The Smiths", "Sonic Youth", "The Specials", "Squeeze", "Status Quo", "Stereophonics", "Stone Roses",
"Syd Barrett", "Thelonius Monk", "Thin Lizzy", "Thornley", "Tina Turner", "Tom Jones", "Tom Robinson", "Tom Waits", "U2", "The Undertones", "Van Morrison", "Velvet Revolver",
"White Stripes", "The Who", "The Yardbirds", "Yumi Matsutoya"]
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",
"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",
"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.",
"Brothers in Arms", "Titanic: Music from the Motion Picture", "Metallica", "Nevermind", "The Wall", "Supernatural", "Appetite for Destruction", "Slippery When Wet", "Music Box",
"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",
"Bridge over Troubled Water", "The Joshua Tree", "...Baby One More Time", "Backstreet's Back", "Backstreet Boys", "Millennium", "Spice", "Happy Nation", "The Sign", "Whitney Houston",
"(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",
"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",
"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"]
genres: ["Rock", "Pop", "Electronic", "Folk", "World", "Country", "Jazz", "Funk", "Soul", "Hip Hop", "Classical", "Latin", "Reggae", "Stage And Screen", "Blues", "Non Music", "Rap"]
12 changes: 12 additions & 0 deletions test/test_faker_music.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,16 @@ def test_instrument
def test_chord
assert @tester.name.match(/([A-Z])+(b|#){0,1}+([a-zA-Z0-9]{0,4})/)
end

def test_band
assert @tester.band.match(/\w+/)
end

def test_album
assert @tester.album.match(/\w+/)
end

def test_genre
assert @tester.genre.match(/\w+/)
end
end

0 comments on commit 960e182

Please sign in to comment.