-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 Faker::Games namespace #1412
Merged
vbrazo
merged 34 commits into
faker-ruby:master
from
ChaoticBoredom:organize-games-into-games-dir
Oct 22, 2018
Merged
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
49180e1
Move games files into 'games' folder
ChaoticBoredom 5b42e14
Migrate all 'elder_scrolls' code to the 'games' namespace
ChaoticBoredom eb9f0a0
Move 'zelda' to the correct 'namespace'
ChaoticBoredom 184103c
Update 'fallout' to be in the 'games' namespace
ChaoticBoredom f9073b7
Update 'pokemon' to be in the 'games' namespace
ChaoticBoredom 877e1c5
Update 'world_of_warcraft' to be in the 'games' namespace
ChaoticBoredom e7d880c
Update 'overwatch' to be in the 'games' namespace
ChaoticBoredom 66184df
Update 'myst' to be in the 'games' namespace
ChaoticBoredom d9ea55d
Update 'league_of_legends' to be in the 'games' namespace
ChaoticBoredom 1a6de7e
Update 'dota' to be in the 'games' namespace
ChaoticBoredom 05380ea
Merge branch 'master' into organize-games-into-games-dir
ChaoticBoredom f8412a9
Move 'witcher' to be under 'games' namespace
ChaoticBoredom 0749b85
Remove rubocop warning
ChaoticBoredom 58275a8
Restore old file, deprecate methods in favour of new namespaced version
ChaoticBoredom 83eacbf
Restore 'dota' file, add deprecations
ChaoticBoredom 48568d1
Restore 'elder_scrolls' and deprecate
ChaoticBoredom d7ab01b
Restore 'heroes_of_the_storm' and deprecate
ChaoticBoredom f5fa773
Restore 'league_of_legends' and deprecate
ChaoticBoredom bc36528
Restore 'myst' and deprecate
ChaoticBoredom bb1571b
Restore 'overwatch' and deprecate
ChaoticBoredom 7be5b5a
Restore 'pokemon' and deprecate
ChaoticBoredom d36540a
Restore 'world_of_warcraft' and deprecate
ChaoticBoredom 54c5e7b
Restore 'zelda' and deprecate
ChaoticBoredom ae0929e
Merge branch 'master' into organize-games-into-games-dir
ChaoticBoredom fc36de5
Address mucked up merge
ChaoticBoredom d883d75
Restore 'fallout' and deprecate
ChaoticBoredom 9fdf518
Merge mess still
ChaoticBoredom 7e761bf
Address rubocop violation
ChaoticBoredom 228e762
Remove duplicated entry
ChaoticBoredom 963de38
Remove extra '::'
ChaoticBoredom 8847254
Add tests for the newly deprecated methods
ChaoticBoredom 0f56f8f
Merge remote-tracking branch 'origin/master' into organize-games-into…
ChaoticBoredom c8f3cd6
Update CHANGELOG.md
vbrazo bee5c8d
Merge branch 'master' into organize-games-into-games-dir
vbrazo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# Faker::Dota | ||
# Faker::Games::Dota | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
# Random hero | ||
Faker::Dota.hero #=> "Abaddon" | ||
Faker::Games::Dota.hero #=> "Abaddon" | ||
|
||
# Random item | ||
Faker::Dota.item #=> "You have called death upon yourself." | ||
Faker::Games::Dota.item #=> "You have called death upon yourself." | ||
|
||
# Random team | ||
Faker::Dota.team #=> "Evil Geniuses" | ||
Faker::Games::Dota.team #=> "Evil Geniuses" | ||
|
||
# Random player | ||
Faker::Dota.player #=> "Dendi" | ||
Faker::Games::Dota.player #=> "Dendi" | ||
|
||
# Random quote | ||
Faker::Dota.quote #=> "Easy now, this stuff is explosive!" | ||
Faker::Dota.quote(hero = 'alchemist') #=> "Better living through alchemy!" | ||
``` | ||
Faker::Games::Dota.quote #=> "Easy now, this stuff is explosive!" | ||
Faker::Games::Dota.quote(hero = 'alchemist') #=> "Better living through alchemy!" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# Faker::ElderScrolls | ||
# Faker::Games::ElderScrolls | ||
|
||
```ruby | ||
Faker::ElderScrolls.race #=> Argonian | ||
Faker::Games::ElderScrolls.race #=> Argonian | ||
|
||
Faker::ElderScrolls.city #=> Solitude | ||
Faker::Games::ElderScrolls.city #=> Solitude | ||
|
||
Faker::ElderScrolls.creature #=> Frost Troll | ||
Faker::Games::ElderScrolls.creature #=> Frost Troll | ||
|
||
Faker::ElderScrolls.region #=> Cyrodiil | ||
Faker::Games::ElderScrolls.region #=> Cyrodiil | ||
|
||
Faker::ElderScrolls.dragon #=> Blood Dragon | ||
Faker::Games::ElderScrolls.dragon #=> Blood Dragon | ||
|
||
Faker::ElderScrolls.first_name #=> Astrid | ||
Faker::Games::ElderScrolls.first_name #=> Astrid | ||
|
||
Faker::ElderScrolls.last_name #=> Mallory | ||
Faker::Games::ElderScrolls.last_name #=> Mallory | ||
|
||
Faker::ElderScrolls.name #=> Babette Brill | ||
Faker::Games::ElderScrolls.name #=> Babette Brill | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Faker::Fallout | ||
# Faker::Games::Fallout | ||
|
||
```ruby | ||
Faker::Fallout.character #=> "Dogmeat" | ||
Faker::Games::Fallout.character #=> "Dogmeat" | ||
|
||
Faker::Fallout.faction #=> "The Institute" | ||
Faker::Games::Fallout.faction #=> "The Institute" | ||
|
||
Faker::Fallout.location #=> "Capital Wasteland" | ||
Faker::Games::Fallout.location #=> "Capital Wasteland" | ||
|
||
Faker::Fallout.quote #=> "Democracy is non-negotiable" | ||
``` | ||
Faker::Games::Fallout.quote #=> "Democracy is non-negotiable" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Faker::LeagueOfLegends | ||
# Faker::Games::LeagueOfLegends | ||
|
||
Available since version 1.8.0. | ||
|
||
```ruby | ||
Faker::LeagueOfLegends.champion #=> "Jarvan IV" | ||
Faker::Games::LeagueOfLegends.champion #=> "Jarvan IV" | ||
|
||
Faker::LeagueOfLegends.location #=> "Demacia" | ||
Faker::Games::LeagueOfLegends.location #=> "Demacia" | ||
|
||
Faker::LeagueOfLegends.quote #=> "Purge the unjust." | ||
Faker::Games::LeagueOfLegends.quote #=> "Purge the unjust." | ||
|
||
Faker::LeagueOfLegends.summoner_spell #=> "Flash" | ||
Faker::Games::LeagueOfLegends.summoner_spell #=> "Flash" | ||
|
||
Faker::LeagueOfLegends.masteries #=> "Double Edged Sword" | ||
Faker::Games::LeagueOfLegends.masteries #=> "Double Edged Sword" | ||
|
||
Faker::LeagueOfLegends.rank #=> "Bronze V" | ||
Faker::Games::LeagueOfLegends.rank #=> "Bronze V" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Faker::Myst | ||
# Faker::Games::Myst | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
Faker::Myst.game #=> "Myst III: Exile" | ||
Faker::Games::Myst.game #=> "Myst III: Exile" | ||
|
||
Faker::Myst.creature #=> "squee" | ||
Faker::Games::Myst.creature #=> "squee" | ||
|
||
Faker::Myst.age #=> "Relto" | ||
Faker::Games::Myst.age #=> "Relto" | ||
|
||
Faker::Myst.character #=> "Gehn" | ||
Faker::Games::Myst.character #=> "Gehn" | ||
|
||
Faker::Myst.quote #=> "I realized, the moment I fell into the fissure, that the Book would not be destroyed as I had planned." | ||
Faker::Games::Myst.quote #=> "I realized, the moment I fell into the fissure, that the Book would not be destroyed as I had planned." | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Faker::Overwatch | ||
# Faker::Games::Overwatch | ||
|
||
Available since version 1.8.0. | ||
|
||
```ruby | ||
Faker::Overwatch.hero #=> "Tracer" | ||
Faker::Games::Overwatch.hero #=> "Tracer" | ||
|
||
Faker::Overwatch.location #=> "Numbani" | ||
Faker::Games::Overwatch.location #=> "Numbani" | ||
|
||
Faker::Overwatch.quote #=> "It's high noon" | ||
Faker::Games::Overwatch.quote #=> "It's high noon" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Faker::Pokemon | ||
# Faker::Games::Pokemon | ||
|
||
Available since version 1.7.0. | ||
|
||
```ruby | ||
Faker::Pokemon.name #=> "Pikachu" | ||
Faker::Games::Pokemon.name #=> "Pikachu" | ||
|
||
Faker::Pokemon.location #=> "Pallet Town" | ||
Faker::Games::Pokemon.location #=> "Pallet Town" | ||
|
||
Faker::Pokemon.move #=> "Thunder Shock" | ||
Faker::Games::Pokemon.move #=> "Thunder Shock" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Faker::Witcher | ||
# Faker::Games::Witcher | ||
|
||
```ruby | ||
|
||
Faker::Witcher.character # => "Triss Merigold" | ||
Faker::Games::Witcher.character # => "Triss Merigold" | ||
|
||
Faker::Witcher.witcher # => "Geralt of Rivia" | ||
Faker::Games::Witcher.witcher # => "Geralt of Rivia" | ||
|
||
Faker::Witcher.location # => "Novigrad" | ||
Faker::Games::Witcher.location # => "Novigrad" | ||
|
||
Faker::Witcher.school # => "Wolf" | ||
Faker::Games::Witcher.school # => "Wolf" | ||
|
||
Faker::Witcher.quote # => "No Lollygagin'!" | ||
Faker::Games::Witcher.quote # => "No Lollygagin'!" | ||
|
||
Faker::Witcher.monster # => "Katakan" | ||
Faker::Games::Witcher.monster # => "Katakan" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# Faker::WorldOfWarcraft | ||
# Faker::Games::WorldOfWarcraft | ||
|
||
```ruby | ||
# Generate random character from the World of Warcraft | ||
Faker::WorldOfWarcraft.hero #=> "Uther the Lightbringer" | ||
Faker::Games::WorldOfWarcraft.hero #=> "Uther the Lightbringer" | ||
|
||
# Generate random quote from the World of Warcraft | ||
Faker::WorldOfWarcraft.quote #=> "These are dark times indeed." | ||
Faker::Games::WorldOfWarcraft.quote #=> "These are dark times indeed." | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Faker::Zelda | ||
# Faker::Games::Zelda | ||
|
||
Available since version 1.7.3. | ||
|
||
```ruby | ||
# Random Zelda game | ||
Faker::Zelda.game #=> "Ocarina of Time" | ||
Faker::Games::Zelda.game #=> "Ocarina of Time" | ||
|
||
# Random Zelda character | ||
Faker::Zelda.character #=> "Guru-Guru" | ||
Faker::Games::Zelda.character #=> "Guru-Guru" | ||
|
||
# Random Zelda location | ||
Faker::Zelda.location #=> "Tarrey Town" | ||
Faker::Games::Zelda.location #=> "Tarrey Town" | ||
|
||
# Random Zelda item | ||
Faker::Zelda.item #=> "Master Sword" | ||
Faker::Games::Zelda.item #=> "Master Sword" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Dota < Base | ||
module Dota | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def hero | ||
fetch('dota.hero') | ||
Faker::Games::Dota.hero | ||
end | ||
|
||
def item | ||
fetch('dota.item') | ||
Faker::Games::Dota.item | ||
end | ||
|
||
def team | ||
fetch('dota.team') | ||
Faker::Games::Dota.team | ||
end | ||
|
||
def player | ||
fetch('dota.player') | ||
Faker::Games::Dota.player | ||
end | ||
|
||
def quote(hero = 'abaddon') | ||
fetch("dota.#{hero}.quote") | ||
Faker::Games::Dota.quote(hero) | ||
end | ||
|
||
deprecate :hero, 'Faker::Games::Dota.hero', 2018, 10 | ||
deprecate :item, 'Faker::Games::Dota.item', 2018, 10 | ||
deprecate :team, 'Faker::Games::Dota.team', 2018, 10 | ||
deprecate :player, 'Faker::Games::Dota.player', 2018, 10 | ||
deprecate :quote, 'Faker::Games::Dota.quote', 2018, 10 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,50 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class ElderScrolls < Base | ||
module ElderScrolls | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def race | ||
fetch('elder_scrolls.race') | ||
Faker::Games::ElderScrolls.race | ||
end | ||
|
||
def city | ||
fetch('elder_scrolls.city') | ||
Faker::Games::ElderScrolls.city | ||
end | ||
|
||
def creature | ||
fetch('elder_scrolls.creature') | ||
Faker::Games::ElderScrolls.creature | ||
end | ||
|
||
def region | ||
fetch('elder_scrolls.region') | ||
Faker::Games::ElderScrolls.region | ||
end | ||
|
||
def dragon | ||
fetch('elder_scrolls.dragon') | ||
Faker::Games::ElderScrolls.dragon | ||
end | ||
|
||
def name | ||
"#{fetch('elder_scrolls.first_name')} #{fetch('elder_scrolls.last_name')}" | ||
Faker::Games::ElderScrolls.name | ||
end | ||
|
||
def first_name | ||
fetch('elder_scrolls.first_name') | ||
Faker::Games::ElderScrolls.first_name | ||
end | ||
|
||
def last_name | ||
fetch('elder_scrolls.last_name') | ||
Faker::Games::ElderScrolls.last_name | ||
end | ||
|
||
deprecate :race, 'Faker::Games::ElderScrolls.race', 2018, 10 | ||
deprecate :city, 'Faker::Games::ElderScrolls.city', 2018, 10 | ||
deprecate :creature, 'Faker::Games::ElderScrolls.creature', 2018, 10 | ||
deprecate :region, 'Faker::Games::ElderScrolls.region', 2018, 10 | ||
deprecate :dragon, 'Faker::Games::ElderScrolls.dragon', 2018, 10 | ||
deprecate :name, 'Faker::Games::ElderScrolls.name', 2018, 10 | ||
deprecate :first_name, 'Faker::Games::ElderScrolls.first_name', 2018, 10 | ||
deprecate :last_name, 'Faker::Games::ElderScrolls.last_name', 2018, 10 | ||
end | ||
end | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we convert this parameter to a keyword argument as it was suggested in this issue #603?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could that be done as a follow-up? Keep this PR as more of a strict re-org?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure