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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d8cd66a58c224a6a003a614df1b81c934ddf8eb4033d51f4cc4df2a0b377193
4
- data.tar.gz: f761e03f47cd4e7b04d5c5f70e9639576e628613b5f3eca232b21a38e3aa810d
3
+ metadata.gz: 6a9b68cfd73d84ab10a3382407a6675395cdb07fa17113b99b84390fef9a4fb5
4
+ data.tar.gz: 12fbdbeb4cbb3409954520b90a9fdfe871ad08db697cf8477b2b236e1810297e
5
5
  SHA512:
6
- metadata.gz: 6a902462978f950d791e6ba96b1ce48fdd3b2db3e1336871a48b98410c6dd5f6f29397f8763f1c3786398162a140e1f664849ee6469c538d8d68d81d0c875b35
7
- data.tar.gz: c4996e30be72c6f8b747e236bc139585695c9e554982794ab5b78961a9944b632ae4c408218b47a5799e015d536164356538dbf748a1290ff69353e1e3aa390a
6
+ metadata.gz: f0b5d764aa8f24a5e95efe003aac284070d918f326e511dee2e88a34e3ff94d703720056be7e408730aee439cc0be5d26e8c657b3922fce218ce01f75375489e
7
+ data.tar.gz: 705a4e403466b231ff18223bf8904387eb3f8aabbe7544826375c5f332b64b362ac174b2b5b8c00de2a8dfc0aacf63a66ab708ea876dd78d92ee61a27bc9c9aa
data/CHANGELOG.md CHANGED
@@ -1,29 +1,83 @@
1
- # Change Log
1
+ # Changelog
2
+
3
+ ## [v3.0.0](https://github.com/faker-ruby/faker/tree/v3.0.0) (2022-11-01)
4
+
5
+ ### Breaking Changes
6
+ - [PR #2576](https://github.com/faker-ruby/faker/pull/2576) Drop support for positional arguments in favor of keyword arguments. Support for positional arguments was deprecated on v2 [@mauromorales](https://github.com/mauromorales)
7
+
8
+ ### Bug/Fixes
9
+ - [PR #2562](https://github.com/faker-ruby/faker/pull/2562) Fix Faker::Vehicle.vin [@rmm5t](https://github.com/rmm5t)
10
+ - [PR #2567](https://github.com/faker-ruby/faker/pull/2567) Fix typo abreviation -> abbreviation [@alextaujenis](https://github.com/alextaujenis)
11
+ - [PR #2594](https://github.com/faker-ruby/faker/pull/2594) Fix some typos [@jdufresne](https://github.com/jdufresne)
12
+ - [PR #2596](https://github.com/faker-ruby/faker/pull/2596) Removes NBSP from locales files [@hbontempo-br](https://github.com/hbontempo-br)
13
+
14
+ ### Features
15
+ - [PR #2561](https://github.com/faker-ruby/faker/pull/2561) Add country code for `en-CA` phone numbers [@wjessop](https://github.com/wjessop)
16
+ - [PR #2566](https://github.com/faker-ruby/faker/pull/2566) Add color luminosity options [@fbuys](https://github.com/fbuys)
17
+ - [PR #2570](https://github.com/faker-ruby/faker/pull/2570) Add French Translation of Ancient [@Beygs](https://github.com/Beygs)
18
+ - [PR #2582](https://github.com/faker-ruby/faker/pull/2582) Add `clojure` as a language option to `Faker::Source` generator [@professorjrod](https://github.com/professorjrod)
19
+ - [PR #2585](https://github.com/faker-ruby/faker/pull/2585) Add movie Hackers [@ericdain](https://github.com/ericdain)
20
+ - [PR #2589](https://github.com/faker-ruby/faker/pull/2589) Add Game Escape From Tarkov [@professorjrod](https://github.com/professorjrod)
21
+ - [PR #2592](https://github.com/faker-ruby/faker/pull/2592) Add quotes to "no"-key [@Frubrecht](https://github.com/Frubrecht)
22
+
23
+ ### What's Changed
24
+ - [PR #2549](https://github.com/faker-ruby/faker/pull/2549) Set true to `rubygems_mfa_required` gemspec metadata [@koic](https://github.com/koic)
25
+ - [PR #2557](https://github.com/faker-ruby/faker/pull/2557) Use rubocop-rake to lint Rake tasks [@dmarcoux](https://github.com/dmarcoux)
26
+ - [PR #2551](https://github.com/faker-ruby/faker/pull/2551) Security: set explicit and strict token-permissions on GitHub workflows [@sashashura](https://github.com/sashashura)
27
+ - [PR #2558](https://github.com/faker-ruby/faker/pull/2558) Remove unneeded require]() lib/faker.rb [@dmarcoux](https://github.com/dmarcoux)
28
+ - [PR #2568](https://github.com/faker-ruby/faker/pull/2568) Remove outdated comment from development dependencies [@stefannibrasil](https://github.com/stefannibrasil)
29
+ - [PR #2569](https://github.com/faker-ruby/faker/pull/2569) Improve Phone Number Locale documentation [@calvinballing](https://github.com/calvinballing)
30
+ - [PR #2579](https://github.com/faker-ruby/faker/pull/2579) Add note about Random behavior on MiniTest [@stefannibrasil](https://github.com/stefannibrasil)
31
+ - [PR #2580](https://github.com/faker-ruby/faker/pull/2580) Remove mentions to `master` and use `main` [@stefannibrasil](https://github.com/stefannibrasil)
32
+ - [PR #2586](https://github.com/faker-ruby/faker/pull/2586) Change McCree to Cassidy on Overwatch generator [@ericdain](https://github.com/ericdain)
33
+ - [PR #2584](https://github.com/faker-ruby/faker/pull/2584) Automate workflow to publish to RubyGems. [@bijoysijo](https://github.com/bijoysijo)
34
+ - [PR #2598](https://github.com/faker-ruby/faker/pull/2598) Remove tags from publish.yml [@vbrazo](https://github.com/vbrazo)
35
+ - [PR #2604](https://github.com/faker-ruby/faker/pull/2604) Update fi-FI state listing from year 1721 to 2022 [@Newman101](https://github.com/Newman101)
36
+ - [PR #2602](https://github.com/faker-ruby/faker/pull/2602) Fix publish action for release types [@thdaraujo](https://github.com/thdaraujo)
37
+ - [PR #2591](https://github.com/faker-ruby/faker/pull/2591) Fixes iban checksum calculation [@srcoley](https://github.com/srcoley)
38
+ - [PR #2599](https://github.com/faker-ruby/faker/pull/2599) Fix documentation for tarkov game [@kaushikhande](https://github.com/kaushikhande)
39
+ - [PR #2600](https://github.com/faker-ruby/faker/pull/2600) Add sports documentation and update sports [@matt17r](https://github.com/matt17r)
40
+ - [PR #2590](https://github.com/faker-ruby/faker/pull/2590) Deprecate LoremPixel [@uzorjchibuzor](https://github.com/uzorjchibuzor)
41
+
42
+ ### Update local dependencies
43
+ - Update rubocop minitest to `0.23.0`
44
+ - Update simplecov to `0.21.0`
45
+ - Update test-unit to `3.5.5`
46
+ - Update rubocop to `1.37.1`
47
+
48
+ **Full Changelog**: https://github.com/faker-ruby/faker/compare/v2.23.0...v3.0.0
49
+
50
+ ------------------------------------------------------------------------------
2
51
 
3
52
  ## [v2.23.0](https://github.com/faker-ruby/faker/tree/v2.23.0) (2022-09-01)
4
53
 
5
- * Fix Japanese plural by @akmhmgc in https://github.com/faker-ruby/faker/pull/2517
6
- * Update rubocop requirement from = 1.26.0 to = 1.28.2 by @dependabot in https://github.com/faker-ruby/faker/pull/2483
7
- * Add sports to `Faker::Sport` by @matt17r in https://github.com/faker-ruby/faker/pull/2397
8
- * [Internet::Password] Improve mix_case and special_characters support by @meuble in https://github.com/faker-ruby/faker/pull/2308
9
- * Danish id number by @jokklan in https://github.com/faker-ruby/faker/pull/2511
10
- * Add generator for vulnerability identifiers by @NobodysNightmare in https://github.com/faker-ruby/faker/pull/2367
11
- * Add the ability to generate a mime type of a specific media type by @ric2b in https://github.com/faker-ruby/faker/pull/2518
12
- * Add IDNumber.french_insee_number by @Spone in https://github.com/faker-ruby/faker/pull/2455
13
- * fix flaky user agent test by @thdaraujo in https://github.com/faker-ruby/faker/pull/2530
14
- * Update GitHub Issues and Pull Request Templates [ci-skip] by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2531
15
- * fix: ensure generated passwords have correct characters when mixed_case & special_characters enabled by @tiff-o in https://github.com/faker-ruby/faker/pull/2532
16
- * Thread safety by @kiskoza in https://github.com/faker-ruby/faker/pull/2520
17
- * Fix warning instance variable uninitialized by @akmhmgc in https://github.com/faker-ruby/faker/pull/2535
18
- * fix italy VAT and add italy condominium fiscal code generator by @FiloSpaTeam in https://github.com/faker-ruby/faker/pull/2491
19
- * Add ChileRut.full_formatted_rut by @KarlHeitmann in https://github.com/faker-ruby/faker/pull/2460
20
- * Updated versions and added more operating systems by @abrahamparayil in https://github.com/faker-ruby/faker/pull/2536
21
- * Add vehicle version generator by @trinaldi in https://github.com/faker-ruby/faker/pull/2540
22
- * Fix computer test by @trinaldi in https://github.com/faker-ruby/faker/pull/2543
23
- * Drop support for EOL Ruby versions (`2.5` and `2.6`) by @nickmendezFlatiron in https://github.com/faker-ruby/faker/pull/2538
24
- * Update minitest requirement from = 5.15.0 to = 5.16.3 by @dependabot in https://github.com/faker-ruby/faker/pull/2547
25
- * Update rubocop requirement from = 1.28.2 to = 1.35.1 by @dependabot in https://github.com/faker-ruby/faker/pull/2548
26
- * Fix `fma_brotherhood` usage example by @y0n0zawa in https://github.com/faker-ruby/faker/pull/2552
54
+ ### Bug/Fixes
55
+ - [PR #2517](https://github.com/faker-ruby/faker/pull/) Fix Japanese plural [@akmhmgc](https://github.com/akmhmgc)
56
+ - [PR #2308](https://github.com/faker-ruby/faker/pull/) Internet::Password - Improve mix_case and special_characters support [@meuble](https://github.com/meuble)
57
+ - [PR #2520](https://github.com/faker-ruby/faker/pull/) Add thread safety [@kiskoza](https://github.com/kiskoza)
58
+ - [PR #2543](https://github.com/faker-ruby/faker/pull/) Fix computer test [@trinaldi](https://github.com/trinaldi)
59
+ - [PR #2552](https://github.com/faker-ruby/faker/pull/) Fix `fma_brotherhood` usage example [@y0n0zawa](https://github.com/y0n0zawa)
60
+
61
+ ### Features
62
+ - [PR #2367](https://github.com/faker-ruby/faker/pull/) Add generator for vulnerability identifiers [@NobodysNightmare](https://github.com/NobodysNightmare)
63
+ - [PR #2397](https://github.com/faker-ruby/faker/pull/) Add sports to `Faker::Sport` [@matt17r](https://github.com/matt17r)
64
+ - [PR #2511](https://github.com/faker-ruby/faker/pull/) Add Danish id number [@jokklan](https://github.com/jokklan)
65
+ - [PR #2518](https://github.com/faker-ruby/faker/pull/) Add the ability to generate a mime type of a specific media type [@ric2b](https://github.com/ric2b)
66
+ - [PR #2455](https://github.com/faker-ruby/faker/pull/) Add IDNumber.french_insee_number [@Spone](https://github.com/Spone)
67
+ - [PR #2491](https://github.com/faker-ruby/faker/pull/) fix italy VAT and add italy condominium fiscal code generator [@FiloSpaTeam](https://github.com/FiloSpaTeam)
68
+ - [PR #2460](https://github.com/faker-ruby/faker/pull/) Add ChileRut.full_formatted_rut [@KarlHeitmann](https://github.com/KarlHeitmann)
69
+ - [PR #2540](https://github.com/faker-ruby/faker/pull/) Add vehicle version generator [@trinaldi](https://github.com/trinaldi)
70
+
71
+ ### What's Changed
72
+ - [PR #2530](https://github.com/faker-ruby/faker/pull/) Fix flaky user agent test [@thdaraujo](https://github.com/thdaraujo)
73
+ - [PR #2531](https://github.com/faker-ruby/faker/pull/) Update GitHub Issues and Pull Request Templates [ci-skip] [@stefannibrasil](https://github.com/stefannibrasil)
74
+ - [PR #2535](https://github.com/faker-ruby/faker/pull/) Fix warning instance variable uninitialized [@akmhmgc](https://github.com/akmhmgc)
75
+ - [PR #2536](https://github.com/faker-ruby/faker/pull/) Updated versions and added more operating systems [@abrahamparayil](https://github.com/abrahamparayil)
76
+ - [PR #2538](https://github.com/faker-ruby/faker/pull/) Drop support for EOL Ruby versions (`2.5` and `2.6`) [@nickmendezFlatiron](https://github.com/nickmendezFlatiron)
77
+
78
+ ### Update local dependencies
79
+ - Update minitest to `5.16.3`
80
+ - Update rubocop to `1.35.1`
27
81
 
28
82
  ------------------------------------------------------------------------------
29
83
 
@@ -426,7 +480,7 @@ This version:
426
480
  ## Bug/Fixes
427
481
 
428
482
  - [PR #2050](https://github.com/faker-ruby/faker/pull/2050) Fix random error in music tests [@martinjaimem](https://github.com/martinjaimem)
429
- - [PR #2037](https://github.com/faker-ruby/faker/pull/2037) Bug Fix: BIC Collission (Issue 1907) [@Newman101](https://github.com/Newman101)
483
+ - [PR #2037](https://github.com/faker-ruby/faker/pull/2037) Bug Fix: BIC Collision (Issue 1907) [@Newman101](https://github.com/Newman101)
430
484
  - [PR #2026](https://github.com/faker-ruby/faker/pull/2026) Sanitize email when name has special characters [@Zeragamba](https://github.com/Zeragamba)
431
485
  - [PR #1785](https://github.com/faker-ruby/faker/pull/1785) Adds a fix for when :en is not one of the available locales [@jaimerodas](https://github.com/jaimerodas)
432
486
 
@@ -1167,7 +1221,7 @@ Version 2 has several `breaking changes`. We replaced positional arguments with
1167
1221
  - `Faker::Types.rb_integer(from = nil, to = nil)` becomes `Faker::Types.rb_integer(from: nil, to: nil)`
1168
1222
  - `Faker::Types.rb_string(words = nil)` becomes `Faker::Types.rb_string(words: nil)`
1169
1223
  - `Faker::Vehicle.kilometrage(min = nil, max = nil)` becomes `Faker::Vehicle.kilometrage(min: nil, max: nil)`
1170
- - `Faker::Vehicle.license_plate(state_abreviation = nil)` becomes `Faker::Vehicle.license_plate(state_abreviation: nil)`
1224
+ - `Faker::Vehicle.license_plate(state_abbreviation = nil)` becomes `Faker::Vehicle.license_plate(state_abbreviation: nil)`
1171
1225
  - `Faker::Vehicle.mileage(min = nil, max = nil)` becomes `Faker::Vehicle.mileage(min: nil, max: nil)`
1172
1226
  - `Faker::Vehicle.model(make_of_model = nil)` becomes `Faker::Vehicle.model(make_of_model: nil)`
1173
1227
  - `Faker::WorldCup.group(group = nil)` becomes `Faker::WorldCup.group(group: nil)`
@@ -1276,7 +1330,7 @@ Fix lib/faker/version.rb
1276
1330
 
1277
1331
  ### Update/add locales
1278
1332
 
1279
- - [PR #1629](https://github.com/stympy/faker/pull/1629) Fix sintax error on game.yml file [@ricardobsilva](https://github.com/ricardobsilva)
1333
+ - [PR #1629](https://github.com/stympy/faker/pull/1629) Fix syntax error on game.yml file [@ricardobsilva](https://github.com/ricardobsilva)
1280
1334
  - [PR #1627](https://github.com/stympy/faker/pull/1627) add more data for Faker::Games [@BlazingRockStorm](https://github.com/BlazingRockStorm)
1281
1335
  - [PR #1620](https://github.com/stympy/faker/pull/1620) Added Yuumi as a Champion [@eddorre](https://github.com/eddorre)
1282
1336
  - [PR #1621](https://github.com/stympy/faker/pull/1621) Updated classes to match the changes that Blizzard rolled out late last year. Updated hero pool to add the latest two heroes added to the game. [@eddorre](https://github.com/eddorre)
@@ -1539,7 +1593,7 @@ Fix lib/faker/version.rb
1539
1593
  - [PR #1220](https://github.com/stympy/faker/pull/1220) Updates for Faker::Myst [@SpyMaster356](https://github.com/SpyMaster356)
1540
1594
  - [PR #1218](https://github.com/stympy/faker/pull/1218) Add Faker::Myst [@SpyMaster356](https://github.com/SpyMaster356)
1541
1595
  - [PR #818](https://github.com/stympy/faker/pull/818) LoremFlickr support [@mrstebo](https://github.com/mrstebo)
1542
- - [PR #1192](https://github.com/stympy/faker/pull/1192) Space: Added space launch vehicule [@gauth-ier](https://github.com/Gauth-ier)
1596
+ - [PR #1192](https://github.com/stympy/faker/pull/1192) Space: Added space launch vehicle [@gauth-ier](https://github.com/Gauth-ier)
1543
1597
  - [PR #1211](https://github.com/stympy/faker/pull/1211) Add bands, genres, and albums to Music [@jmkoni](https://github.com/jmkoni)
1544
1598
  - [PR #1215](https://github.com/stympy/faker/pull/1215) Added Nato Phonetic Alphabet [@timcustard](https://github.com/timcustard)
1545
1599
  - [PR #1209](https://github.com/stympy/faker/pull/1209) Add Faker::Source [@graciano](https://github.com/graciano)
@@ -1659,7 +1713,7 @@ Fix lib/faker/version.rb
1659
1713
 
1660
1714
  **Other changes**
1661
1715
 
1662
- - Changed i18n depedency from `~> 0.9.1` to `>= 0.7`
1716
+ - Changed i18n dependency from `~> 0.9.1` to `>= 0.7`
1663
1717
 
1664
1718
  ## [v1.8.5](https://github.com/stympy/faker/tree/v1.8.5) (2017-12-06)
1665
1719
  [Full Changelog](https://github.com/stympy/faker/compare/v1.8.4...v1.8.5)
@@ -2155,7 +2209,7 @@ Fix lib/faker/version.rb
2155
2209
  * Added bork locale for bork-ified lorem [johnbentcope]
2156
2210
  * Added IPv6 address generator [jc00ke]
2157
2211
  * Removed deprecation warnings for Array#rand [chrismarshall]
2158
- * Added German translation and I18n improvments [Matthias Kühnert]
2212
+ * Added German translation and I18n improvements [Matthias Kühnert]
2159
2213
  * Added Dutch translation [moretea]
2160
2214
  * Added Lat/Long generator [Andy Callaghan]
2161
2215
  * Added buzzword-laden title generator [supercleanse]
data/History.md CHANGED
@@ -104,7 +104,7 @@
104
104
  * Added bork locale for bork-ified lorem [johnbentcope]
105
105
  * Added IPv6 address generator [jc00ke]
106
106
  * Removed deprecation warnings for Array#rand [chrismarshall]
107
- * Added German translation and I18n improvments [Matthias Kühnert]
107
+ * Added German translation and I18n improvements [Matthias Kühnert]
108
108
  * Added Dutch translation [moretea]
109
109
  * Added Lat/Long generator [Andy Callaghan]
110
110
  * Added buzzword-laden title generator [supercleanse]
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # Faker
4
4
  [![Tests](https://github.com/faker-ruby/faker/workflows/Tests/badge.svg)](https://github.com/faker-ruby/faker/actions?query=workflow%3ATests)
5
5
  [![Gem Version](https://badge.fury.io/rb/faker.svg)](https://badge.fury.io/rb/faker)
6
- [![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=master)](https://inch-ci.org/github/faker-ruby/faker)
6
+ [![Inline docs](https://inch-ci.org/github/faker-ruby/faker.svg?branch=main)](https://inch-ci.org/github/faker-ruby/faker)
7
7
  [![Test Coverage](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/test_coverage)](https://codeclimate.com/github/stympy/faker/test_coverage)
8
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/ef54c7f9df86e965d64b/maintainability)](https://codeclimate.com/github/stympy/faker/maintainability)
9
9
 
@@ -44,7 +44,9 @@ development.
44
44
  * While Faker generates data at random, returned values are not guaranteed to be unique by default.
45
45
  You must explicitly specify when you require unique values, see [details](#ensuring-unique-values).
46
46
  Values also can be deterministic if you use the deterministic feature, see [details](#deterministic-random)
47
- * This is the `master` branch of Faker and may contain changes that are not yet released.
47
+ * Minitest and Faker >= 2.22 users might need to add the following to the `test_helper.rb` or `rails_helper.rb` file:
48
+ `Faker::Config.random = Random.new`. See [Issue #2534](https://github.com/faker-ruby/faker/issues/2534) for more details.
49
+ * This is the `main` branch of Faker and may contain changes that are not yet released.
48
50
  Please refer the README of your version for the available methods.
49
51
  List of all versions is [available here](https://github.com/stympy/faker/releases).
50
52
 
@@ -55,7 +57,7 @@ gem install faker
55
57
  Note: if you are getting a `uninitialized constant Faker::[some_class]` error, your version of the gem is behind the one documented here. To make sure that your gem is the one documented here, change the line in your Gemfile to:
56
58
 
57
59
  ```ruby
58
- gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'master'
60
+ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
59
61
  ```
60
62
 
61
63
  ## Usage
@@ -117,7 +119,7 @@ Faker::Company.bs #=> "cultivate viral synergies"
117
119
  **NOTE: Some of the generators below aren't released yet. If you want to use them, change the line in your gemfile to:**
118
120
 
119
121
  ```ruby
120
- gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'master'
122
+ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
121
123
  ```
122
124
 
123
125
  ### Default
@@ -314,8 +316,11 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
314
316
 
315
317
 
316
318
  ### Sports
319
+ - [Faker::Sports](doc/sports/sports.md)
317
320
  - [Faker::Sports::Basketball](doc/sports/basketball.md)
318
321
  - [Faker::Sports::Football](doc/sports/football.md)
322
+ - [Faker::Sports::Mountaineering](doc/sports/mountaineering.md)
323
+ - [Faker::Sports::Volleyball](doc/sports/volleyball.md)
319
324
 
320
325
  ### Tv Shows
321
326
  - [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
@@ -400,7 +405,7 @@ en-au-ocker:
400
405
  ```
401
406
 
402
407
  ## Contributing
403
- See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/master/CONTRIBUTING.md).
408
+ See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/main/CONTRIBUTING.md).
404
409
 
405
410
  ## Contact
406
411
  Comments and feedback are welcome. Send an email to Benjamin Curtis via the [google group](http://groups.google.com/group/ruby-faker).
@@ -71,11 +71,7 @@ module Faker
71
71
  # #=> "He who controls the spice, controls the universe!"
72
72
  #
73
73
  # @faker.version 1.9.3
74
- def quote(legacy_character = NOT_GIVEN, character: nil)
75
- warn_for_deprecated_arguments do |keywords|
76
- keywords << :character if legacy_character != NOT_GIVEN
77
- end
78
-
74
+ def quote(character: nil)
79
75
  quoted_characters = translate('faker.dune.quotes').keys
80
76
 
81
77
  if character.nil?
@@ -106,11 +102,7 @@ module Faker
106
102
  # #=> "May thy knife chip and shatter."
107
103
  #
108
104
  # @faker.version 1.9.3
109
- def saying(legacy_source = NOT_GIVEN, source: nil)
110
- warn_for_deprecated_arguments do |keywords|
111
- keywords << :source if legacy_source != NOT_GIVEN
112
- end
113
-
105
+ def saying(source: nil)
114
106
  sourced_sayings = translate('faker.dune.sayings').keys
115
107
 
116
108
  if source.nil?
@@ -29,11 +29,7 @@ module Faker
29
29
  # #=> "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fht...
30
30
  #
31
31
  # @faker.version 1.9.3
32
- def fhtagn(legacy_number = NOT_GIVEN, number: 1)
33
- warn_for_deprecated_arguments do |keywords|
34
- keywords << :number if legacy_number != NOT_GIVEN
35
- end
36
-
32
+ def fhtagn(number: 1)
37
33
  Array.new(number) { fetch('lovecraft.fhtagn') }.join('. ')
38
34
  end
39
35
 
@@ -86,12 +82,7 @@ module Faker
86
82
  # #=> "Effulgence unmentionable gambrel."
87
83
  #
88
84
  # @faker.version 1.9.3
89
- def sentence(legacy_word_count = NOT_GIVEN, legacy_random_words_to_add = NOT_GIVEN, word_count: 4, random_words_to_add: 6, open_compounds_allowed: true)
90
- warn_for_deprecated_arguments do |keywords|
91
- keywords << :word_count if legacy_word_count != NOT_GIVEN
92
- keywords << :random_words_to_add if legacy_random_words_to_add != NOT_GIVEN
93
- end
94
-
85
+ def sentence(word_count: 4, random_words_to_add: 6, open_compounds_allowed: true)
95
86
  "#{words(number: word_count + rand(random_words_to_add.to_i).to_i, spaces_allowed: open_compounds_allowed).join(' ').capitalize}."
96
87
  end
97
88
 
@@ -138,12 +129,7 @@ module Faker
138
129
  # # ]
139
130
  #
140
131
  # @faker.version 1.9.3
141
- def words(legacy_number = NOT_GIVEN, legacy_spaces_allowed = NOT_GIVEN, number: 3, spaces_allowed: false)
142
- warn_for_deprecated_arguments do |keywords|
143
- keywords << :number if legacy_number != NOT_GIVEN
144
- keywords << :spaces_allowed if legacy_spaces_allowed != NOT_GIVEN
145
- end
146
-
132
+ def words(number: 3, spaces_allowed: false)
147
133
  resolved_num = resolve(number)
148
134
  word_list = translate('faker.lovecraft.words')
149
135
  word_list *= ((resolved_num / word_list.length) + 1)
@@ -176,11 +162,7 @@ module Faker
176
162
  # # ]
177
163
  #
178
164
  # @faker.version 1.9.3
179
- def sentences(legacy_number = NOT_GIVEN, number: 3)
180
- warn_for_deprecated_arguments do |keywords|
181
- keywords << :number if legacy_number != NOT_GIVEN
182
- end
183
-
165
+ def sentences(number: 3)
184
166
  [].tap do |sentences|
185
167
  1.upto(resolve(number)) do
186
168
  sentences << sentence(word_count: 3)
@@ -207,12 +189,7 @@ module Faker
207
189
  # #=> "Stench cyclopean fainted antiquarian nameless. Antiquarian ululate tenebrous non-euclidean effulgence."
208
190
  #
209
191
  # @faker.version 1.9.3
210
- def paragraph(legacy_sentence_count = NOT_GIVEN, legacy_random_sentences_to_add = NOT_GIVEN, sentence_count: 3, random_sentences_to_add: 3)
211
- warn_for_deprecated_arguments do |keywords|
212
- keywords << :sentence_count if legacy_sentence_count != NOT_GIVEN
213
- keywords << :random_sentences_to_add if legacy_random_sentences_to_add != NOT_GIVEN
214
- end
215
-
192
+ def paragraph(sentence_count: 3, random_sentences_to_add: 3)
216
193
  sentences(number: resolve(sentence_count) + rand(random_sentences_to_add.to_i).to_i).join(' ')
217
194
  end
218
195
 
@@ -238,11 +215,7 @@ module Faker
238
215
  # # ]
239
216
  #
240
217
  # @faker.version 1.9.3
241
- def paragraphs(legacy_number = NOT_GIVEN, number: 3)
242
- warn_for_deprecated_arguments do |keywords|
243
- keywords << :number if legacy_number != NOT_GIVEN
244
- end
245
-
218
+ def paragraphs(number: 3)
246
219
  [].tap do |paragraphs|
247
220
  1.upto(resolve(number)) do
248
221
  paragraphs << paragraph(sentence_count: 3)
@@ -263,11 +236,7 @@ module Faker
263
236
  # #=> "Effulgence madness noisome. Fungus stygian mortal madness amorphous dank. Decadent noisome hideous effulgence. Tentacles charne."
264
237
  #
265
238
  # @faker.version 1.9.3
266
- def paragraph_by_chars(legacy_characters = NOT_GIVEN, characters: 256)
267
- warn_for_deprecated_arguments do |keywords|
268
- keywords << :characters if legacy_characters != NOT_GIVEN
269
- end
270
-
239
+ def paragraph_by_chars(characters: 256)
271
240
  paragraph = paragraph(sentence_count: 3)
272
241
 
273
242
  paragraph += " #{paragraph(sentence_count: 3)}" while paragraph.length < characters
@@ -18,11 +18,7 @@ module Faker
18
18
  # #=> "Northfort, California"
19
19
  #
20
20
  # @faker.version 0.3.0
21
- def city(legacy_options = NOT_GIVEN, options: {})
22
- warn_for_deprecated_arguments do |keywords|
23
- keywords << :options if legacy_options != NOT_GIVEN
24
- end
25
-
21
+ def city(options: {})
26
22
  parse(options[:with_state] ? 'address.city_with_state' : 'address.city')
27
23
  end
28
24
 
@@ -49,11 +45,7 @@ module Faker
49
45
  # Faker::Address.street_address #=> "282 Kevin Brook"
50
46
  #
51
47
  # @faker.version 0.3.0
52
- def street_address(legacy_include_secondary = NOT_GIVEN, include_secondary: false)
53
- warn_for_deprecated_arguments do |keywords|
54
- keywords << :include_secondary if legacy_include_secondary != NOT_GIVEN
55
- end
56
-
48
+ def street_address(include_secondary: false)
57
49
  numerify(parse('address.street_address') + (include_secondary ? " #{secondary_address}" : ''))
58
50
  end
59
51
 
@@ -121,11 +113,7 @@ module Faker
121
113
  # Faker::Address.zip_code(state_abbreviation: 'CO') #=> "80011"
122
114
  #
123
115
  # @faker.version 0.3.0
124
- def zip_code(legacy_state_abbreviation = NOT_GIVEN, state_abbreviation: '')
125
- warn_for_deprecated_arguments do |keywords|
126
- keywords << :state_abbreviation if legacy_state_abbreviation != NOT_GIVEN
127
- end
128
-
116
+ def zip_code(state_abbreviation: '')
129
117
  if state_abbreviation.empty?
130
118
  letterified_string = letterify(fetch('address.postcode'))
131
119
  return numerify(letterified_string, leading_zero: true)
@@ -242,11 +230,7 @@ module Faker
242
230
  # Faker::Address.country_by_code(code: 'NL') #=> "Netherlands"
243
231
  #
244
232
  # @faker.version 1.9.2
245
- def country_by_code(legacy_code = NOT_GIVEN, code: 'US')
246
- warn_for_deprecated_arguments do |keywords|
247
- keywords << :code if legacy_code != NOT_GIVEN
248
- end
249
-
233
+ def country_by_code(code: 'US')
250
234
  fetch("address.country_by_code.#{code}")
251
235
  end
252
236
 
@@ -260,11 +244,7 @@ module Faker
260
244
  # Faker::Address.country_name_to_code(name: 'united_states') #=> "US"
261
245
  #
262
246
  # @faker.version 1.9.2
263
- def country_name_to_code(legacy_name = NOT_GIVEN, name: 'united_states')
264
- warn_for_deprecated_arguments do |keywords|
265
- keywords << :name if legacy_name != NOT_GIVEN
266
- end
267
-
247
+ def country_name_to_code(name: 'united_states')
268
248
  fetch("address.country_by_name.#{name}")
269
249
  end
270
250
 
@@ -19,10 +19,7 @@ module Faker
19
19
  # Faker::Alphanumeric.alpha(number: 10) #=> "zlvubkrwga"
20
20
  #
21
21
  # @faker.version 1.9.2
22
- def alpha(legacy_number = NOT_GIVEN, number: 32)
23
- warn_for_deprecated_arguments do |keywords|
24
- keywords << :number if legacy_number != NOT_GIVEN
25
- end
22
+ def alpha(number: 32)
26
23
  char_count = resolve(number)
27
24
  return '' if char_count.to_i < 1
28
25
 
@@ -46,10 +43,7 @@ module Faker
46
43
  # Faker::Alphanumeric.alphanumeric(number: 10, min_alpha: 3, min_numeric: 3) #=> "3yfq2phx8b"
47
44
  #
48
45
  # @faker.version 2.1.3
49
- def alphanumeric(legacy_number = NOT_GIVEN, number: 32, min_alpha: 0, min_numeric: 0)
50
- warn_for_deprecated_arguments do |keywords|
51
- keywords << :number if legacy_number != NOT_GIVEN
52
- end
46
+ def alphanumeric(number: 32, min_alpha: 0, min_numeric: 0)
53
47
  char_count = resolve(number)
54
48
  return '' if char_count.to_i < 1
55
49
  raise ArgumentError, 'min_alpha must be greater than or equal to 0' if min_alpha&.negative?
@@ -42,8 +42,6 @@ module Faker
42
42
  parse('app.author')
43
43
  end
44
44
 
45
- # rubocop:disable Metrics/ParameterLists
46
-
47
45
  ##
48
46
  # Produces a String representing a semantic version identifier.
49
47
  #
@@ -62,16 +60,9 @@ module Faker
62
60
  # Faker::App.semantic_version(patch: 5..6) #=> "7.2.6"
63
61
  #
64
62
  # @faker.version 1.4.3
65
- def semantic_version(legacy_major = NOT_GIVEN, legacy_minor = NOT_GIVEN, legacy_patch = NOT_GIVEN, major: 0..9, minor: 0..9, patch: 1..9)
66
- warn_for_deprecated_arguments do |keywords|
67
- keywords << :major if legacy_major != NOT_GIVEN
68
- keywords << :minor if legacy_minor != NOT_GIVEN
69
- keywords << :patch if legacy_patch != NOT_GIVEN
70
- end
71
-
63
+ def semantic_version(major: 0..9, minor: 0..9, patch: 1..9)
72
64
  [major, minor, patch].map { |chunk| sample(Array(chunk)) }.join('.')
73
65
  end
74
- # rubocop:enable Metrics/ParameterLists
75
66
  end
76
67
  end
77
68
  end
@@ -6,8 +6,6 @@ module Faker
6
6
  # @private
7
7
  SUPPORTED_FORMATS = %w[png jpg bmp].freeze
8
8
 
9
- # rubocop:disable Metrics/ParameterLists
10
-
11
9
  ##
12
10
  # Produces a URL for an avatar from robohash.org
13
11
  #
@@ -38,15 +36,7 @@ module Faker
38
36
  # #=> "https://robohash.org/my-own-slug.bmp?size=50x50&set=set1&bgset=bg1"
39
37
  #
40
38
  # @faker.version 1.4.3
41
- def image(legacy_slug = NOT_GIVEN, legacy_size = NOT_GIVEN, legacy_format = NOT_GIVEN, legacy_set = NOT_GIVEN, legacy_bgset = NOT_GIVEN, slug: nil, size: '300x300', format: 'png', set: 'set1', bgset: nil)
42
- warn_for_deprecated_arguments do |keywords|
43
- keywords << :slug if legacy_slug != NOT_GIVEN
44
- keywords << :size if legacy_size != NOT_GIVEN
45
- keywords << :format if legacy_format != NOT_GIVEN
46
- keywords << :set if legacy_set != NOT_GIVEN
47
- keywords << :bgset if legacy_bgset != NOT_GIVEN
48
- end
49
-
39
+ def image(slug: nil, size: '300x300', format: 'png', set: 'set1', bgset: nil)
50
40
  raise ArgumentError, 'Size should be specified in format 300x300' unless size =~ /^[0-9]+x[0-9]+$/
51
41
  raise ArgumentError, "Supported formats are #{SUPPORTED_FORMATS.join(', ')}" unless SUPPORTED_FORMATS.include?(format)
52
42
 
@@ -54,7 +44,6 @@ module Faker
54
44
  bgset_query = "&bgset=#{bgset}" if bgset
55
45
  "https://robohash.org/#{slug}.#{format}?size=#{size}&set=#{set}#{bgset_query}"
56
46
  end
57
- # rubocop:enable Metrics/ParameterLists
58
47
  end
59
48
  end
60
49
  end
@@ -16,11 +16,7 @@ module Faker
16
16
  # Faker::Bank.account_number(digits: 13) #=> 673858237902
17
17
  #
18
18
  # @faker.version 1.9.1
19
- def account_number(legacy_digits = NOT_GIVEN, digits: 10)
20
- warn_for_deprecated_arguments do |keywords|
21
- keywords << :digits if legacy_digits != NOT_GIVEN
22
- end
23
-
19
+ def account_number(digits: 10)
24
20
  output = ''
25
21
 
26
22
  output += rand.to_s[2..] while output.length < digits
@@ -40,14 +36,10 @@ module Faker
40
36
  # Faker::Bank.iban(country_code: nil) #=> "DE45186738071857270067"
41
37
  #
42
38
  # @faker.version 1.7.0
43
- def iban(legacy_country_code = NOT_GIVEN, country_code: 'GB')
39
+ def iban(country_code: 'GB')
44
40
  # Each country has its own format for bank accounts
45
41
  # Many of them use letters in certain parts of the account
46
42
  # Using regex patterns we can create virtually any type of bank account
47
- warn_for_deprecated_arguments do |keywords|
48
- keywords << :country_code if legacy_country_code != NOT_GIVEN
49
- end
50
-
51
43
  country_code ||= iban_country_code
52
44
 
53
45
  begin
@@ -166,15 +158,15 @@ module Faker
166
158
  end
167
159
 
168
160
  # Calculates the mandatory checksum in 3rd and 4th characters in IBAN format
169
- # source: https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN
161
+ # source: https://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits
170
162
  def iban_checksum(country_code, account)
171
163
  # Converts letters to numbers according the iban rules, A=10..Z=35
172
164
  account_to_number = "#{account}#{country_code}00".upcase.chars.map do |d|
173
165
  d =~ /[A-Z]/ ? (d.ord - 55).to_s : d
174
166
  end.join.to_i
175
167
 
176
- # This is answer to (iban_to_num + checksum) % 97 == 1
177
- checksum = (1 - account_to_number) % 97
168
+ # This is the correct answer to (iban_to_num + checksum) % 97 == 1
169
+ checksum = 98 - (account_to_number % 97)
178
170
 
179
171
  # Use leftpad to make the size always to 2
180
172
  checksum.to_s.rjust(2, '0')
@@ -15,10 +15,7 @@ module Faker
15
15
  # Faker::Boolean.boolean(true_ratio: 0.2) #=> false
16
16
  #
17
17
  # @faker.version 1.6.2
18
- def boolean(legacy_true_ratio = NOT_GIVEN, true_ratio: 0.5)
19
- warn_for_deprecated_arguments do |keywords|
20
- keywords << :true_ratio if legacy_true_ratio != NOT_GIVEN
21
- end
18
+ def boolean(true_ratio: 0.5)
22
19
  (rand < true_ratio)
23
20
  end
24
21
  end
@@ -18,12 +18,7 @@ module Faker
18
18
  # Faker::ChileRut.rut(min_rut: 20890156, fixed: true) #=> 20890156
19
19
  #
20
20
  # @faker.version 1.9.2
21
- def rut(legacy_min_rut = NOT_GIVEN, legacy_fixed = NOT_GIVEN, min_rut: 1, fixed: false)
22
- warn_for_deprecated_arguments do |keywords|
23
- keywords << :min_rut if legacy_min_rut != NOT_GIVEN
24
- keywords << :fixed if legacy_fixed != NOT_GIVEN
25
- end
26
-
21
+ def rut(min_rut: 1, fixed: false)
27
22
  @last_rut = fixed ? min_rut : rand_in_range(min_rut, 99_999_999)
28
23
  end
29
24
 
@@ -83,12 +78,7 @@ module Faker
83
78
  # Faker::ChileRut.full_rut(min_rut: 30686957, fixed: true) #=> "30686957-4"
84
79
  #
85
80
  # @faker.version next
86
- def full_rut(legacy_min_rut = NOT_GIVEN, legacy_fixed = NOT_GIVEN, min_rut: 0, fixed: false, formatted: false)
87
- warn_for_deprecated_arguments do |keywords|
88
- keywords << :min_rut if legacy_min_rut != NOT_GIVEN
89
- keywords << :fixed if legacy_fixed != NOT_GIVEN
90
- end
91
-
81
+ def full_rut(min_rut: 0, fixed: false, formatted: false)
92
82
  if formatted
93
83
  "#{rut(min_rut: min_rut, fixed: fixed).to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1.').reverse}-#{dv}"
94
84
  else