forked from faker-ruby/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Faker::Games namespace (faker-ruby#1412)
* Move games files into 'games' folder * Migrate all 'elder_scrolls' code to the 'games' namespace * Move 'zelda' to the correct 'namespace' * Update 'fallout' to be in the 'games' namespace * Update 'pokemon' to be in the 'games' namespace * Update 'world_of_warcraft' to be in the 'games' namespace * Update 'overwatch' to be in the 'games' namespace * Update 'myst' to be in the 'games' namespace * Update 'league_of_legends' to be in the 'games' namespace * Update 'dota' to be in the 'games' namespace * Move 'witcher' to be under 'games' namespace * Remove rubocop warning * Restore old file, deprecate methods in favour of new namespaced version * Restore 'dota' file, add deprecations * Restore 'elder_scrolls' and deprecate * Restore 'heroes_of_the_storm' and deprecate * Restore 'league_of_legends' and deprecate * Restore 'myst' and deprecate * Restore 'overwatch' and deprecate * Restore 'pokemon' and deprecate * Restore 'world_of_warcraft' and deprecate * Restore 'zelda' and deprecate * Address mucked up merge * Restore 'fallout' and deprecate * Merge mess still * Address rubocop violation * Remove duplicated entry * Remove extra '::' * Add tests for the newly deprecated methods * Update CHANGELOG.md
- Loading branch information
1 parent
7c92fc4
commit 06c2a42
Showing
70 changed files
with
1,181 additions
and
502 deletions.
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
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 |
Oops, something went wrong.