ffaker 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +131 -17
- data/Gemfile +15 -0
- data/README.md +18 -6
- data/REFERENCE.md +1012 -969
- data/Rakefile +16 -47
- data/bin/console +9 -0
- data/ffaker.gemspec +9 -23
- data/lib/ffaker/address.rb +4 -4
- data/lib/ffaker/address_fr.rb +3 -5
- data/lib/ffaker/address_it.rb +1 -4
- data/lib/ffaker/address_ua.rb +1 -1
- data/lib/ffaker/avatar.rb +11 -3
- data/lib/ffaker/bank.rb +1 -1
- data/lib/ffaker/bank_us.rb +33 -0
- data/lib/ffaker/book.rb +15 -7
- data/lib/ffaker/cheesy_lingo.rb +2 -2
- data/lib/ffaker/code.rb +1 -1
- data/lib/ffaker/company.rb +2 -2
- data/lib/ffaker/company_fr.rb +2 -2
- data/lib/ffaker/crypto.rb +14 -0
- data/lib/ffaker/data/address_de/state +1 -0
- data/lib/ffaker/data/jo_jo/first_names +356 -0
- data/lib/ffaker/data/jo_jo/full_names +225 -0
- data/lib/ffaker/data/jo_jo/last_names +153 -0
- data/lib/ffaker/data/jo_jo/stands +149 -0
- data/lib/ffaker/date.rb +40 -0
- data/lib/ffaker/filesystem.rb +12 -2
- data/lib/ffaker/geolocation.rb +2 -2
- data/lib/ffaker/identification_br.rb +3 -12
- data/lib/ffaker/identification_ec.rb +39 -0
- data/lib/ffaker/identification_es_cl.rb +2 -2
- data/lib/ffaker/identification_es_co.rb +1 -1
- data/lib/ffaker/identification_kr.rb +11 -4
- data/lib/ffaker/identification_pl.rb +6 -6
- data/lib/ffaker/identification_tw.rb +1 -1
- data/lib/ffaker/image.rb +28 -4
- data/lib/ffaker/jo_jo.rb +24 -0
- data/lib/ffaker/lorem_ja.rb +1 -1
- data/lib/ffaker/lorem_ru.rb +1 -1
- data/lib/ffaker/movie.rb +1 -1
- data/lib/ffaker/name_fr.rb +4 -3
- data/lib/ffaker/name_pl.rb +1 -1
- data/lib/ffaker/number.rb +6 -2
- data/lib/ffaker/phone_number_de.rb +3 -3
- data/lib/ffaker/skill.rb +1 -1
- data/lib/ffaker/ssn.rb +4 -2
- data/lib/ffaker/ssn_se.rb +2 -2
- data/lib/ffaker/string.rb +1 -1
- data/lib/ffaker/time.rb +3 -3
- data/lib/ffaker/utils/module_utils.rb +5 -6
- data/lib/ffaker/utils/unique_utils.rb +33 -21
- data/lib/ffaker/vehicle.rb +2 -2
- data/lib/{version.rb → ffaker/version.rb} +1 -1
- data/lib/ffaker.rb +63 -191
- data/scripts/reference.rb +8 -10
- data/test/helper.rb +3 -5
- data/test/test_address_da.rb +3 -3
- data/test/test_address_fi.rb +2 -2
- data/test/test_address_se.rb +2 -2
- data/test/test_avatar.rb +30 -7
- data/test/test_bank_us.rb +35 -0
- data/test/test_book.rb +29 -0
- data/test/test_cheesy_lingo.rb +1 -1
- data/test/test_color.rb +3 -3
- data/test/test_crypto.rb +15 -0
- data/test/test_date.rb +47 -0
- data/test/test_filesystem.rb +30 -4
- data/test/test_freedom_ipsum.rb +1 -1
- data/test/test_gender_it.rb +1 -1
- data/test/test_gender_ja.rb +1 -1
- data/test/test_gender_jp.rb +1 -1
- data/test/test_gender_pl.rb +1 -1
- data/test/test_healthcare_ru.rb +1 -1
- data/test/test_hipster_ipsum.rb +1 -1
- data/test/test_html_ipsum.rb +2 -2
- data/test/test_identification.rb +12 -2
- data/test/test_identification_ec.rb +33 -0
- data/test/test_identification_es_mx.rb +3 -1
- data/test/test_identification_it.rb +12 -1
- data/test/test_identification_kr.rb +3 -3
- data/test/test_image.rb +51 -5
- data/test/test_internet.rb +3 -1
- data/test/test_internet_se.rb +5 -2
- data/test/test_jo_jo.rb +29 -0
- data/test/test_lorem_br.rb +2 -2
- data/test/test_lorem_cn.rb +3 -3
- data/test/test_lorem_fr.rb +3 -3
- data/test/test_lorem_ie.rb +2 -2
- data/test/test_lorem_kr.rb +3 -3
- data/test/test_lorem_pl.rb +2 -2
- data/test/test_lorem_ru.rb +3 -3
- data/test/test_lorem_ua.rb +3 -3
- data/test/test_module_utils.rb +33 -0
- data/test/test_name_da.rb +1 -1
- data/test/test_name_ph.rb +1 -1
- data/test/test_name_ru.rb +2 -2
- data/test/test_name_ua.rb +2 -2
- data/test/test_number.rb +13 -1
- data/test/test_phone_number_nl.rb +1 -1
- data/test/test_phone_number_se.rb +1 -1
- data/test/test_phone_number_sg.rb +8 -8
- data/test/test_unique_utils.rb +29 -5
- data/test/test_units.rb +6 -6
- data/test/test_units_english.rb +15 -15
- data/test/test_units_metric.rb +15 -15
- data/test/test_vehicle.rb +22 -0
- metadata +24 -241
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f45921dd1eae37420883610af8fa98376812b220f8bb19d15ad418eeeaf3926b
|
4
|
+
data.tar.gz: 3a05c27b2457b4920993430a334534a0b41f2b92d4b5b5f99de8ab8ba4b69ca2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba901db425ebad3cf7755b83ff07f81da266d63ae3370448ed473653fcdbad7b12585c5e6c2675be8f14db49e00b68fad19ceb30ea7af0147b817c02184ce1d6
|
7
|
+
data.tar.gz: de56b8153970b889b4a56ebec2662ef8a7eff9378a69fe4164c3cd2393f02e71b7ddcc0c396bcdd94978d6a4d2e67ce3bf65c7fcce3c6626e5733c493b24ba0a
|
data/Changelog.md
CHANGED
@@ -2,6 +2,28 @@
|
|
2
2
|
|
3
3
|
- Add your change HERE
|
4
4
|
|
5
|
+
# 2.23.0
|
6
|
+
- Add FFaker::BankUS.accounting_number [@professor]
|
7
|
+
- Add FFaker::BankUS.routing_number [@professor]
|
8
|
+
- Resolve a lot of RuboCop offenses [@AlexWayfer]
|
9
|
+
- Change `Image.url`, `Image.file`, `Book.cover` and `Avatar.image` arguments to keywords [@AlexWayfer]
|
10
|
+
- Adds FFaker::Date.birthday [@professor]
|
11
|
+
- Adds FFaker::Crypto.sha256 [@professor]
|
12
|
+
- Update README [@professor]
|
13
|
+
- Adds FFaker::Number.between [@professor]
|
14
|
+
- Fixed `FFaker::Number.unique.number(digits: 1)` under Ruby 3 [@simonhildebrandt]
|
15
|
+
|
16
|
+
# 2.22.0
|
17
|
+
- *BREAKING CHANGE*: Drop support under ruby 2.7 [@marocchino]
|
18
|
+
- Correct Vehicle::VIN result [@philippevezina]
|
19
|
+
- Improve performance unique [@iiwo]
|
20
|
+
- Drop gemspec generation in rake [@technicalpickles]
|
21
|
+
- Add identification EC [@josieljunior]
|
22
|
+
- Update data for AddressDE [@slowjack2k]
|
23
|
+
- Add ruby 3.2 to CI [@petergoldstein]
|
24
|
+
- Add JoJo module [@ar2em1s]
|
25
|
+
- Fix crash in FFaker::Time#datetime when defining FFaker::Date module [@brupla6126]
|
26
|
+
|
5
27
|
## 2.21.0
|
6
28
|
- Generate valid VINs [@xunker]
|
7
29
|
- Add neighborhood and address complement to AddressBR [@az3vedo]
|
@@ -10,7 +32,7 @@
|
|
10
32
|
- Add Ruby 3.1 to CI matrix [@petergoldstein]
|
11
33
|
- Add AnimalBr [@thiago-henrique-leite]
|
12
34
|
- Fix rubocop warnings [@mmrshk]
|
13
|
-
- Consistently generate REFERENCE.md [@technicalpickles and @Volosh1n]
|
35
|
+
- Consistently generate REFERENCE.md [@technicalpickles] and [@Volosh1n]
|
14
36
|
|
15
37
|
## 2.20.0
|
16
38
|
- Remove date from gem specification [@AlexWayfer]
|
@@ -33,7 +55,7 @@
|
|
33
55
|
- Test with Github actions & Ruby 3 [@marocchino]
|
34
56
|
- Generate reference by CI [@marocchino]
|
35
57
|
- Change the regex to cover all scenarios in lorem_fr [@abnersajr]
|
36
|
-
- Add "Freedom Ipsum" text generator option [@hmaack and @lynnd335]
|
58
|
+
- Add "Freedom Ipsum" text generator option [@hmaack] and [@lynnd335]
|
37
59
|
- Fix issues with `FFaker::Image` module [@hmaack]
|
38
60
|
- Fix typo in animal.rb module [@renius]
|
39
61
|
|
@@ -196,21 +218,6 @@
|
|
196
218
|
- many internal library and test suite refactorings
|
197
219
|
|
198
220
|
|
199
|
-
[#181]: https://github.com/ffaker/ffaker/issues/181
|
200
|
-
[#191]: https://github.com/ffaker/ffaker/issues/191
|
201
|
-
[#193]: https://github.com/ffaker/ffaker/issues/193
|
202
|
-
[#195]: https://github.com/ffaker/ffaker/issues/195
|
203
|
-
[#196]: https://github.com/ffaker/ffaker/issues/196
|
204
|
-
[#199]: https://github.com/ffaker/ffaker/issues/199
|
205
|
-
[#200]: https://github.com/ffaker/ffaker/issues/200
|
206
|
-
[#203]: https://github.com/ffaker/ffaker/issues/203
|
207
|
-
[#211]: https://github.com/ffaker/ffaker/pull/211
|
208
|
-
[#212]: https://github.com/ffaker/ffaker/pull/212
|
209
|
-
[#213]: https://github.com/ffaker/ffaker/pull/213
|
210
|
-
[@marocchino]: https://github.com/marocchino
|
211
|
-
[@rstacruz]: https://github.com/rstacruz
|
212
|
-
[@anderscarling]: https://github.com/anderscarling
|
213
|
-
|
214
221
|
|
215
222
|
## 2.0.0
|
216
223
|
- switched faker to ffaker namespace, you should now be able to use
|
@@ -420,3 +427,110 @@ Api additions by Rafael Souza
|
|
420
427
|
## 0.1.0 2007-11-22
|
421
428
|
|
422
429
|
* Initial release
|
430
|
+
|
431
|
+
[#181]: https://github.com/ffaker/ffaker/issues/181
|
432
|
+
[#191]: https://github.com/ffaker/ffaker/issues/191
|
433
|
+
[#193]: https://github.com/ffaker/ffaker/issues/193
|
434
|
+
[#195]: https://github.com/ffaker/ffaker/issues/195
|
435
|
+
[#196]: https://github.com/ffaker/ffaker/issues/196
|
436
|
+
[#199]: https://github.com/ffaker/ffaker/issues/199
|
437
|
+
[#200]: https://github.com/ffaker/ffaker/issues/200
|
438
|
+
[#203]: https://github.com/ffaker/ffaker/issues/203
|
439
|
+
[#211]: https://github.com/ffaker/ffaker/pull/211
|
440
|
+
[#212]: https://github.com/ffaker/ffaker/pull/212
|
441
|
+
[#213]: https://github.com/ffaker/ffaker/pull/213
|
442
|
+
[@44uk]: https://github.com/44uk
|
443
|
+
[@AlexAvlonitis]: https://github.com/AlexAvlonitis
|
444
|
+
[@AlexWayfer]: https://github.com/AlexWayfer
|
445
|
+
[@CarlosMouraJR]: https://github.com/CarlosMouraJR
|
446
|
+
[@GuillaumeOcculy]: https://github.com/GuillaumeOcculy
|
447
|
+
[@IgorMarques]: https://github.com/IgorMarques
|
448
|
+
[@Kutomore]: https://github.com/Kutomore
|
449
|
+
[@MQuy]: https://github.com/MQuy
|
450
|
+
[@Moafak]: https://github.com/Moafak
|
451
|
+
[@Phanithism]: https://github.com/Phanithism
|
452
|
+
[@Sephyros]: https://github.com/Sephyros
|
453
|
+
[@SteveRedka]: https://github.com/SteveRedka
|
454
|
+
[@Volosh1n]: https://github.com/Volosh1n
|
455
|
+
[@YutaGoto]: https://github.com/YutaGoto
|
456
|
+
[@aaronsama]: https://github.com/aaronsama
|
457
|
+
[@abnersajr]: https://github.com/abnersajr
|
458
|
+
[@adimircolen]: https://github.com/adimircolen
|
459
|
+
[@alagu]: https://github.com/alagu
|
460
|
+
[@alibby]: https://github.com/alibby
|
461
|
+
[@anderscarling]: https://github.com/anderscarling
|
462
|
+
[@andyklimczak]: https://github.com/andyklimczak
|
463
|
+
[@ar2em1s]: https://github.com/ar2em1s
|
464
|
+
[@artplan1]: https://github.com/artplan1
|
465
|
+
[@az3vedo]: https://github.com/az3vedo
|
466
|
+
[@brain64bit]: https://github.com/brain64bit
|
467
|
+
[@brnrdog]: https://github.com/brnrdog
|
468
|
+
[@brupla6126]: https://github.com/brupla6126
|
469
|
+
[@ckyOL]: https://github.com/ckyOL
|
470
|
+
[@danderozier]: https://github.com/danderozier
|
471
|
+
[@dankimio]: https://github.com/dankimio
|
472
|
+
[@delucas]: https://github.com/delucas
|
473
|
+
[@dimroc]: https://github.com/dimroc
|
474
|
+
[@dphurley]: https://github.com/dphurley
|
475
|
+
[@eikes]: https://github.com/eikes
|
476
|
+
[@falegk]: https://github.com/falegk
|
477
|
+
[@firedev]: https://github.com/firedev
|
478
|
+
[@gabrielcosta42]: https://github.com/gabrielcosta42
|
479
|
+
[@gerard76]: https://github.com/gerard76
|
480
|
+
[@gruz0]: https://github.com/gruz0
|
481
|
+
[@hmaack]: https://github.com/hmaack
|
482
|
+
[@hulous]: https://github.com/hulous
|
483
|
+
[@iamarmanjon]: https://github.com/iamarmanjon
|
484
|
+
[@iiwo]: https://github.com/iiwo
|
485
|
+
[@j0al]: https://github.com/j0al
|
486
|
+
[@jakubm]: https://github.com/jakubm
|
487
|
+
[@jasonleonhard]: https://github.com/jasonleonhard
|
488
|
+
[@joshdvir]: https://github.com/joshdvir
|
489
|
+
[@josieljunior]: https://github.com/josieljunior
|
490
|
+
[@jvanbaarsen]: https://github.com/jvanbaarsen
|
491
|
+
[@kmayer]: https://github.com/kmayer
|
492
|
+
[@kojino]: https://github.com/kojino
|
493
|
+
[@ktroutner]: https://github.com/ktroutner
|
494
|
+
[@lilsweetcaligula]: https://github.com/lilsweetcaligula
|
495
|
+
[@lynnd335]: https://github.com/lynnd335
|
496
|
+
[@makketagg]: https://github.com/makketagg
|
497
|
+
[@marocchino]: https://github.com/marocchino
|
498
|
+
[@max-si-m]: https://github.com/max-si-m
|
499
|
+
[@mechos3d]: https://github.com/mechos3d
|
500
|
+
[@metalelf0]: https://github.com/metalelf0
|
501
|
+
[@miscelatore]: https://github.com/miscelatore
|
502
|
+
[@mklemme]: https://github.com/mklemme
|
503
|
+
[@mmrshk]: https://github.com/mmrshk
|
504
|
+
[@nav16]: https://github.com/nav16
|
505
|
+
[@ni3t]: https://github.com/ni3t
|
506
|
+
[@nicholaskillin]: https://github.com/nicholaskillin
|
507
|
+
[@nicolas-brousse]: https://github.com/nicolas-brousse
|
508
|
+
[@nigelgomesot]: https://github.com/nigelgomesot
|
509
|
+
[@pawelma]: https://github.com/pawelma
|
510
|
+
[@petergoldstein]: https://github.com/petergoldstein
|
511
|
+
[@philippevezina]: https://github.com/philippevezina
|
512
|
+
[@pominx]: https://github.com/pominx
|
513
|
+
[@professor]: https://github.com/professor
|
514
|
+
[@renius]: https://github.com/renius
|
515
|
+
[@rgcamus]: https://github.com/rgcamus
|
516
|
+
[@robin]: https://github.com/robin
|
517
|
+
[@rocknruby]: https://github.com/rocknruby
|
518
|
+
[@rstacruz]: https://github.com/rstacruz
|
519
|
+
[@rvisuvasam]: https://github.com/rvisuvasam
|
520
|
+
[@simonhildebrandt]: https://github.com/simonhildebrandt
|
521
|
+
[@slowjack2k]: https://github.com/slowjack2k
|
522
|
+
[@spheric]: https://github.com/spheric
|
523
|
+
[@steverovsky]: https://github.com/steverovsky
|
524
|
+
[@stilist]: https://github.com/stilist
|
525
|
+
[@tatey]: https://github.com/tatey
|
526
|
+
[@technicalpickles]: https://github.com/technicalpickles
|
527
|
+
[@thiago-henrique-leite]: https://github.com/thiago-henrique-leite
|
528
|
+
[@thilonel]: https://github.com/thilonel
|
529
|
+
[@thutterer]: https://github.com/thutterer
|
530
|
+
[@timfanda35]: https://github.com/timfanda35
|
531
|
+
[@tvarley]: https://github.com/tvarley
|
532
|
+
[@ulzr]: https://github.com/ulzr
|
533
|
+
[@vinhnglx]: https://github.com/vinhnglx
|
534
|
+
[@waldyr]: https://github.com/waldyr
|
535
|
+
[@walerian777]: https://github.com/walerian777
|
536
|
+
[@xunker]: https://github.com/xunker
|
data/Gemfile
CHANGED
@@ -1,4 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
source 'https://rubygems.org'
|
4
|
+
|
4
5
|
gemspec
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem 'rake', '~> 13.0'
|
9
|
+
end
|
10
|
+
|
11
|
+
group :development, :lint do
|
12
|
+
gem 'rubocop'
|
13
|
+
gem 'rubocop-performance'
|
14
|
+
gem 'rubocop-rake'
|
15
|
+
end
|
16
|
+
|
17
|
+
group :development, :test do
|
18
|
+
gem 'test-unit'
|
19
|
+
end
|
data/README.md
CHANGED
@@ -77,12 +77,23 @@ name will be set with data from `ffaker/data/name/first_names`.
|
|
77
77
|
|
78
78
|
To get repeatable results in Minitest or Rspec, follow [these instructions](RANDOM.md#using-the-same-random-seed-as-your-tests).
|
79
79
|
|
80
|
-
## Unique
|
80
|
+
## Unique values
|
81
81
|
|
82
|
-
You can
|
82
|
+
You can ensure unique values are generated using the `unique` method. `ffaker` will retry the generation
|
83
|
+
until an unique value if found.
|
83
84
|
|
84
|
-
|
85
|
-
|
85
|
+
Example:
|
86
|
+
```ruby
|
87
|
+
FFaker::Name.unique.name # ensures an unique value is returned for FFaker::Name
|
88
|
+
```
|
89
|
+
|
90
|
+
If an unique value cannot be generated within a maximum limit of retries for a generator
|
91
|
+
a `FFaker::UniqueUtils::RetryLimitExceeded` error will be raised.
|
92
|
+
|
93
|
+
You can prevent exceeding the limit by clearing the record of used values (e.g. between tests):
|
94
|
+
```ruby
|
95
|
+
FFaker::Name.unique.clear # clears the used values for FFaker::Name
|
96
|
+
FFaker::UniqueUtils.clear # clears the used values for all generators
|
86
97
|
```
|
87
98
|
|
88
99
|
## TODO
|
@@ -94,8 +105,9 @@ FFaker::Name.unique.name
|
|
94
105
|
|
95
106
|
* Fork the project.
|
96
107
|
* Make your feature addition or bug fix.
|
97
|
-
* Add tests for it. This is important so I don't break it in a
|
98
|
-
|
108
|
+
* Add tests for it. This is important so I don't break it in a future version unintentionally.
|
109
|
+
* To run all the tests: `rake test`
|
110
|
+
* To run a single test: `rake test TEST=test/test_lorem_br.rb`
|
99
111
|
* Commit, do not mess with rakefile, version, or history.
|
100
112
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
101
113
|
* Send me a pull request. Bonus points for topic branches.
|