Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Music, Movies and TvShows namespaces #1480

Merged
merged 9 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions doc/unreleased/movies/harry_potter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Faker::Movies::HarryPotter

Available since version 1.7.3.

```ruby
Faker::Movies::HarryPotter.character #=> "Harry Potter"

Faker::Movies::HarryPotter.location #=> "Hogwarts"

Faker::Movies::HarryPotter.quote #=> "I solemnly swear that I am up to no good."

Faker::Movies::HarryPotter.book #=> "Harry Potter and the Chamber of Secrets"

Faker::Movies::HarryPotter.house #=> "Gryffindor"

Faker::Movies::HarryPotter.spell #=> "Reparo"
```
19 changes: 19 additions & 0 deletions doc/unreleased/movies/hitchhikers_guide_to_the_galaxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Faker::Movies::HitchhikersGuideToTheGalaxy

Available since version 1.8.0.

```ruby
Faker::Movies::HitchhikersGuideToTheGalaxy.character #=> "Marvin"

Faker::Movies::HitchhikersGuideToTheGalaxy.location #=> "Arthur Dent's house"

Faker::Movies::HitchhikersGuideToTheGalaxy.marvin_quote #=> "Life? Don't talk to me about life."

Faker::Movies::HitchhikersGuideToTheGalaxy.planet #=> "Magrathea"

Faker::Movies::HitchhikersGuideToTheGalaxy.quote #=> "In the beginning, the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Faker::Movies::HitchhikersGuideToTheGalaxy.specie #=> "Perfectly Normal Beast"

Faker::Movies::HitchhikersGuideToTheGalaxy.starship #=> "Vogon Constructor Fleet"
```
5 changes: 5 additions & 0 deletions doc/unreleased/music/rock_band.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Faker::Music::RockBand

```ruby
Faker::Music::RockBand.name #=> "Led Zeppelin"
```
7 changes: 7 additions & 0 deletions doc/unreleased/tv_shows/michael_scott.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Faker::TvShows::MichaelScott

Available since version 1.9.0.

```ruby
Faker::TvShows::MichaelScott.quote #=> "I am Beyoncé, always."
```
8 changes: 8 additions & 0 deletions doc/unreleased/tv_shows/rupaul.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Faker::TvShows::RuPaul

Available since version 1.8.0.

```ruby
Faker::TvShows::RuPaul.quote #=> "That's Funny, Tell Another One"
Faker::TvShows::RuPaul.queen #=> "Latrice Royale"
```
31 changes: 0 additions & 31 deletions lib/faker/default/harry_potter.rb

This file was deleted.

35 changes: 0 additions & 35 deletions lib/faker/default/hitchhikers_guide_to_the_galaxy.rb

This file was deleted.

11 changes: 0 additions & 11 deletions lib/faker/default/michael_scott.rb

This file was deleted.

17 changes: 0 additions & 17 deletions lib/faker/default/rupaul.rb

This file was deleted.

40 changes: 40 additions & 0 deletions lib/faker/deprecate/harry_potter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true

module Faker
class HarryPotter < Base
class << self
extend Gem::Deprecate

def character
Faker::Movies::HarryPotter.character
end

def location
Faker::Movies::HarryPotter.location
end

def quote
Faker::Movies::HarryPotter.quote
end

def book
Faker::Movies::HarryPotter.book
end

def house
Faker::Movies::HarryPotter.house
end

def spell
Faker::Movies::HarryPotter.spell
end

deprecate :character, 'Faker::Movies::HarryPotter.character', 2018, 12
deprecate :location, 'Faker::Movies::HarryPotter.location', 2018, 12
deprecate :quote, 'Faker::Movies::HarryPotter.quote', 2018, 12
deprecate :book, 'Faker::Movies::HarryPotter.book', 2018, 12
deprecate :house, 'Faker::Movies::HarryPotter.house', 2018, 12
deprecate :spell, 'Faker::Movies::HarryPotter.spell', 2018, 12
end
end
end
44 changes: 44 additions & 0 deletions lib/faker/deprecate/hitchhikers_guide_to_the_galaxy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# frozen_string_literal: true

