faker 2.23.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +83 -29
  3. data/History.md +1 -1
  4. data/README.md +10 -5
  5. data/lib/faker/books/dune.rb +2 -10
  6. data/lib/faker/books/lovecraft.rb +7 -38
  7. data/lib/faker/default/address.rb +5 -25
  8. data/lib/faker/default/alphanumeric.rb +2 -8
  9. data/lib/faker/default/app.rb +1 -10
  10. data/lib/faker/default/avatar.rb +1 -12
  11. data/lib/faker/default/bank.rb +5 -13
  12. data/lib/faker/default/boolean.rb +1 -4
  13. data/lib/faker/default/chile_rut.rb +2 -12
  14. data/lib/faker/default/code.rb +3 -16
  15. data/lib/faker/default/color.rb +77 -6
  16. data/lib/faker/default/commerce.rb +3 -17
  17. data/lib/faker/default/company.rb +2 -10
  18. data/lib/faker/default/crypto_coin.rb +3 -15
  19. data/lib/faker/default/date.rb +5 -38
  20. data/lib/faker/default/demographic.rb +1 -5
  21. data/lib/faker/default/driving_licence.rb +1 -11
  22. data/lib/faker/default/file.rb +2 -21
  23. data/lib/faker/default/fillmurray.rb +1 -10
  24. data/lib/faker/default/finance.rb +1 -5
  25. data/lib/faker/default/hipster.rb +6 -45
  26. data/lib/faker/default/id_number.rb +2 -10
  27. data/lib/faker/default/internet.rb +11 -69
  28. data/lib/faker/default/invoice.rb +3 -16
  29. data/lib/faker/default/json.rb +2 -20
  30. data/lib/faker/default/lorem.rb +9 -66
  31. data/lib/faker/default/lorem_flickr.rb +4 -32
  32. data/lib/faker/default/lorem_pixel.rb +4 -10
  33. data/lib/faker/default/markdown.rb +1 -6
  34. data/lib/faker/default/measurement.rb +8 -40
  35. data/lib/faker/default/name.rb +1 -5
  36. data/lib/faker/default/nhs.rb +1 -5
  37. data/lib/faker/default/number.rb +10 -55
  38. data/lib/faker/default/omniauth.rb +5 -39
  39. data/lib/faker/default/phone_number.rb +1 -5
  40. data/lib/faker/default/placeholdit.rb +1 -12
  41. data/lib/faker/default/relationship.rb +1 -5
  42. data/lib/faker/default/source.rb +3 -16
  43. data/lib/faker/default/string.rb +1 -5
  44. data/lib/faker/default/stripe.rb +4 -20
  45. data/lib/faker/default/time.rb +4 -32
  46. data/lib/faker/default/twitter.rb +3 -17
  47. data/lib/faker/default/types.rb +5 -27
  48. data/lib/faker/default/vehicle.rb +4 -17
  49. data/lib/faker/default/world_cup.rb +2 -11
  50. data/lib/faker/games/dota.rb +1 -5
  51. data/lib/faker/games/tarkov.rb +205 -0
  52. data/lib/faker/movies/hackers.rb +48 -0
  53. data/lib/faker/movies/star_wars.rb +1 -5
  54. data/lib/faker/version.rb +1 -1
  55. data/lib/faker.rb +0 -53
  56. data/lib/locales/en/hackers.yml +53 -0
  57. data/lib/locales/en/heroes.yml +2 -2
  58. data/lib/locales/en/opera.yml +1 -1
  59. data/lib/locales/en/overwatch.yml +5 -7
  60. data/lib/locales/en/source.yml +5 -0
  61. data/lib/locales/en/sport.yml +17 -8
  62. data/lib/locales/en/tarkov.yml +593 -0
  63. data/lib/locales/en-CA.yml +1 -0
  64. data/lib/locales/es-AR.yml +2 -2
  65. data/lib/locales/fi-FI.yml +2 -1
  66. data/lib/locales/fr/ancient.yml +141 -0
  67. data/lib/locales/hy.yml +1 -1
  68. data/lib/locales/th.yml +76 -76
  69. metadata +44 -16
