faker 2.23.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +83 -29
- data/History.md +1 -1
- data/README.md +10 -5
- data/lib/faker/books/dune.rb +2 -10
- data/lib/faker/books/lovecraft.rb +7 -38
- data/lib/faker/default/address.rb +5 -25
- data/lib/faker/default/alphanumeric.rb +2 -8
- data/lib/faker/default/app.rb +1 -10
- data/lib/faker/default/avatar.rb +1 -12
- data/lib/faker/default/bank.rb +5 -13
- data/lib/faker/default/boolean.rb +1 -4
- data/lib/faker/default/chile_rut.rb +2 -12
- data/lib/faker/default/code.rb +3 -16
- data/lib/faker/default/color.rb +77 -6
- data/lib/faker/default/commerce.rb +3 -17
- data/lib/faker/default/company.rb +2 -10
- data/lib/faker/default/crypto_coin.rb +3 -15
- data/lib/faker/default/date.rb +5 -38
- data/lib/faker/default/demographic.rb +1 -5
- data/lib/faker/default/driving_licence.rb +1 -11
- data/lib/faker/default/file.rb +2 -21
- data/lib/faker/default/fillmurray.rb +1 -10
- data/lib/faker/default/finance.rb +1 -5
- data/lib/faker/default/hipster.rb +6 -45
- data/lib/faker/default/id_number.rb +2 -10
- data/lib/faker/default/internet.rb +11 -69
- data/lib/faker/default/invoice.rb +3 -16
- data/lib/faker/default/json.rb +2 -20
- data/lib/faker/default/lorem.rb +9 -66
- data/lib/faker/default/lorem_flickr.rb +4 -32
- data/lib/faker/default/lorem_pixel.rb +4 -10
- data/lib/faker/default/markdown.rb +1 -6
- data/lib/faker/default/measurement.rb +8 -40
- data/lib/faker/default/name.rb +1 -5
- data/lib/faker/default/nhs.rb +1 -5
- data/lib/faker/default/number.rb +10 -55
- data/lib/faker/default/omniauth.rb +5 -39
- data/lib/faker/default/phone_number.rb +1 -5
- data/lib/faker/default/placeholdit.rb +1 -12
- data/lib/faker/default/relationship.rb +1 -5
- data/lib/faker/default/source.rb +3 -16
- data/lib/faker/default/string.rb +1 -5
- data/lib/faker/default/stripe.rb +4 -20
- data/lib/faker/default/time.rb +4 -32
- data/lib/faker/default/twitter.rb +3 -17
- data/lib/faker/default/types.rb +5 -27
- data/lib/faker/default/vehicle.rb +4 -17
- data/lib/faker/default/world_cup.rb +2 -11
- data/lib/faker/games/dota.rb +1 -5
- data/lib/faker/games/tarkov.rb +205 -0
- data/lib/faker/movies/hackers.rb +48 -0
- data/lib/faker/movies/star_wars.rb +1 -5
- data/lib/faker/version.rb +1 -1
- data/lib/faker.rb +0 -53
- data/lib/locales/en/hackers.yml +53 -0
- data/lib/locales/en/heroes.yml +2 -2
- data/lib/locales/en/opera.yml +1 -1
- data/lib/locales/en/overwatch.yml +5 -7
- data/lib/locales/en/source.yml +5 -0
- data/lib/locales/en/sport.yml +17 -8
- data/lib/locales/en/tarkov.yml +593 -0
- data/lib/locales/en-CA.yml +1 -0
- data/lib/locales/es-AR.yml +2 -2
- data/lib/locales/fi-FI.yml +2 -1
- data/lib/locales/fr/ancient.yml +141 -0
- data/lib/locales/hy.yml +1 -1
- data/lib/locales/th.yml +76 -76
- metadata +44 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a9b68cfd73d84ab10a3382407a6675395cdb07fa17113b99b84390fef9a4fb5
|
4
|
+
data.tar.gz: 12fbdbeb4cbb3409954520b90a9fdfe871ad08db697cf8477b2b236e1810297e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b5d764aa8f24a5e95efe003aac284070d918f326e511dee2e88a34e3ff94d703720056be7e408730aee439cc0be5d26e8c657b3922fce218ce01f75375489e
|
7
|
+
data.tar.gz: 705a4e403466b231ff18223bf8904387eb3f8aabbe7544826375c5f332b64b362ac174b2b5b8c00de2a8dfc0aacf63a66ab708ea876dd78d92ee61a27bc9c9aa
|
data/CHANGELOG.md
CHANGED
@@ -1,29 +1,83 @@
|
|
1
|
-
#
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
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(
|
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
|
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
|
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
|
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
|
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
|
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=
|
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
|
-
*
|
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 => '
|
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 => '
|
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/
|
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).
|
data/lib/faker/books/dune.rb
CHANGED
@@ -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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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?
|
data/lib/faker/default/app.rb
CHANGED
@@ -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(
|
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
|
data/lib/faker/default/avatar.rb
CHANGED
@@ -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(
|
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
|
data/lib/faker/default/bank.rb
CHANGED
@@ -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(
|
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(
|
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#
|
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 =
|
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(
|
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(
|
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(
|
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
|