module Faker
class HitchhikersGuideToTheGalaxy < Base
class << self
extend Gem::Deprecate

def character
Faker::Movies::HitchhikersGuideToTheGalaxy.character
end

def location
Faker::Movies::HitchhikersGuideToTheGalaxy.location
end

def marvin_quote
Faker::Movies::HitchhikersGuideToTheGalaxy.marvin_quote
end

def planet
Faker::Movies::HitchhikersGuideToTheGalaxy.planet
end

def quote
Faker::Movies::HitchhikersGuideToTheGalaxy.quote
end

def specie
Faker::Movies::HitchhikersGuideToTheGalaxy.specie
end

def starship
Faker::Movies::HitchhikersGuideToTheGalaxy.starship
end

deprecate :character, 'Faker::Movies::HitchhikersGuideToTheGalaxy.character', 2018, 12
deprecate :location, 'Faker::Movies::HitchhikersGuideToTheGalaxy.location', 2018, 12
deprecate :marvin_quote, 'Faker::Movies::HitchhikersGuideToTheGalaxy.marvin_quote', 2018, 12
deprecate :planet, 'Faker::Movies::HitchhikersGuideToTheGalaxy.planet', 2018, 12
deprecate :specie, 'Faker::Movies::HitchhikersGuideToTheGalaxy.specie', 2018, 12
deprecate :starship, 'Faker::Movies::HitchhikersGuideToTheGalaxy.starship', 2018, 12
end
end
end
15 changes: 15 additions & 0 deletions lib/faker/deprecate/michael_scott.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Faker
class MichaelScott < Base
class << self
extend Gem::Deprecate

def quote
Faker::TvShows::MichaelScott.quote
end

deprecate :quote, 'Faker::TvShows::MichaelScott.quote', 2018, 12
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
module Faker
class RockBand < Base
class << self
extend Gem::Deprecate

def name
fetch('rock_band.name')
Faker::Music::RockBand.name
end

deprecate :name, 'Faker::Music::RockBand.name', 2018, 12
end
end
end
22 changes: 22 additions & 0 deletions lib/faker/deprecate/ru_paul.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

module Faker
class RuPaul < Base
flexible :rupaul

class << self
extend Gem::Deprecate

def quote
Faker::TvShows::RuPaul.quote
end

def queen
Faker::TvShows::RuPaul.queen
end

deprecate :quote, 'Faker::TvShows::RuPaul.quote', 2018, 12
deprecate :queen, 'Faker::TvShows::RuPaul.queen', 2018, 12
end
end
end
33 changes: 33 additions & 0 deletions lib/faker/movies/harry_potter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

module Faker
module Movies
class HarryPotter < Base
class << self
def character
fetch('harry_potter.characters')
end

def location
fetch('harry_potter.locations')
end

def quote
fetch('harry_potter.quotes')
end

def book
fetch('harry_potter.books')
end

def house
fetch('harry_potter.houses')
end

def spell
fetch('harry_potter.spells')
end
end
end
end
end
37 changes: 37 additions & 0 deletions lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: true

module Faker
module Movies
class HitchhikersGuideToTheGalaxy < Base
class << self
def character
fetch('hitchhikers_guide_to_the_galaxy.characters')
end

def location
fetch('hitchhikers_guide_to_the_galaxy.locations')
end

def marvin_quote
fetch('hitchhikers_guide_to_the_galaxy.marvin_quote')
end

def planet
fetch('hitchhikers_guide_to_the_galaxy.planets')
end

def quote
fetch('hitchhikers_guide_to_the_galaxy.quotes')
end

def specie
fetch('hitchhikers_guide_to_the_galaxy.species')
end

def starship
fetch('hitchhikers_guide_to_the_galaxy.starships')
end
end
end
end
end
13 changes: 13 additions & 0 deletions lib/faker/music/rock_band.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Faker
class Music
class RockBand < Base
class << self
def name
fetch('rock_band.name')
end
end
end
end
end
13 changes: 13 additions & 0 deletions lib/faker/tv_shows/michael_scott.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Faker
module TvShows
class MichaelScott < Base
class << self
def quote
fetch('michael_scott.quotes')
end
end
end
end
end
Loading