@@ -0,0 +1,205 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faker
4
+ class Games
5
+ class Tarkov < Base
6
+ class << self
7
+ ##
8
+ # Produces a random location from Escape from Tarkov.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Games::Tarkov.location #=> "Customs"
14
+ #
15
+ # @faker.version next
16
+ def location
17
+ fetch('tarkov.locations')
18
+ end
19
+
20
+ ##
21
+ # Produces a random trader from Escape from Tarkov.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Games::Tarkov.trader #=> "Prapor"
27
+ #
28
+ # @faker.version next
29
+ def trader
30
+ fetch('tarkov.traders')
31
+ end
32
+
33
+ ##
34
+ # Produces a random item from Escape from Tarkov.
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Games::Tarkov.item #=> "Diary"
40
+ #
41
+ # @faker.version next
42
+ def item
43
+ fetch('tarkov.items')
44
+ end
45
+
46
+ ##
47
+ # Produces a random weapon from Escape from Tarkov.
48
+ #
49
+ # @return [String]
50
+ #
51
+ # @example
52
+ # Faker::Games::Tarkov.weapon #=> "AK-74N"
53
+ #
54
+ # @faker.version next
55
+ def weapon
56
+ fetch('tarkov.weapons')
57
+ end
58
+
59
+ ##
60
+ # Produces a random boss from Escape from Tarkov.
61
+ #
62
+ # @return [String]
63
+ #
64
+ # @example
65
+ # Faker::Games::Tarkov.boss #=> "Tagilla"
66
+ #
67
+ # @faker.version next
68
+ def boss
69
+ fetch('tarkov.bosses')
70
+ end
71
+
72
+ ##
73
+ # Produces a random faction from Escape from Tarkov.
74
+ #
75
+ # @return [String]
76
+ #
77
+ # @example
78
+ # Faker::Games::Tarkov.faction #=> "USEC"
79
+ #
80
+ # @faker.version next
81
+ def faction
82
+ fetch('tarkov.factions')
83
+ end
84
+
85
+ ##
86
+ # Produces a random quest from a random trader from Escape from Tarkov.
87
+ #
88
+ # @return [String]
89
+ #
90
+ # @example
91
+ # Faker::Games::Tarkov.quest #=> "The Key to Success"
92
+ #
93
+ # @faker.version next
94
+ def quest
95
+ @traders = %w[prapor therapist skier peacekeeper mechanic ragman jaeger fence]
96
+ fetch("tarkov.quests.#{@traders.sample}")
97
+ end
98
+
99
+ ##
100
+ # Produces a random quest from Prapor from Escape from Tarkov.
101
+ #
102
+ # @return [String]
103
+ #
104
+ # @example
105
+ # Faker::Games::Tarkov.prapor_quest #=> "Easy Job - Part 2
106
+ #
107
+ # @faker.version next
108
+ def prapor_quest
109
+ fetch('tarkov.quests.prapor')
110
+ end
111
+
112
+ ##
113
+ # Produces a random quest from Therapist from Escape from Tarkov.
114
+ #
115
+ # @return [String]
116
+ #
117
+ # @example
118
+ # Faker::Games::Tarkov.therapist_quest #=> "Supply Plans"
119
+ #
120
+ # @faker.version next
121
+ def therapist_quest
122
+ fetch('tarkov.quests.therapist')
123
+ end
124
+
125
+ ##
126
+ # Produces a random quest from Skier from Escape from Tarkov.
127
+ #
128
+ # @return [String]
129
+ #
130
+ # @example
131
+ # Faker::Games::Tarkov.skier_quest #=> "Safe Corridor"
132
+ #
133
+ # @faker.version next
134
+ def skier_quest
135
+ fetch('tarkov.quests.skier')
136
+ end
137
+
138
+ ##
139
+ # Produces a random quest from Peacekeeper from Escape from Tarkov.
140
+ #
141
+ # @return [String]
142
+ #
143
+ # @example
144
+ # Faker::Games::Tarkov.peacekeeper_quest #=> "Overpopulation"
145
+ #
146
+ # @faker.version next
147
+ def peacekeeper_quest
148
+ fetch('tarkov.quests.peacekeeper')
149
+ end
150
+
151
+ ##
152
+ # Produces a random quest from Mechanic from Escape from Tarkov.
153
+ #
154
+ # @return [String]
155
+ #
156
+ # @example
157
+ # Faker::Games::Tarkov.mechanic_quest #=> "Signal - Part 4"
158
+ #
159
+ # @faker.version next
160
+ def mechanic_quest
161
+ fetch('tarkov.quests.mechanic')
162
+ end
163
+
164
+ ##
165
+ # Produces a random quest from Ragman from Escape from Tarkov.
166
+ #
167
+ # @return [String]
168
+ #
169
+ # @example
170
+ # Faker::Games::Tarkov.ragman_quest #=> "Hot Delivery"
171
+ #
172
+ # @faker.version next
173
+ def ragman_quest
174
+ fetch('tarkov.quests.ragman')
175
+ end
176
+
177
+ ##
178
+ # Produces a random quest from Jaeger from Escape from Tarkov.
179
+ #
180
+ # @return [String]
181
+ #
182
+ # @example
183
+ # Faker::Games::Tarkov.jaeger_quest #=> "The Tarkov Shooter - Part 1"
184
+ #
185
+ # @faker.version next
186
+ def jaeger_quest
187
+ fetch('tarkov.quests.jaeger')
188
+ end
189
+
190
+ ##
191
+ # Produces a random quest from Fence from Escape from Tarkov.
192
+ #
193
+ # @return [String]
194
+ #
195
+ # @example
196
+ # Faker::Games::Tarkov.fence_quest #=> "Compensation for Damage - Wager"
197
+ #
198
+ # @faker.version next
199
+ def fence_quest
200
+ fetch('tarkov.quests.fence')
201
+ end
202
+ end
203
+ end
204
+ end
205
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faker
4
+ class Movies
5
+ class Hackers < Base
6
+ class << self
7
+ ##
8
+ # Produces a real character name from Hackers.
9
+ #
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Movies::Hackers.character #=> "Dade Murphy"
14
+ #
15
+ # @faker.version next
16
+ def character
17
+ fetch('hackers.characters')
18
+ end
19
+
20
+ ##
21
+ # Produces a character hacker "handle" from Hackers.
22
+ #
23
+ # @return [String]
24
+ #
25
+ # @example
26
+ # Faker::Movies::Hackers.handle #=> "Zero Cool"
27
+ #
28
+ # @faker.version next
29
+ def handle
30
+ fetch('hackers.handles')
31
+ end
32
+
33
+ ##
34
+ # Produces a quote from Hackers.
35
+ #
36
+ # @return [String]
37
+ #
38
+ # @example
39
+ # Faker::Movies::Hackers.quote #=> "Hack the Planet!"
40
+ #
41
+ # @faker.version next
42
+ def quote
43
+ fetch('hackers.quotes')
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -138,11 +138,7 @@ module Faker
138
138
  # #=> "Aren't you a little short for a Stormtrooper?"
