faker 2.3.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +85 -2
- data/README.md +2 -1
- data/lib/faker/blockchain/aeternity.rb +70 -0
- data/lib/faker/default/app.rb +2 -1
- data/lib/faker/default/appliance.rb +18 -0
- data/lib/faker/default/avatar.rb +2 -1
- data/lib/faker/default/chuck_norris.rb +1 -1
- data/lib/faker/default/date.rb +83 -2
- data/lib/faker/default/dessert.rb +27 -0
- data/lib/faker/default/device.rb +54 -0
- data/lib/faker/default/driving_licence.rb +2 -2
- data/lib/faker/default/electrical_components.rb +27 -0
- data/lib/faker/default/greek_philosophers.rb +18 -0
- data/lib/faker/default/industry_segments.rb +36 -0
- data/lib/faker/default/internet.rb +4 -1
- data/lib/faker/default/marketing.rb +9 -0
- data/lib/faker/default/military.rb +45 -0
- data/lib/faker/default/nation.rb +48 -5
- data/lib/faker/default/nato_phonetic_alphabet.rb +9 -0
- data/lib/faker/default/number.rb +124 -0
- data/lib/faker/default/restaurant.rb +54 -2
- data/lib/faker/default/science.rb +27 -0
- data/lib/faker/default/subscription.rb +45 -0
- data/lib/faker/default/superhero.rb +45 -0
- data/lib/faker/default/time.rb +85 -8
- data/lib/faker/default/world_cup.rb +50 -0
- data/lib/faker/games/dota.rb +47 -0
- data/lib/faker/games/heroes.rb +27 -0
- data/lib/faker/games/heroes_of_the_storm.rb +36 -0
- data/lib/faker/games/league_of_legends.rb +54 -0
- data/lib/faker/games/myst.rb +45 -0
- data/lib/faker/games/pokemon.rb +27 -0
- data/lib/faker/games/sonic_the_hedgehog.rb +27 -0
- data/lib/faker/games/witcher.rb +54 -0
- data/lib/faker/games/world_of_warcraft.rb +18 -0
- data/lib/faker/games/zelda.rb +1 -1
- data/lib/faker/japanese_media/dragon_ball.rb +9 -0
- data/lib/faker/japanese_media/one_piece.rb +54 -0
- data/lib/faker/japanese_media/sword_art_online.rb +36 -0
- data/lib/faker/movies/back_to_the_future.rb +28 -0
- data/lib/faker/movies/ghostbusters.rb +28 -0
- data/lib/faker/movies/harry_potter.rb +54 -0
- data/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb +69 -0
- data/lib/faker/movies/hobbit.rb +37 -0
- data/lib/faker/movies/lebowski.rb +27 -0
- data/lib/faker/movies/lord_of_the_rings.rb +28 -0
- data/lib/faker/movies/movie.rb +9 -0
- data/lib/faker/movies/princess_bride.rb +19 -0
- data/lib/faker/movies/star_wars.rb +94 -0
- data/lib/faker/movies/v_for_vendetta.rb +29 -0
- data/lib/faker/music/grateful_dead.rb +18 -0
- data/lib/faker/music/phish.rb +9 -0
- data/lib/faker/music/rock_band.rb +9 -0
- data/lib/faker/music/umphreys_mcgee.rb +9 -0
- data/lib/faker/sports/basketball.rb +36 -0
- data/lib/faker/sports/football.rb +45 -0
- data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +9 -0
- data/lib/faker/tv_shows/bojack_horseman.rb +28 -0
- data/lib/faker/tv_shows/buffy.rb +45 -0
- data/lib/faker/tv_shows/community.rb +19 -0
- data/lib/faker/tv_shows/dr_who.rb +78 -2
- data/lib/faker/tv_shows/dumb_and_dumber.rb +28 -0
- data/lib/faker/tv_shows/family_guy.rb +28 -0
- data/lib/faker/tv_shows/friends.rb +27 -0
- data/lib/faker/tv_shows/game_of_thrones.rb +46 -0
- data/lib/faker/tv_shows/hey_arnold.rb +27 -0
- data/lib/faker/tv_shows/how_i_met_your_mother.rb +37 -0
- data/lib/faker/tv_shows/michael_scott.rb +13 -0
- data/lib/faker/tv_shows/new_girl.rb +19 -0
- data/lib/faker/tv_shows/parks_and_rec.rb +18 -0
- data/lib/faker/tv_shows/rick_and_morty.rb +28 -0
- data/lib/faker/tv_shows/ru_paul.rb +18 -0
- data/lib/faker/tv_shows/seinfeld.rb +28 -0
- data/lib/faker/tv_shows/silicon_valley.rb +75 -0
- data/lib/faker/tv_shows/simpsons.rb +28 -0
- data/lib/faker/tv_shows/south_park.rb +19 -0
- data/lib/faker/tv_shows/star_trek.rb +36 -0
- data/lib/faker/tv_shows/stargate.rb +28 -0
- data/lib/faker/tv_shows/stranger_things.rb +19 -0
- data/lib/faker/tv_shows/the_expanse.rb +36 -0
- data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +28 -0
- data/lib/faker/tv_shows/the_it_crowd.rb +37 -0
- data/lib/faker/tv_shows/the_thick_of_it.rb +28 -0
- data/lib/faker/tv_shows/twin_peaks.rb +28 -0
- data/lib/faker/tv_shows/venture_bros.rb +38 -0
- data/lib/faker/version.rb +1 -1
- data/lib/locales/en-TH.yml +360 -0
- data/lib/locales/en/color.yml +1 -1
- data/lib/locales/en/dr_who.yml +1 -1
- data/lib/locales/en/science.yml +1 -1
- data/lib/locales/ja.yml +7 -8
- data/lib/locales/th.yml +380 -0
- metadata +26 -17
|
@@ -4,8 +4,60 @@ module Faker
|
|
|
4
4
|
class Restaurant < Base
|
|
5
5
|
flexible :restaurant
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
class << self
|
|
8
|
+
##
|
|
9
|
+
# Produces the name of a restaurant.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
#
|
|
13
|
+
# @example
|
|
14
|
+
# Faker::Restaurant.name #=> "Curry King"
|
|
15
|
+
#
|
|
16
|
+
# @faker.version 1.9.2
|
|
17
|
+
def name
|
|
18
|
+
bothify(parse('restaurant.name'))
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
##
|
|
22
|
+
# Produces a type of restaurant.
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
#
|
|
26
|
+
# @example
|
|
27
|
+
# Faker::Restaurant.type #=> "Comfort Food"
|
|
28
|
+
#
|
|
29
|
+
# @faker.version 1.9.2
|
|
30
|
+
def type
|
|
31
|
+
fetch('restaurant.type')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
##
|
|
35
|
+
# Produces a description of a restaurant.
|
|
36
|
+
#
|
|
37
|
+
# @return [String]
|
|
38
|
+
#
|
|
39
|
+
# @example
|
|
40
|
+
# Faker::Restaurant.description
|
|
41
|
+
# #=> "We are committed to using the finest ingredients in our recipes. No food leaves our kitchen that we ourselves would not eat."
|
|
42
|
+
#
|
|
43
|
+
# @faker.version 1.9.2
|
|
44
|
+
def description
|
|
45
|
+
fetch('restaurant.description')
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
##
|
|
49
|
+
# Produces a review for a restaurant.
|
|
50
|
+
#
|
|
51
|
+
# @return [String]
|
|
52
|
+
#
|
|
53
|
+
# @example
|
|
54
|
+
# Faker::Restaurant.review
|
|
55
|
+
# #=> "Brand new. Great design. Odd to hear pop music in a Mexican establishment. Music is a bit loud. It should be background."
|
|
56
|
+
#
|
|
57
|
+
# @faker.version 1.9.2
|
|
58
|
+
def review
|
|
59
|
+
fetch('restaurant.review')
|
|
60
|
+
end
|
|
9
61
|
end
|
|
10
62
|
end
|
|
11
63
|
end
|
|
@@ -3,14 +3,41 @@
|
|
|
3
3
|
module Faker
|
|
4
4
|
class Science < Base
|
|
5
5
|
class << self
|
|
6
|
+
##
|
|
7
|
+
# Produces the name of a element.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# Faker::Science.element #=> "Carbon"
|
|
13
|
+
#
|
|
14
|
+
# @faker.version 1.8.5
|
|
6
15
|
def element
|
|
7
16
|
fetch('science.element')
|
|
8
17
|
end
|
|
9
18
|
|
|
19
|
+
##
|
|
20
|
+
# Produces the symbol of an element.
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
#
|
|
24
|
+
# @example
|
|
25
|
+
# Faker::Science.element_symbol #=> "Pb"
|
|
26
|
+
#
|
|
27
|
+
# @faker.version 1.9.0
|
|
10
28
|
def element_symbol
|
|
11
29
|
fetch('science.element_symbol')
|
|
12
30
|
end
|
|
13
31
|
|
|
32
|
+
##
|
|
33
|
+
# Produces the name of a scientist.
|
|
34
|
+
#
|
|
35
|
+
# @return [String]
|
|
36
|
+
#
|
|
37
|
+
# @example
|
|
38
|
+
# Faker::Science.scientist #=> "Isaac Newton"
|
|
39
|
+
#
|
|
40
|
+
# @faker.version 1.8.5
|
|
14
41
|
def scientist
|
|
15
42
|
fetch('science.scientist')
|
|
16
43
|
end
|
|
@@ -2,22 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
module Faker
|
|
4
4
|
class Subscription < Base
|
|
5
|
+
##
|
|
6
|
+
# Produces the name of a subscription plan.
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
#
|
|
10
|
+
# @example
|
|
11
|
+
# Faker::Subscription.plan #=> "Platinum"
|
|
12
|
+
#
|
|
13
|
+
# @faker.version 1.9.2
|
|
5
14
|
def self.plan
|
|
6
15
|
fetch('subscription.plans')
|
|
7
16
|
end
|
|
8
17
|
|
|
18
|
+
##
|
|
19
|
+
# Produces a subscription status.
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
#
|
|
23
|
+
# @example
|
|
24
|
+
# Faker::Subscription.status #=> "Active"
|
|
25
|
+
#
|
|
26
|
+
# @faker.version 1.9.2
|
|
9
27
|
def self.status
|
|
10
28
|
fetch('subscription.statuses')
|
|
11
29
|
end
|
|
12
30
|
|
|
31
|
+
##
|
|
32
|
+
# Produces the name of a payment method.
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
#
|
|
36
|
+
# @example
|
|
37
|
+
# Faker::Subscription.payment_method #=> "PayPal"
|
|
38
|
+
#
|
|
39
|
+
# @faker.version 1.9.2
|
|
13
40
|
def self.payment_method
|
|
14
41
|
fetch('subscription.payment_methods')
|
|
15
42
|
end
|
|
16
43
|
|
|
44
|
+
##
|
|
45
|
+
# Produces the name of a subscription term.
|
|
46
|
+
#
|
|
47
|
+
# @return [String]
|
|
48
|
+
#
|
|
49
|
+
# @example
|
|
50
|
+
# Faker::Subscription.subscription_term #=> "Annual"
|
|
51
|
+
#
|
|
52
|
+
# @faker.version 1.9.2
|
|
17
53
|
def self.subscription_term
|
|
18
54
|
fetch('subscription.subscription_terms')
|
|
19
55
|
end
|
|
20
56
|
|
|
57
|
+
##
|
|
58
|
+
# Produces the name of a payment term.
|
|
59
|
+
#
|
|
60
|
+
# @return [String]
|
|
61
|
+
#
|
|
62
|
+
# @example
|
|
63
|
+
# Faker::Subscription.payment_term #=> "Monthly"
|
|
64
|
+
#
|
|
65
|
+
# @faker.version 1.9.2
|
|
21
66
|
def self.payment_term
|
|
22
67
|
fetch('subscription.payment_terms')
|
|
23
68
|
end
|
|
@@ -3,22 +3,67 @@
|
|
|
3
3
|
module Faker
|
|
4
4
|
class Superhero < Base
|
|
5
5
|
class << self
|
|
6
|
+
##
|
|
7
|
+
# Produces a superpower.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# Faker::Superhero.power #=> "Photokinesis"
|
|
13
|
+
#
|
|
14
|
+
# @faker.version 1.6.2
|
|
6
15
|
def power
|
|
7
16
|
fetch('superhero.power')
|
|
8
17
|
end
|
|
9
18
|
|
|
19
|
+
##
|
|
20
|
+
# Produces a superhero name prefix.
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
#
|
|
24
|
+
# @example
|
|
25
|
+
# Faker::Superhero.prefix #=> "the Fated"
|
|
26
|
+
#
|
|
27
|
+
# @faker.version 1.6.2
|
|
10
28
|
def prefix
|
|
11
29
|
fetch('superhero.prefix')
|
|
12
30
|
end
|
|
13
31
|
|
|
32
|
+
##
|
|
33
|
+
# Produces a superhero name suffix.
|
|
34
|
+
#
|
|
35
|
+
# @return [String]
|
|
36
|
+
#
|
|
37
|
+
# @example
|
|
38
|
+
# Faker::Superhero.suffix #=> "Captain"
|
|
39
|
+
#
|
|
40
|
+
# @faker.version 1.6.2
|
|
14
41
|
def suffix
|
|
15
42
|
fetch('superhero.suffix')
|
|
16
43
|
end
|
|
17
44
|
|
|
45
|
+
##
|
|
46
|
+
# Produces a superhero descriptor.
|
|
47
|
+
#
|
|
48
|
+
# @return [String]
|
|
49
|
+
#
|
|
50
|
+
# @example
|
|
51
|
+
# Faker::Superhero.descriptor #=> "Bizarro"
|
|
52
|
+
#
|
|
53
|
+
# @faker.version 1.6.2
|
|
18
54
|
def descriptor
|
|
19
55
|
fetch('superhero.descriptor')
|
|
20
56
|
end
|
|
21
57
|
|
|
58
|
+
##
|
|
59
|
+
# Produces a random superhero name.
|
|
60
|
+
#
|
|
61
|
+
# @return [String]
|
|
62
|
+
#
|
|
63
|
+
# @example
|
|
64
|
+
# Faker::Superhero.name #=> "Magnificent Shatterstar"
|
|
65
|
+
#
|
|
66
|
+
# @faker.version 1.6.2
|
|
22
67
|
def name
|
|
23
68
|
parse('superhero.name')
|
|
24
69
|
end
|
data/lib/faker/default/time.rb
CHANGED
|
@@ -14,8 +14,31 @@ module Faker
|
|
|
14
14
|
|
|
15
15
|
class << self
|
|
16
16
|
# rubocop:disable Metrics/ParameterLists
|
|
17
|
+
# rubocop:disable Style/AsciiComments
|
|
18
|
+
|
|
19
|
+
##
|
|
20
|
+
# Produce a random time between two times.
|
|
21
|
+
#
|
|
22
|
+
# @param from [Time, Date, DateTime] The start of the usable time range.
|
|
23
|
+
# @param to [Time, Date, DateTime] The end of the usable time range.
|
|
24
|
+
# @param format [Symbol] The name of a DateTime format to use.
|
|
25
|
+
# @return [Time]
|
|
26
|
+
#
|
|
27
|
+
# @example
|
|
28
|
+
# # Random Stringified time between two times, formatted to the specified I18n format
|
|
29
|
+
# # (Examples are from a Rails console with rails-i18n 5.1.1 defaults loaded)
|
|
30
|
+
# I18n.locale = 'en-US'
|
|
31
|
+
# Faker::Time.between(from: DateTime.now - 1, to: DateTime.now, format: :default) #=> "Tue, 16 Oct 2018 10:48:27 AM -05:00"
|
|
32
|
+
# Faker::Time.between(from: DateTime.now - 1, to: DateTime.now, format: :short) #=> "15 Oct 10:48 AM"
|
|
33
|
+
# Faker::Time.between(from: DateTime.now - 1, to: DateTime.now, format: :long) #=> "October 15, 2018 10:48 AM"
|
|
34
|
+
#
|
|
35
|
+
# I18n.locale = 'ja'
|
|
36
|
+
# Faker::Time.between(from: DateTime.now - 1, to: DateTime.now, format: :default) #=> "2018/10/15 10:48:27"
|
|
37
|
+
# Faker::Time.between(from: DateTime.now - 1, to: DateTime.now, format: :short) #=> "18/10/15 10:48"
|
|
38
|
+
# Faker::Time.between(from: DateTime.now - 1, to: DateTime.now, format: :long) #=> "2018年10月16日(火) 10時48分27秒 -0500"
|
|
39
|
+
#
|
|
40
|
+
# @faker.version 1.5.0
|
|
17
41
|
def between(legacy_from = NOT_GIVEN, legacy_to = NOT_GIVEN, legacy_format = NOT_GIVEN, from:, to:, format: nil)
|
|
18
|
-
# rubocop:enable Metrics/ParameterLists
|
|
19
42
|
warn_for_deprecated_arguments do |keywords|
|
|
20
43
|
keywords << :from if legacy_from != NOT_GIVEN
|
|
21
44
|
keywords << :to if legacy_to != NOT_GIVEN
|
|
@@ -28,10 +51,37 @@ module Faker
|
|
|
28
51
|
time = Faker::Base.rand_in_range(from, to)
|
|
29
52
|
time_with_format(time, format)
|
|
30
53
|
end
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
# rubocop:enable Style/AsciiComments
|
|
55
|
+
|
|
56
|
+
##
|
|
57
|
+
# Produce a random time between two dates.
|
|
58
|
+
#
|
|
59
|
+
# @param from [Date] The start of the usable time range.
|
|
60
|
+
# @param to [Date] The end of the usable time range.
|
|
61
|
+
# @param period [Symbol] The time of day, if any. See {TIME_RANGES}.
|
|
62
|
+
# @param format [Symbol] The name of a DateTime format to use.
|
|
63
|
+
# @return [Time]
|
|
64
|
+
#
|
|
65
|
+
# @example
|
|
66
|
+
# Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :all)
|
|
67
|
+
# #=> "2014-09-19 07:03:30 -0700"
|
|
68
|
+
# Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :day)
|
|
69
|
+
# #=> "2014-09-18 16:28:13 -0700"
|
|
70
|
+
# Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :night)
|
|
71
|
+
# #=> "2014-09-20 19:39:38 -0700"
|
|
72
|
+
# Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :morning)
|
|
73
|
+
# #=> "2014-09-19 08:07:52 -0700"
|
|
74
|
+
# Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :afternoon)
|
|
75
|
+
# #=> "2014-09-18 12:10:34 -0700"
|
|
76
|
+
# Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :evening)
|
|
77
|
+
# #=> "2014-09-19 20:21:03 -0700"
|
|
78
|
+
# Faker::Time.between_dates(from: Date.today - 1, to: Date.today, period: :midnight)
|
|
79
|
+
# #=> "2014-09-20 00:40:14 -0700"
|
|
80
|
+
# Faker::Time.between_dates(from: Date.today - 5, to: Date.today + 5, period: :afternoon, format: :default)
|
|
81
|
+
# #=> "Fri, 19 Oct 2018 15:17:46 -0500"
|
|
82
|
+
#
|
|
83
|
+
# @faker.version 1.0.0
|
|
33
84
|
def between_dates(legacy_from = NOT_GIVEN, legacy_to = NOT_GIVEN, legacy_period = NOT_GIVEN, legacy_format = NOT_GIVEN, from:, to:, period: :all, format: nil)
|
|
34
|
-
# rubocop:enable Metrics/ParameterLists
|
|
35
85
|
warn_for_deprecated_arguments do |keywords|
|
|
36
86
|
keywords << :from if legacy_from != NOT_GIVEN
|
|
37
87
|
keywords << :to if legacy_to != NOT_GIVEN
|
|
@@ -44,9 +94,22 @@ module Faker
|
|
|
44
94
|
time_with_format(time, format)
|
|
45
95
|
end
|
|
46
96
|
|
|
47
|
-
|
|
97
|
+
##
|
|
98
|
+
# Produce a random time in the future (up to N days).
|
|
99
|
+
#
|
|
100
|
+
# @param days [Integer] The maximum number of days to go into the future.
|
|
101
|
+
# @param period [Symbol] The time of day, if any. See {TIME_RANGES}.
|
|
102
|
+
# @param format [Symbol] The name of a DateTime format to use.
|
|
103
|
+
# @return [Time]
|
|
104
|
+
#
|
|
105
|
+
# @example
|
|
106
|
+
# Faker::Time.forward(days: 23, period: :morning)
|
|
107
|
+
# # => "2014-09-26 06:54:47 -0700"
|
|
108
|
+
# Faker::Time.forward(days: 5, period: :evening, format: :long)
|
|
109
|
+
# #=> "October 21, 2018 20:47"
|
|
110
|
+
#
|
|
111
|
+
# @faker.version 1.5.0
|
|
48
112
|
def forward(legacy_days = NOT_GIVEN, legacy_period = NOT_GIVEN, legacy_format = NOT_GIVEN, days: 365, period: :all, format: nil)
|
|
49
|
-
# rubocop:enable Metrics/ParameterLists
|
|
50
113
|
warn_for_deprecated_arguments do |keywords|
|
|
51
114
|
keywords << :days if legacy_days != NOT_GIVEN
|
|
52
115
|
keywords << :period if legacy_period != NOT_GIVEN
|
|
@@ -56,9 +119,22 @@ module Faker
|
|
|
56
119
|
time_with_format(date_with_random_time(Faker::Date.forward(days: days), period), format)
|
|
57
120
|
end
|
|
58
121
|
|
|
59
|
-
|
|
122
|
+
##
|
|
123
|
+
# Produce a random time in the past (up to N days).
|
|
124
|
+
#
|
|
125
|
+
# @param days [Integer] The maximum number of days to go into the past.
|
|
126
|
+
# @param period [Symbol] The time of day, if any. See {TIME_RANGES}.
|
|
127
|
+
# @param format [Symbol] The name of a DateTime format to use.
|
|
128
|
+
# @return [Time]
|
|
129
|
+
#
|
|
130
|
+
# @example
|
|
131
|
+
# Faker::Time.backward(days: 14, period: :evening)
|
|
132
|
+
# #=> "2014-09-17 19:56:33 -0700"
|
|
133
|
+
# Faker::Time.backward(days: 5, period: :morning, format: :short)
|
|
134
|
+
# #=> "14 Oct 07:44"
|
|
135
|
+
#
|
|
136
|
+
# @faker.version 1.5.0
|
|
60
137
|
def backward(legacy_days = NOT_GIVEN, legacy_period = NOT_GIVEN, legacy_format = NOT_GIVEN, days: 365, period: :all, format: nil)
|
|
61
|
-
# rubocop:enable Metrics/ParameterLists
|
|
62
138
|
warn_for_deprecated_arguments do |keywords|
|
|
63
139
|
keywords << :days if legacy_days != NOT_GIVEN
|
|
64
140
|
keywords << :period if legacy_period != NOT_GIVEN
|
|
@@ -67,6 +143,7 @@ module Faker
|
|
|
67
143
|
|
|
68
144
|
time_with_format(date_with_random_time(Faker::Date.backward(days: days), period), format)
|
|
69
145
|
end
|
|
146
|
+
# rubocop:enable Metrics/ParameterLists
|
|
70
147
|
|
|
71
148
|
private
|
|
72
149
|
|
|
@@ -3,18 +3,56 @@
|
|
|
3
3
|
module Faker
|
|
4
4
|
class WorldCup < Base
|
|
5
5
|
class << self
|
|
6
|
+
##
|
|
7
|
+
# Produces a national team name.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
#
|
|
11
|
+
# @example
|
|
12
|
+
# Faker::WorldCup.team #=> "Iran"
|
|
13
|
+
#
|
|
14
|
+
# @faker.version 1.9.0
|
|
6
15
|
def team
|
|
7
16
|
fetch('world_cup.teams')
|
|
8
17
|
end
|
|
9
18
|
|
|
19
|
+
##
|
|
20
|
+
# Produces a city name hosting the World Cup match.
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
#
|
|
24
|
+
# @example
|
|
25
|
+
# Faker::WorldCup.city #=> "Moscow"
|
|
26
|
+
#
|
|
27
|
+
# @faker.version next
|
|
10
28
|
def city
|
|
11
29
|
fetch('world_cup.cities')
|
|
12
30
|
end
|
|
13
31
|
|
|
32
|
+
##
|
|
33
|
+
# Produces the name of a stadium that has hosted a World Cup match.
|
|
34
|
+
#
|
|
35
|
+
# @return [String]
|
|
36
|
+
#
|
|
37
|
+
# @example
|
|
38
|
+
# Faker::WorldCup.stadium #=> "Rostov Arena"
|
|
39
|
+
#
|
|
40
|
+
# @faker.version next
|
|
14
41
|
def stadium
|
|
15
42
|
fetch('world_cup.stadiums')
|
|
16
43
|
end
|
|
17
44
|
|
|
45
|
+
##
|
|
46
|
+
# Produces a random national team name from a group. See below examples
|
|
47
|
+
#
|
|
48
|
+
# @return [String]
|
|
49
|
+
#
|
|
50
|
+
# @example
|
|
51
|
+
# Faker::WorldCup.group(group: 'group_B') #=> "Spain"
|
|
52
|
+
# @example
|
|
53
|
+
# Faker::WorldCup.group #=> "Russia"
|
|
54
|
+
#
|
|
55
|
+
# @faker.version next
|
|
18
56
|
def group(legacy_group = NOT_GIVEN, group: 'group_A')
|
|
19
57
|
warn_for_deprecated_arguments do |keywords|
|
|
20
58
|
keywords << :group if legacy_group != NOT_GIVEN
|
|
@@ -23,6 +61,18 @@ module Faker
|
|
|
23
61
|
fetch("world_cup.groups.#{group}")
|
|
24
62
|
end
|
|
25
63
|
|
|
64
|
+
##
|
|
65
|
+
# Produces a random name from national team roster. See below examples.
|
|
66
|
+
#
|
|
67
|
+
# @return [String]
|
|
68
|
+
#
|
|
69
|
+
# @example
|
|
70
|
+
# Faker::WorldCup.roster #=> "Hector Cuper"
|
|
71
|
+
#
|
|
72
|
+
# @example
|
|
73
|
+
# Faker::WorldCup.roster(country: 'Spain', type: 'forwards') #=> "Diego Costa"
|
|
74
|
+
#
|
|
75
|
+
# @faker.version next
|
|
26
76
|
def roster(legacy_country = NOT_GIVEN, legacy_type = NOT_GIVEN, country: 'Egypt', type: 'coach')
|
|
27
77
|
warn_for_deprecated_arguments do |keywords|
|
|
28
78
|
keywords << :country if legacy_country != NOT_GIVEN
|
data/lib/faker/games/dota.rb
CHANGED
|
@@ -4,22 +4,69 @@ module Faker
|
|
|
4
4
|
class Games
|
|
5
5
|
class Dota < Base
|
|
6
6
|
class << self
|
|
7
|
+
##
|
|
8
|
+
# Produces the name of a hero from Dota.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
#
|
|
12
|
+
# @example
|
|
13
|
+
# Faker::Games::Dota.hero #=> "Abaddon"
|
|
14
|
+
#
|
|
15
|
+
# @faker.version 1.9.0
|
|
7
16
|
def hero
|
|
8
17
|
fetch('games.dota.hero')
|
|
9
18
|
end
|
|
10
19
|
|
|
20
|
+
##
|
|
21
|
+
# Produces the name of an item from Dota.
|
|
22
|
+
#
|
|
23
|
+
# @return [String]
|
|
24
|
+
#
|
|
25
|
+
# @example
|
|
26
|
+
# Faker::Games::Dota.item #=> "Armlet of Mordiggian"
|
|
27
|
+
#
|
|
28
|
+
# @faker.version 1.9.0
|
|
11
29
|
def item
|
|
12
30
|
fetch('games.dota.item')
|
|
13
31
|
end
|
|
14
32
|
|
|
33
|
+
##
|
|
34
|
+
# Produces the name of a professional Dota team.
|
|
35
|
+
#
|
|
36
|
+
# @return [String]
|
|
37
|
+
#
|
|
38
|
+
# @example
|
|
39
|
+
# Faker::Games::Dota.team #=> "Evil Geniuses"
|
|
40
|
+
#
|
|
41
|
+
# @faker.version 1.9.0
|
|
15
42
|
def team
|
|
16
43
|
fetch('games.dota.team')
|
|
17
44
|
end
|
|
18
45
|
|
|
46
|
+
##
|
|
47
|
+
# Produces the name of a professional Dota player.
|
|
48
|
+
#
|
|
49
|
+
# @return [String]
|
|
50
|
+
#
|
|
51
|
+
# @example
|
|
52
|
+
# Faker::Games::Dota.player #=> "Dendi"
|
|
53
|
+
#
|
|
54
|
+
# @faker.version 1.9.0
|
|
19
55
|
def player
|
|
20
56
|
fetch('games.dota.player')
|
|
21
57
|
end
|
|
22
58
|
|
|
59
|
+
##
|
|
60
|
+
# Produces the name of a hero from Dota.
|
|
61
|
+
#
|
|
62
|
+
# @param hero [String] The name of a Dota hero.
|
|
63
|
+
# @return [String]
|
|
64
|
+
#
|
|
65
|
+
# @example
|
|
66
|
+
# Faker::Games::Dota.quote #=> "You have called death upon yourself."
|
|
67
|
+
# Faker::Games::Dota.quote(hero: 'alchemist') #=> "Better living through alchemy!"
|
|
68
|
+
#
|
|
69
|
+
# @faker.version 1.9.0
|
|
23
70
|
def quote(legacy_hero = NOT_GIVEN, hero: 'abaddon')
|
|
24
71
|
warn_for_deprecated_arguments do |keywords|
|
|
25
72
|
keywords << :hero if legacy_hero != NOT_GIVEN
|