faker 2.20.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 +184 -7
- data/History.md +1 -1
- data/README.md +15 -11
- data/lib/faker/blockchain/aeternity.rb +1 -1
- data/lib/faker/blockchain/ethereum.rb +1 -1
- data/lib/faker/blockchain/tezos.rb +1 -1
- 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/{faker_adjective.rb → adjective.rb} +0 -0
- 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 +9 -17
- data/lib/faker/default/boolean.rb +1 -4
- data/lib/faker/default/chile_rut.rb +8 -14
- data/lib/faker/default/code.rb +10 -23
- data/lib/faker/default/color.rb +77 -6
- data/lib/faker/default/commerce.rb +3 -17
- data/lib/faker/default/company.rb +6 -14
- 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 +5 -24
- data/lib/faker/default/fillmurray.rb +1 -10
- data/lib/faker/default/finance.rb +17 -7
- data/lib/faker/default/hipster.rb +6 -45
- data/lib/faker/default/id_number.rb +108 -11
- data/lib/faker/default/internet.rb +34 -71
- 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 +6 -11
- data/lib/faker/default/measurement.rb +8 -40
- data/lib/faker/default/name.rb +1 -5
- data/lib/faker/default/nhs.rb +2 -6
- 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 +21 -21
- data/lib/faker/default/vulnerability_identifier.rb +23 -0
- 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/japanese_media/kamen_rider.rb +2 -2
- data/lib/faker/japanese_media/one_piece.rb +1 -1
- data/lib/faker/movies/hackers.rb +48 -0
- data/lib/faker/movies/star_wars.rb +1 -5
- data/lib/faker/movies/tron.rb +161 -0
- data/lib/faker/sports/mountaineering.rb +22 -0
- data/lib/faker/sports/sport.rb +110 -0
- data/lib/faker/version.rb +1 -1
- data/lib/faker.rb +15 -63
- data/lib/helpers/base58.rb +1 -1
- data/lib/helpers/unique_generator.rb +13 -11
- data/lib/locales/en/australia.yml +3 -4
- data/lib/locales/en/computer.yml +23 -4
- data/lib/locales/en/dota.yml +113 -0
- data/lib/locales/en/file.yml +9 -1
- data/lib/locales/en/finance.yml +3 -1
- data/lib/locales/en/game.yml +0 -1
- data/lib/locales/en/hackers.yml +53 -0
- data/lib/locales/en/heroes.yml +2 -2
- data/lib/locales/en/internet.yml +29 -0
- data/lib/locales/en/mountaineering.yml +14 -0
- data/lib/locales/en/movie.yml +2 -1
- data/lib/locales/en/naruto.yml +2 -3
- data/lib/locales/en/one_piece.yml +1 -1
- 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 +130 -0
- data/lib/locales/en/tarkov.yml +593 -0
- data/lib/locales/en/tron.yml +227 -0
- data/lib/locales/en/vehicle.yml +2809 -75
- data/lib/locales/en-AU.yml +1 -1
- 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/adjective.yml +266 -0
- data/lib/locales/fr/ancient.yml +141 -0
- data/lib/locales/hy.yml +1 -1
- data/lib/locales/ja/adjective.yml +148 -0
- data/lib/locales/ja/dog.yml +1 -0
- data/lib/locales/ja/emotion.yml +51 -0
- data/lib/locales/ja/naruto.yml +230 -0
- data/lib/locales/ja/relationship.yml +10 -0
- data/lib/locales/pl.yml +1 -1
- data/lib/locales/th.yml +76 -76
- metadata +65 -25
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,4 +1,181 @@
|
|
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
|
+
------------------------------------------------------------------------------
|
51
|
+
|
52
|
+
## [v2.23.0](https://github.com/faker-ruby/faker/tree/v2.23.0) (2022-09-01)
|
53
|
+
|
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`
|
81
|
+
|
82
|
+
------------------------------------------------------------------------------
|
83
|
+
|
84
|
+
## [v2.22.0](https://github.com/faker-ruby/faker/tree/v2.22.0) (2022-07-28)
|
85
|
+
|
86
|
+
## Bug/Fixes
|
87
|
+
|
88
|
+
- [PR #2500](https://github.com/faker-ruby/faker/pull/2500) Fix: Duplicate array before concatenating [@mattr](https://github.com/mattr)
|
89
|
+
- [PR #2488](https://github.com/faker-ruby/faker/pull/2488) Fixed random selection issue [@sudeeptarlekar](https://github.com/sudeeptarlekar)
|
90
|
+
- [PR #2475](https://github.com/faker-ruby/faker/pull/2475) Update regex used for Faker::Vehicle#vin [@erayalkis](https://github.com/erayalkis)
|
91
|
+
|
92
|
+
## Chores
|
93
|
+
|
94
|
+
- [PR #2513](https://github.com/faker-ruby/faker/pull/2513) Remove broken docs [@vbrazo](https://github.com/vbrazo)
|
95
|
+
- [PR #2502](https://github.com/faker-ruby/faker/pull/2502) Update actions/checkout version in GitHub actions [@jdufresne](https://github.com/jdufresne)
|
96
|
+
- [PR #2501](https://github.com/faker-ruby/faker/pull/2501) Make ReadMe more consise [@jenniferdewan](https://github.com/jenniferdewan)
|
97
|
+
- [PR #2489](https://github.com/faker-ruby/faker/pull/2489) Change a filename to follow naming conventions [@yasuhiron777](https://github.com/yasuhiron777)
|
98
|
+
|
99
|
+
## Feature Request
|
100
|
+
|
101
|
+
- [PR #2477](https://github.com/faker-ruby/faker/pull/2477) feat: add bot_user_agent method for generate web crawle's user agents [@a-chacon](https://github.com/a-chacon)
|
102
|
+
- [PR #2465](https://github.com/faker-ruby/faker/pull/2465) Add a new sports section for mountaineers [@LeviLong01](https://github.com/LeviLong01)
|
103
|
+
|
104
|
+
## Update locales
|
105
|
+
|
106
|
+
- [PR #2509](https://github.com/faker-ruby/faker/pull/2509) Add all Dota 2 heroes [@JCFarrow](https://github.com/JCFarrow)
|
107
|
+
- [PR #2507](https://github.com/faker-ruby/faker/pull/2507) Update dog.yml [@Kedaruma-Bond](https://github.com/Kedaruma-Bond)
|
108
|
+
- [PR #2503](https://github.com/faker-ruby/faker/pull/2503) Update pl.yml [@marek-witkowski](https://github.com/marek-witkowski)
|
109
|
+
- [PR #2499](https://github.com/faker-ruby/faker/pull/2499) Fix: Use pattern to define Australian cell phone formats [@mattr](https://github.com/mattr)
|
110
|
+
- [PR #2497](https://github.com/faker-ruby/faker/pull/2497) Fix typos in Australia [@mattr](https://github.com/mattr)
|
111
|
+
- [PR #2490](https://github.com/faker-ruby/faker/pull/2490) Added Japanese adjective translations [@yasuhiron777](https://github.com/yasuhiron777)
|
112
|
+
|
113
|
+
------------------------------------------------------------------------------
|
114
|
+
|
115
|
+
## [v2.21.0](https://github.com/faker-ruby/faker/tree/v2.21.0) (2022-05-12)
|
116
|
+
|
117
|
+
## Bug/Fixes
|
118
|
+
|
119
|
+
- [PR #2443](https://github.com/faker-ruby/faker/pull/2443) Fixed error for random in markdown [@sudeeptarlekar](https://github.com/sudeeptarlekar)
|
120
|
+
|
121
|
+
## Feature Request
|
122
|
+
|
123
|
+
- [PR #2252](https://github.com/faker-ruby/faker/pull/2252) Add Faker::Movies::Tron [@craineum](https://github.com/craineum)
|
124
|
+
|
125
|
+
## Update locales
|
126
|
+
- [PR #2485](https://github.com/faker-ruby/faker/pull/2485) Add japanese translations for emotion [@kenboo0426](https://github.com/kenboo0426)
|
127
|
+
- [PR #2479](https://github.com/faker-ruby/faker/pull/2479) Add japanese translations for naruto [@johnmanjiro13](https://github.com/johnmanjiro13)
|
128
|
+
- [PR #2478](https://github.com/faker-ruby/faker/pull/2478) Add Japanese translation for relationships [@shouichi](https://github.com/shouichi)
|
129
|
+
- [PR #2469](https://github.com/faker-ruby/faker/pull/2467) Fix blank row in game.yml [@KingYoSun](https://github.com/KingYoSun)
|
130
|
+
- [PR #2467](https://github.com/faker-ruby/faker/pull/2467) French traduction of adjectives [@Beygs](https://github.com/Beygs)
|
131
|
+
|
132
|
+
## Update local dependencies
|
133
|
+
|
134
|
+
- Update rubocop to `1.26.0`
|
135
|
+
- Update timecop to `0.95.0`
|
136
|
+
|
137
|
+
------------------------------------------------------------------------------
|
138
|
+
|
139
|
+
## [v2.20.0](https://github.com/faker-ruby/faker/tree/v2.20.0) (2022-03-05)
|
140
|
+
|
141
|
+
## Documentation
|
142
|
+
|
143
|
+
- [PR #2421](https://github.com/faker-ruby/faker/pull/2421) Add general documentation for Faker::Camera [@aleksandrilyin](https://github.com/aleksandrilyin)
|
144
|
+
|
145
|
+
|
146
|
+
## Feature Request
|
147
|
+
|
148
|
+
- [PR #2457](https://github.com/faker-ruby/faker/pull/2457) add Command & Conquer games [@Awilum](https://github.com/Awilum)
|
149
|
+
- [PR #2456](https://github.com/faker-ruby/faker/pull/2456) fix heading for faker hobby doc [@Awilum](https://github.com/Awilum)
|
150
|
+
- [PR #2411](https://github.com/faker-ruby/faker/pull/2411) Add mock data for Auth0 OAuth [@Norio4](https://github.com/Norio4)
|
151
|
+
- [PR #2396](https://github.com/faker-ruby/faker/pull/2396) Add Brooklyn Nine Nine into tv shows category [@fralps](https://github.com/fralps)
|
152
|
+
- [PR #2395](https://github.com/faker-ruby/faker/pull/2395) Add The Kingkiller Chronicle [@fblupi](https://github.com/fblupi)
|
153
|
+
- [PR #2392](https://github.com/faker-ruby/faker/pull/2392) Update LV locale - cell phone numbers should be 8 symbols [@tmikoss](https://github.com/tmikoss)
|
154
|
+
- [PR #2383](https://github.com/faker-ruby/faker/pull/2383) Add Faker::JapaneseMedia::KamenRider#transformation_device [@boardfish](https://github.com/boardfish)
|
155
|
+
- [PR #2382](https://github.com/faker-ruby/faker/pull/2382) Add collectible devices [@boardfish](https://github.com/boardfish)
|
156
|
+
- [PR #2378](https://github.com/faker-ruby/faker/pull/2378) Re-add the Faker::Internet.base64 method [@ashishra0](https://github.com/ashishra0)
|
157
|
+
- [PR #2374](https://github.com/faker-ruby/faker/pull/2374) Add Faker::JapaneseMedia::KamenRider [@boardfish](https://github.com/boardfish)
|
158
|
+
- [PR #1656](https://github.com/faker-ruby/faker/pull/1656) Add bible entries [@enowbi](https://github.com/enowbi)
|
159
|
+
|
160
|
+
## Update locales
|
161
|
+
|
162
|
+
- [PR #2462](https://github.com/faker-ruby/faker/pull/2462) Add Sora and Hollow Bastion to SuperSmashBros yml files [@gazayas](https://github.com/gazayas)
|
163
|
+
- [PR #2458](https://github.com/faker-ruby/faker/pull/2458) Fix typo on Tom Jobim's name [@andrerferrer](https://github.com/andrerferrer)
|
164
|
+
- [PR #2452](https://github.com/faker-ruby/faker/pull/2452) updated Timor-Leste in en/addresses.yml [@masukomi](https://github.com/masukomi)
|
165
|
+
- [PR #2450](https://github.com/faker-ruby/faker/pull/2450) dividing male and female Arabic names [@Alfulayt](https://github.com/Alfulayt)
|
166
|
+
- [PR #2381](https://github.com/faker-ruby/faker/pull/2381) Remove duplicates and clean up Faker::JapaneseMedia::KamenRider [@boardfish](https://github.com/boardfish)
|
167
|
+
- [PR #2405](https://github.com/faker-ruby/faker/pull/2405) Add countries in Japanese [@lawriecate](https://github.com/lawriecate)
|
168
|
+
- [PR #2403](https://github.com/faker-ruby/faker/pull/2403) add Faker::Animal in pt-BR [@thiago-henrique-leite](https://github.com/thiago-henrique-leite)
|
169
|
+
- [PR #2377](https://github.com/faker-ruby/faker/pull/2377) Fix non striped coffe blender [@ngouy](https://github.com/ngouy)
|
170
|
+
|
171
|
+
## Update local dependencies
|
172
|
+
|
173
|
+
- Update rubocop to `1.25.0`
|
174
|
+
- Update rake to `13.0.6`
|
175
|
+
- Update test-unit to `3.5.3`
|
176
|
+
- Update yard to `0.9.27`
|
177
|
+
|
178
|
+
------------------------------------------------------------------------------
|
2
179
|
|
3
180
|
## [v2.19.0](https://github.com/faker-ruby/faker/tree/v2.19.0) (2021-08-22)
|
4
181
|
|
@@ -303,7 +480,7 @@ This version:
|
|
303
480
|
## Bug/Fixes
|
304
481
|
|
305
482
|
- [PR #2050](https://github.com/faker-ruby/faker/pull/2050) Fix random error in music tests [@martinjaimem](https://github.com/martinjaimem)
|
306
|
-
- [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)
|
307
484
|
- [PR #2026](https://github.com/faker-ruby/faker/pull/2026) Sanitize email when name has special characters [@Zeragamba](https://github.com/Zeragamba)
|
308
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)
|
309
486
|
|
@@ -1044,7 +1221,7 @@ Version 2 has several `breaking changes`. We replaced positional arguments with
|
|
1044
1221
|
- `Faker::Types.rb_integer(from = nil, to = nil)` becomes `Faker::Types.rb_integer(from: nil, to: nil)`
|
1045
1222
|
- `Faker::Types.rb_string(words = nil)` becomes `Faker::Types.rb_string(words: nil)`
|
1046
1223
|
- `Faker::Vehicle.kilometrage(min = nil, max = nil)` becomes `Faker::Vehicle.kilometrage(min: nil, max: nil)`
|
1047
|
-
- `Faker::Vehicle.license_plate(
|
1224
|
+
- `Faker::Vehicle.license_plate(state_abbreviation = nil)` becomes `Faker::Vehicle.license_plate(state_abbreviation: nil)`
|
1048
1225
|
- `Faker::Vehicle.mileage(min = nil, max = nil)` becomes `Faker::Vehicle.mileage(min: nil, max: nil)`
|
1049
1226
|
- `Faker::Vehicle.model(make_of_model = nil)` becomes `Faker::Vehicle.model(make_of_model: nil)`
|
1050
1227
|
- `Faker::WorldCup.group(group = nil)` becomes `Faker::WorldCup.group(group: nil)`
|
@@ -1153,7 +1330,7 @@ Fix lib/faker/version.rb
|
|
1153
1330
|
|
1154
1331
|
### Update/add locales
|
1155
1332
|
|
1156
|
-
- [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)
|
1157
1334
|
- [PR #1627](https://github.com/stympy/faker/pull/1627) add more data for Faker::Games [@BlazingRockStorm](https://github.com/BlazingRockStorm)
|
1158
1335
|
- [PR #1620](https://github.com/stympy/faker/pull/1620) Added Yuumi as a Champion [@eddorre](https://github.com/eddorre)
|
1159
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)
|
@@ -1416,7 +1593,7 @@ Fix lib/faker/version.rb
|
|
1416
1593
|
- [PR #1220](https://github.com/stympy/faker/pull/1220) Updates for Faker::Myst [@SpyMaster356](https://github.com/SpyMaster356)
|
1417
1594
|
- [PR #1218](https://github.com/stympy/faker/pull/1218) Add Faker::Myst [@SpyMaster356](https://github.com/SpyMaster356)
|
1418
1595
|
- [PR #818](https://github.com/stympy/faker/pull/818) LoremFlickr support [@mrstebo](https://github.com/mrstebo)
|
1419
|
-
- [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)
|
1420
1597
|
- [PR #1211](https://github.com/stympy/faker/pull/1211) Add bands, genres, and albums to Music [@jmkoni](https://github.com/jmkoni)
|
1421
1598
|
- [PR #1215](https://github.com/stympy/faker/pull/1215) Added Nato Phonetic Alphabet [@timcustard](https://github.com/timcustard)
|
1422
1599
|
- [PR #1209](https://github.com/stympy/faker/pull/1209) Add Faker::Source [@graciano](https://github.com/graciano)
|
@@ -1536,7 +1713,7 @@ Fix lib/faker/version.rb
|
|
1536
1713
|
|
1537
1714
|
**Other changes**
|
1538
1715
|
|
1539
|
-
- Changed i18n
|
1716
|
+
- Changed i18n dependency from `~> 0.9.1` to `>= 0.7`
|
1540
1717
|
|
1541
1718
|
## [v1.8.5](https://github.com/stympy/faker/tree/v1.8.5) (2017-12-06)
|
1542
1719
|
[Full Changelog](https://github.com/stympy/faker/compare/v1.8.4...v1.8.5)
|
@@ -2032,7 +2209,7 @@ Fix lib/faker/version.rb
|
|
2032
2209
|
* Added bork locale for bork-ified lorem [johnbentcope]
|
2033
2210
|
* Added IPv6 address generator [jc00ke]
|
2034
2211
|
* Removed deprecation warnings for Array#rand [chrismarshall]
|
2035
|
-
* Added German translation and I18n
|
2212
|
+
* Added German translation and I18n improvements [Matthias Kühnert]
|
2036
2213
|
* Added Dutch translation [moretea]
|
2037
2214
|
* Added Lat/Long generator [Andy Callaghan]
|
2038
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,10 +3,9 @@
|
|
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
|
-
[![SemVer compatibility](https://api.dependabot.com/badges/compatibility_score?dependency-name=faker&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=faker&package-manager=bundler&version-scheme=semver)
|
10
9
|
|
11
10
|
This gem is a port of [Perl's Data::Faker library](https://metacpan.org/pod/Data::Faker) that generates fake data.
|
12
11
|
|
@@ -45,7 +44,9 @@ development.
|
|
45
44
|
* While Faker generates data at random, returned values are not guaranteed to be unique by default.
|
46
45
|
You must explicitly specify when you require unique values, see [details](#ensuring-unique-values).
|
47
46
|
Values also can be deterministic if you use the deterministic feature, see [details](#deterministic-random)
|
48
|
-
*
|
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.
|
49
50
|
Please refer the README of your version for the available methods.
|
50
51
|
List of all versions is [available here](https://github.com/stympy/faker/releases).
|
51
52
|
|
@@ -56,7 +57,7 @@ gem install faker
|
|
56
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:
|
57
58
|
|
58
59
|
```ruby
|
59
|
-
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => '
|
60
|
+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
60
61
|
```
|
61
62
|
|
62
63
|
## Usage
|
@@ -118,7 +119,7 @@ Faker::Company.bs #=> "cultivate viral synergies"
|
|
118
119
|
**NOTE: Some of the generators below aren't released yet. If you want to use them, change the line in your gemfile to:**
|
119
120
|
|
120
121
|
```ruby
|
121
|
-
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => '
|
122
|
+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
|
122
123
|
```
|
123
124
|
|
124
125
|
### Default
|
@@ -218,6 +219,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
218
219
|
- [Faker::University](doc/default/university.md)
|
219
220
|
- [Faker::Vehicle](doc/default/vehicle.md)
|
220
221
|
- [Faker::Verbs](doc/default/verbs.md)
|
222
|
+
- [Faker::VulnerabilityIdentifier](doc/default/vulnerability_identifier.md)
|
221
223
|
- [Faker::WorldCup](doc/default/world_cup.md)
|
222
224
|
|
223
225
|
### Blockchain
|
@@ -291,6 +293,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
291
293
|
- [Faker::Movies::LordOfTheRings](doc/movies/lord_of_the_rings.md)
|
292
294
|
- [Faker::Movies::PrincessBride](doc/movies/princess_bride.md)
|
293
295
|
- [Faker::Movies::StarWars](doc/movies/star_wars.md)
|
296
|
+
- [Faker::Movies::TRON](doc/movies/tron.md)
|
294
297
|
- [Faker::Movies::VForVendetta](doc/movies/v_for_vendetta.md)
|
295
298
|
|
296
299
|
### Music
|
@@ -313,8 +316,11 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
313
316
|
|
314
317
|
|
315
318
|
### Sports
|
319
|
+
- [Faker::Sports](doc/sports/sports.md)
|
316
320
|
- [Faker::Sports::Basketball](doc/sports/basketball.md)
|
317
321
|
- [Faker::Sports::Football](doc/sports/football.md)
|
322
|
+
- [Faker::Sports::Mountaineering](doc/sports/mountaineering.md)
|
323
|
+
- [Faker::Sports::Volleyball](doc/sports/volleyball.md)
|
318
324
|
|
319
325
|
### Tv Shows
|
320
326
|
- [Faker::TvShows::AquaTeenHungerForce](doc/tv_shows/aqua_teen_hunger_force.md)
|
@@ -354,11 +360,9 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
|
|
354
360
|
- [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md)
|
355
361
|
|
356
362
|
## Customization
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
formats (US postal codes are NNNNN while UK postal codes are AAN NAA),
|
361
|
-
allowing you to get different formats by switching locales.
|
363
|
+
You may want Faker to print information depending on your location in the world.
|
364
|
+
To assist you in this, Faker uses I18n gem to store strings and formats to
|
365
|
+
represent the names and postal codes of the area of your choosing.
|
362
366
|
Just set the locale you want as shown below, and Faker will take care of the rest.
|
363
367
|
|
364
368
|
```ruby
|
@@ -401,7 +405,7 @@ en-au-ocker:
|
|
401
405
|
```
|
402
406
|
|
403
407
|
## Contributing
|
404
|
-
See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/
|
408
|
+
See [CONTRIBUTING.md](https://github.com/stympy/faker/blob/main/CONTRIBUTING.md).
|
405
409
|
|
406
410
|
## Contact
|
407
411
|
Comments and feedback are welcome. Send an email to Benjamin Curtis via the [google group](http://groups.google.com/group/ruby-faker).
|
@@ -61,7 +61,7 @@ module Faker
|
|
61
61
|
def rand_strings(length = 50)
|
62
62
|
hex_alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
63
63
|
var = +''
|
64
|
-
length.times { var << sample(shuffle(hex_alphabet.
|
64
|
+
length.times { var << sample(shuffle(hex_alphabet.chars)) }
|
65
65
|
var
|
66
66
|
end
|
67
67
|
end
|
@@ -125,7 +125,7 @@ module Faker
|
|
125
125
|
# @return [String]
|
126
126
|
def encode_tz(prefix, payload_size)
|
127
127
|
prefix = PREFIXES.fetch(prefix)
|
128
|
-
packed = prefix.map(&:chr).join
|
128
|
+
packed = prefix.map(&:chr).join + Faker::Config.random.bytes(payload_size)
|
129
129
|
checksum = OpenSSL::Digest::SHA256.digest(OpenSSL::Digest::SHA256.digest(packed))[0..3]
|
130
130
|
Faker::Base58.encode(packed + checksum)
|
131
131
|
end
|
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
|
|
File without changes
|
@@ -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
|