139
139
  #
140
140
  # @faker.version 1.6.2
141
- def quote(legacy_character = NOT_GIVEN, character: nil)
142
- warn_for_deprecated_arguments do |keywords|
143
- keywords << :character if legacy_character != NOT_GIVEN
144
- end
145
-
141
+ def quote(character: nil)
146
142
  quoted_characters = translate('faker.star_wars.quotes')
147
143
 
148
144
  if character.nil?
data/lib/faker/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faker # :nodoc:
4
- VERSION = '2.23.0'
4
+ VERSION = '3.0.0'
5
5
  end
data/lib/faker.rb CHANGED
@@ -4,7 +4,6 @@ mydir = __dir__
4
4
 
5
5
  require 'psych'
6
6
  require 'i18n'
7
- require 'set' # Fixes a bug in i18n 0.6.11
8
7
 
9
8
  Dir.glob(File.join(mydir, 'helpers', '*.rb')).sort.each { |file| require file }
10
9
 
@@ -260,58 +259,6 @@ module Faker
260
259
  ensure
261
260
  I18n.enforce_available_locales = old_enforce_available_locales
262
261
  end
263
-
264
- private
265
-
266
- def warn_for_deprecated_arguments
267
- keywords = []
268
- yield(keywords)
269
-
270
- return if keywords.empty?
271
-
272
- method_name = caller.first.match(/`(?<method_name>.*)'/)[:method_name]
273
-
274
- keywords.each.with_index(1) do |keyword, index|
275
- i = case index
276
- when 1 then '1st'
277
- when 2 then '2nd'
278
- when 3 then '3rd'
279
- else "#{index}th"
280
- end
281
-
282
- warn_with_uplevel(<<~MSG, uplevel: 5)
283
- Passing `#{keyword}` with the #{i} argument of `#{method_name}` is deprecated. Use keyword argument like `#{method_name}(#{keyword}: ...)` instead.
284
- MSG
285
- end
286
-
287
- warn(<<~MSG)
288
-
289
- To automatically update from positional arguments to keyword arguments,
290
- install rubocop-faker and run:
291
-
292
- rubocop \\
293
- --require rubocop-faker \\
294
- --only Faker/DeprecatedArguments \\
295
- --auto-correct
296
-
297
- MSG
298
- end
299
-
300
- # Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower.
301
- def warn_with_uplevel(message, uplevel: 1)
302
- at = parse_caller(caller[uplevel]).join(':')
303
- warn "#{at}: #{message}"
304
- end
305
-
306
- def parse_caller(at)
307
- # rubocop:disable Style/GuardClause
308
- if /^(.+?):(\d+)(?::in `.*')?/ =~ at
309
- file = Regexp.last_match(1)
310
- line = Regexp.last_match(2).to_i
311
- [file, line]
312
- end
313
- # rubocop:enable Style/GuardClause
314
- end
315
262
  end
316
263
  end
317
264
  end
@@ -0,0 +1,53 @@
1
+ en:
2
+ faker:
3
+ hackers:
4
+ characters:
5
+ - Dade Murphy
6
+ - Kate Libby
7
+ - Emmanuel Goldstein
8
+ - Ramόn Sánchez
9
+ - Paul Cook
10
+ - Joey Pardella
11
+ - Eugene Belford
12
+ - Margo Wallace
13
+ - Hal
14
+ - Lauren Murphy
15
+ - Special Agent Richard Gill
16
+ - Special Agent Ray
17
+ - Special Agent Bob
18
+ handles:
19
+ - Zero Cool
20
+ - Crash Override
21
+ - Acid Burn
22
+ - Cereal Killer
23
+ - The Phantom Phreak
24
+ - Lord Nikon
25
+ - The Plague
26
+ - Razor
27
+ - Blade
28
+ quotes:
29
+ - Hack the Planet!
30
+ - There is no right or wrong, only fun and boring
31
+ - Mess with the best, die like the rest
32
+ - This is the end, my friend. Thank you for calling
33
+ - Never send a boy to do a woman's job
34
+ - We have no names, man. No names. We are nameless!
35
+ - Kid, don't threaten me. There are worse things than death, and uh, I can do all of them
36
+ - I got a photographic memory. It's a curse!
37
+ - Remember, hacking is more than just a crime. It's a survival trait
38
+ - This is our world now. The world of the electron and the switch. The beauty of the baud. We exist without nationality, skin color, or religious bias. You wage wars, murder, cheat, lie to us and try to make us believe it's for our own good, yet we're the criminals. Yes, I am a criminal. My crime is that of curiosity. I am a hacker and this is my manifesto. You may stop me, but you can't stop us all
39
+ - God gave men brains larger than dogs so they wouldn't hump women's legs at cocktail parties
40
+ - There is no right and wrong. There's only fun and boring
41
+ - Never fear, I is here
42
+ - It's stupid, man. It's universally stupid
43
+ - Yo, I kinda feel like God
44
+ - That's it, you're looking at it. He just looks slick all day
45
+ - Well, it looks like I'm on top
46
+ - Congratulations. No one's ever beat her before. You just made an enemy for life
47
+ - Pool on the roof must have a leak
48
+ - Whoa, this isn't wood shop class?
49
+ - I hope you don't screw like you type
50
+ - I don't play well with others
51
+ - Anything else? You want me to mow the lawn? Oops forgot, New York, no grass
52
+ - It's in that place where I put that thing that time
53
+ - RISC is good
@@ -83,7 +83,7 @@ en:
83
83
  - Labetha
84
84
  - Lacus
85
85
  - Lord Haart
86
- - Lord Haart
86
+ - Lord Haart
87
87
  - Lorelei
88
88
  - Loynis
89
89
  - Luna
@@ -261,7 +261,7 @@ en:
261
261
  - Battle Mage
262
262
  - Beastmaster
263
263
  - Cleric
264
- - Death Knight
264
+ - Death Knight
265
265
  - Demoniac
266
266
  - Druid
267
267
  - Elementalist
@@ -87,7 +87,7 @@ en:
87
87
  - Alfredo il grande
88
88
  - Il fortunato inganno
89
89
  - L'ajo nell'imbarazzo
90
- - Emilia di Liverpool or L'eremitaggio di Liverpool
90
+ - Emilia di Liverpool or L'eremitaggio di Liverpool
91
91
  - Alahor in Granata
92
92
  - Don Gregorio
93
93
  - Elvida
@@ -8,13 +8,13 @@ en:
8
8
  - Baptiste
9
9
  - Bastion
10
10
  - Brigitte
11
+ - Cassidy
11
12
  - D.va
12
13
  - Doomfist
13
14
  - Genji
14
15
  - Hanzo
15
16
  - Junkrat
16
17
  - Lucio
17
- - McCree
18
18
  - Mei
19
19
  - Mercy
20
20
  - Moira
@@ -265,9 +265,8 @@ en:
265
265
  - No one likes a squealer
266
266
  - Ready for the fireworks
267
267
  - You that sound like a bad thing
268
- - Brave of you to show your face around here, Jesse
268
+ - Brave of you to show your face around here, Cole
269
269
  - On the dartboard
270
- - What did you do with it Jesse
271
270
  - Too competent
272
271
  - Ultimate - Light Em Up
273
272
  - Ultimate - Vide Bal Sou Yo
@@ -1048,7 +1047,7 @@ en:
1048
1047
  - Bastion, you would make the perfect research assistant
1049
1048
  - Youre just no good bully
1050
1049
  - Look somewhere else
1051
- - Hey, McCree, do you know what time it is
1050
+ - Hey, Cole, do you know what time it is
1052
1051
  - I love your glasses, so cute!
1053
1052
  - We should compare notes some time
1054
1053
  - Zarya How can you even pick up all that weight
@@ -1340,7 +1339,6 @@ en:
1340
1339
  - Target Eliminated
1341
1340
  - Final Blow - You Got Served
1342
1341
  - Sorry, Reinhardt
1343
- - "(vs McCree) Got you this time, Jesse"
1344
1342
  - You made a tactical error
1345
1343
  - I Always Get My Prey
1346
1344
  - Operating At Maximum Efficiency
@@ -1393,7 +1391,7 @@ en:
1393
1391
  - Try me
1394
1392
  - Then I have nothing to worry about
1395
1393
  - I always dreamed of the day we would fight together
1396
- - McCree, where did you learn to shoot like that
1394
+ - Cassidy, where did you learn to shoot like that?
1397
1395
  - See you in the air
1398
1396
  - I had a poster of you on my wall when I was younger
1399
1397
  - I lost many good soldiers here
@@ -1897,7 +1895,7 @@ en:
1897
1895
  - If you hold the information, you hold all the cards
1898
1896
  - You trying to be scary
1899
1897
  - I can be nice
1900
- - Pleasure working with you McCree. If that is your real name
1898
+ - Pleasure working with you, Cassidy... if that is your real name
1901
1899
  - So what are we doing here, boss
1902
1900
  - What can I say. A girl just has to have the latest tech
1903
1901
  - Your friend, Katya Volskaya. What will you say when you learn the truth
@@ -9,6 +9,7 @@ en:
9
9
  python: "print('Hello World!')"
10
10
  java: "System.out.println('Hello World!');"
11
11
  elixir: "IO.puts 'Hello World!'"
12
+ clojure: "(print 'Hello World!')"
12
13
  print:
13
14
  ruby: "puts 'faker_string_to_print'"
14
15
  javascript: "console.log('faker_string_to_print');"
@@ -17,6 +18,7 @@ en:
17
18
  python: "print('faker_string_to_print')"
18
19
  java: "System.out.println('faker_string_to_print');"
19
20
  elixir: "IO.puts 'faker_string_to_print'"
21
+ clojure: "(print 'faker_string_to_print')"
20
22
  print_1_to_10:
21
23
  ruby: "
22
24
  (1..10).each { |i| puts i }"
@@ -44,3 +46,6 @@ en:
44
46
  Enum.each(1..10, fn(x) ->
45
47
  IO.puts x
46
48
  end)"
49
+ clojure: "
50
+ (for [i (range 1 11)]
51
+ (println i))"
@@ -11,8 +11,8 @@ en:
11
11
  - Baseball # Technically part of "Baseball Softball" according to IOC website
12
12
  - Basketball
13
13
  - Beach volleyball
14
- - BMX freestyle
15
- - BMX racing
14
+ - BMX freestyle # Officially "Cycling BMX Freestyle"
15
+ - BMX racing # Officially "Cycling BMX Racing"
16
16
  - Boxing
17
17
  - Canoe/kayak flatwater
18
18
  - Canoe/kayak slalom
@@ -27,11 +27,11 @@ en:
27
27
  - Karate
28
28
  - Marathon swimming
29
29
  - Modern pentathlon
30
- - Mountain bike
30
+ - Mountain bike # Officially "Cycling Mountain Bike"
31
31
  - Rhythmic gymnastics
32
- - Road cycling
32
+ - Road cycling # Officially "Cycling Road"
33
33
  - Rowing
34
- - Rugby
34
+ - Rugby # Officially "Rugby Sevens"
35
35
  - Sailing
36
36
  - Shooting
37
37
  - Skateboarding
@@ -42,7 +42,7 @@ en:
42
42
  - Table tennis
43
43
  - Taekwondo
44
44
  - Tennis
45
- - Track cycling
45
+ - Track cycling # Officially "Cycling Track"
46
46
  - Trampoline
47
47
  - Triathlon
48
48
  - Volleyball
@@ -53,7 +53,7 @@ en:
53
53
  - Alpine skiing
54
54
  - Biathlon
55
55
  - Bobsleigh
56
- - Cross-country
56
+ - Cross-country skiing
57
57
  - Curling
58
58
  - Figure skating
59
59
  - Freestyle skiing
@@ -63,17 +63,18 @@ en:
63
63
  - Short track speed skating
64
64
  - Skeleton
65
65
  - Ski jumping
66
+ - Ski mountaineering
66
67
  - Snowboard
67
68
  - Speed skating
68
69
  summer_paralympics: # Source https://www.paralympic.org/sports
69
70
  - Archery
70
71
  - Athletics
71
72
  - Badminton
73
+ - Blind football
72
74
  - Boccia
73
75
  - Canoe
74
76
  - Cycling
75
77
  - Equestrian
76
- - Football (5-a-side)
77
78
  - Goalball
78
79
  - Judo
79
80
  - Powerlifting
@@ -110,6 +111,7 @@ en:
110
111
  - Ban'ei
111
112
  - Bathtubbing
112
113
  - Bed racing
114
+ - Bossaball
113
115
  - Botaoshi
114
116
  - Beer Can Regatta
115
117
  - Black pudding throwing
@@ -117,5 +119,12 @@ en:
117
119
  - Bottle kicking
118
120
  - Camel jumping
119
121
  - Camel wrestling
122
+ - Chess boxing
123
+ - Extreme ironing
120
124
  - Flugtag/Birdman
125
+ - Gurning
121
126
  - Kastenlauf (Beer crate running)
127
+ - Oil wrestling
128
+ - Poohsticks
129
+ - Wife carrying
130
+ - Zorbing