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 Sports namespace (faker-ruby#1538)
* Update unreleased/docs and move sport namespace to unreleased folder * Deprecate ::Football * Separate v1.9.3 deprecations from current version deprecaions * Update Faker::Construction documentation * Update CHANGELOG * Update CHANGELOG
- Loading branch information
Showing
149 changed files
with
212 additions
and
113 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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Faker::Sports::Football | ||
|
||
Available since version 1.9.0. | ||
|
||
```ruby | ||
Faker::Sports::Football.team #=> "Manchester United" | ||
|
||
Faker::Sports::Football.player #=> "Lionel Messi" | ||
|
||
Faker::Sports::Football.coach #=> "Jose Mourinho" | ||
|
||
Faker::Sports::Football.competition #=> "FIFA World Cup" | ||
|
||
Faker::Sports::Football.position #=> "Defensive Midfielder" | ||
``` |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Football | ||
class << self | ||
extend Gem::Deprecate | ||
|
||
def team | ||
Faker::Sports::Football.team | ||
end | ||
|
||
def player | ||
Faker::Sports::Football.player | ||
end | ||
|
||
def coach | ||
Faker::Sports::Football.coach | ||
end | ||
|
||
def competition | ||
Faker::Sports::Football.competition | ||
end | ||
|
||
def position | ||
Faker::Sports::Football.position | ||
end | ||
|
||
deprecate :team, 'Faker::Sports::Football.team', 2019, 04 | ||
deprecate :player, 'Faker::Sports::Football.player', 2019, 04 | ||
deprecate :coach, 'Faker::Sports::Football.coach', 2019, 04 | ||
deprecate :competition, 'Faker::Sports::Football.competition', 2019, 04 | ||
deprecate :position, 'Faker::Sports::Football.position', 2019, 04 | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
module Faker | ||
class Sports | ||
class Football < Base | ||
class << self | ||
def team | ||
fetch('football.teams') | ||
end | ||
|
||
def player | ||
fetch('football.players') | ||
end | ||
|
||
def coach | ||
fetch('football.coaches') | ||
end | ||
|
||
def competition | ||
fetch('football.competitions') | ||
end | ||
|
||
def position | ||
fetch('football.positions') | ||
end | ||
end | ||
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../test_helper' | ||
|
||
class TestDeprecateFootball < Test::Unit::TestCase | ||
def setup | ||
@tester = Faker::Football | ||
end | ||
|
||
def test_team | ||
assert @tester.team.match(/\w+/) | ||
end | ||
|
||
def test_player | ||
assert @tester.player.match(/\w+/) | ||
end | ||
|
||
def test_coach | ||
assert @tester.coach.match(/\w+/) | ||
end | ||
|
||
def test_competition | ||
assert @tester.competition.match(/\w+/) | ||
end | ||
|
||
def test_position | ||
assert @tester.position.match(/\w+/) | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
.../test_deprecate_aqua_teen_hunger_force.rb → .../test_deprecate_aqua_teen_hunger_force.rb
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
2 changes: 1 addition & 1 deletion
2
...cate/test_deprecate_back_to_the_future.rb → ....9.3/test_deprecate_back_to_the_future.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_bitcoin.rb → ...eprecate/v1.9.3/test_deprecate_bitcoin.rb
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
2 changes: 1 addition & 1 deletion
2
...precate/test_deprecate_bojack_horseman.rb → .../v1.9.3/test_deprecate_bojack_horseman.rb
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
2 changes: 1 addition & 1 deletion
2
.../deprecate/test_deprecate_breaking_bad.rb → ...ate/v1.9.3/test_deprecate_breaking_bad.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_buffy.rb → .../deprecate/v1.9.3/test_deprecate_buffy.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_cat.rb → test/deprecate/v1.9.3/test_deprecate_cat.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_community.rb → ...recate/v1.9.3/test_deprecate_community.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_dog.rb → test/deprecate/v1.9.3/test_deprecate_dog.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_dota.rb → test/deprecate/v1.9.3/test_deprecate_dota.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_dr_who.rb → ...deprecate/v1.9.3/test_deprecate_dr_who.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_dragon_ball.rb → ...cate/v1.9.3/test_deprecate_dragon_ball.rb
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
2 changes: 1 addition & 1 deletion
2
...precate/test_deprecate_dumb_and_dumber.rb → .../v1.9.3/test_deprecate_dumb_and_dumber.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_dune.rb → test/deprecate/v1.9.3/test_deprecate_dune.rb
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
2 changes: 1 addition & 1 deletion
2
...deprecate/test_deprecate_elder_scrolls.rb → ...te/v1.9.3/test_deprecate_elder_scrolls.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_ethereum.rb → ...precate/v1.9.3/test_deprecate_ethereum.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_fallout.rb → ...eprecate/v1.9.3/test_deprecate_fallout.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_family_guy.rb → ...ecate/v1.9.3/test_deprecate_family_guy.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_friends.rb → ...eprecate/v1.9.3/test_deprecate_friends.rb
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
2 changes: 1 addition & 1 deletion
2
...precate/test_deprecate_game_of_thrones.rb → .../v1.9.3/test_deprecate_game_of_thrones.rb
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
2 changes: 1 addition & 1 deletion
2
.../deprecate/test_deprecate_harry_potter.rb → ...ate/v1.9.3/test_deprecate_harry_potter.rb
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
2 changes: 1 addition & 1 deletion
2
...ate/test_deprecate_heroes_of_the_storm.rb → ...9.3/test_deprecate_heroes_of_the_storm.rb
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
2 changes: 1 addition & 1 deletion
2
test/deprecate/test_deprecate_hey_arnold.rb → ...ecate/v1.9.3/test_deprecate_hey_arnold.rb
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
Oops, something went wrong.