ffaker 2.20.0 → 2.25.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 +163 -17
- data/Gemfile +15 -0
- data/README.md +19 -7
- data/REFERENCE.md +1479 -1395
- data/Rakefile +16 -47
- data/bin/console +9 -0
- data/ffaker.gemspec +9 -23
- data/lib/ffaker/address.rb +5 -5
- data/lib/ffaker/address_br.rb +14 -2
- data/lib/ffaker/address_fr.rb +3 -5
- data/lib/ffaker/address_it.rb +1 -5
- data/lib/ffaker/address_ua.rb +1 -1
- data/lib/ffaker/animal_br.rb +12 -0
- data/lib/ffaker/avatar.rb +11 -3
- data/lib/ffaker/bank.rb +13 -1
- data/lib/ffaker/bank_us.rb +37 -0
- data/lib/ffaker/book.rb +15 -7
- data/lib/ffaker/boolean.rb +4 -0
- data/lib/ffaker/cheesy_lingo.rb +2 -2
- data/lib/ffaker/code.rb +1 -1
- data/lib/ffaker/company.rb +5 -8
- data/lib/ffaker/company_fr.rb +2 -2
- data/lib/ffaker/crypto.rb +14 -0
- data/lib/ffaker/data/address_br/complement +3 -0
- data/lib/ffaker/data/address_br/neighborhood_prefixes +3 -0
- data/lib/ffaker/data/address_de/state +1 -0
- data/lib/ffaker/data/animal_br/common_names +423 -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/data/job_tw/job_nouns +201 -0
- data/lib/ffaker/data/lorem_tw/words +789 -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/guid.rb +7 -1
- data/lib/ffaker/html_ipsum.rb +7 -1
- 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_fi.rb +73 -0
- data/lib/ffaker/identification_kr.rb +11 -4
- data/lib/ffaker/identification_mx.rb +1 -1
- data/lib/ffaker/identification_pl.rb +6 -6
- data/lib/ffaker/identification_tw.rb +4 -3
- data/lib/ffaker/image.rb +28 -4
- data/lib/ffaker/jo_jo.rb +24 -0
- data/lib/ffaker/job_tw.rb +12 -0
- data/lib/ffaker/lorem_ja.rb +1 -1
- data/lib/ffaker/lorem_ru.rb +1 -1
- data/lib/ffaker/lorem_tw.rb +40 -0
- data/lib/ffaker/movie.rb +1 -1
- data/lib/ffaker/name_fr.rb +4 -3
- data/lib/ffaker/name_pl.rb +3 -3
- 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 +7 -7
- data/lib/ffaker/time.rb +4 -4
- data/lib/ffaker/tweet.rb +1 -1
- data/lib/ffaker/utils/module_utils.rb +10 -20
- data/lib/ffaker/utils/unique_utils.rb +34 -21
- data/lib/ffaker/uuid.rb +175 -0
- data/lib/ffaker/vehicle.rb +63 -1
- data/lib/{version.rb → ffaker/version.rb} +1 -1
- data/lib/ffaker.rb +64 -190
- data/scripts/reference.rb +21 -21
- data/test/helper.rb +7 -9
- data/test/test_address_br.rb +15 -2
- 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_address_ua.rb +1 -1
- data/test/test_animal_br.rb +17 -0
- data/test/test_array_utils.rb +1 -1
- data/test/test_avatar.rb +30 -7
- data/test/test_bank.rb +15 -1
- data/test/test_bank_us.rb +37 -0
- data/test/test_book.rb +29 -0
- data/test/test_boolean.rb +32 -1
- 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_guid.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 +6 -0
- 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_fi.rb +39 -0
- 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_job_tw.rb +21 -0
- data/test/test_lorem_br.rb +3 -3
- 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_tw.rb +54 -0
- data/test/test_lorem_ua.rb +3 -3
- data/test/test_module_utils.rb +42 -0
- data/test/test_music.rb +4 -4
- 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 +14 -2
- 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_ssn_se.rb +1 -1
- 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_uuid.rb +73 -0
- data/test/test_vehicle.rb +27 -1
- metadata +41 -245
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3f9654a58ede677b3fb5953188b4c4c3dbddae88d2efb645afce0ddf9e6f548
|
4
|
+
data.tar.gz: 666b18e3d964b7caa9b7db582b1fb4c4965eda1e9542aaf34bb5d15583bc8d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a94ca7b3c77c52cd80423729d743c501379d2257fa6e191a2a8f9af5291f48a0deebcc9fc2589a2bbc6cabaebf8a9a9406b3dad69f64dafb219bffee263614a
|
7
|
+
data.tar.gz: a26f1111b465b8d35d87985457b03ef38d2a76282c8962f5b6a4e749ba33465a945f6dcbd040397dc2aadc43807f7ec70bfc21985465ecad28c770210be0f814
|
data/Changelog.md
CHANGED
@@ -2,6 +2,54 @@
|
|
2
2
|
|
3
3
|
- Add your change HERE
|
4
4
|
|
5
|
+
## 2.25.0
|
6
|
+
- Generator for Finnish identity numbers [@zHarrowed]
|
7
|
+
- Fix typos and add Codespell GitHub action [@kianmeng]
|
8
|
+
- Add FFaker::Boolean.boolean with true ratio [@nedzib]
|
9
|
+
- Add LoremTW and JobTW [@cookiepingyen]
|
10
|
+
- Add loan tools to bank [@hulous]
|
11
|
+
|
12
|
+
## 2.24.0
|
13
|
+
- *BREAKING CHANGE*: Drop support under ruby 3.0 [@marocchino]
|
14
|
+
- Add ruby 3.4 to CI [@marocchino]
|
15
|
+
- Add ruby 3.3 to CI [@boimw]
|
16
|
+
- Fix Luhn algorithm used in french companie's SIRET and sweden SSN [@Krap]
|
17
|
+
- Add `FFaker::UUID` `.uuidv4`, `.uuidv6`, `.uuidv7`, and `.uuidv8` [@stilist]
|
18
|
+
- Deprecate `FFaker::Guid.guid` in favor of `FFaker::UUID` methods [@stilist]
|
19
|
+
- Limit FFaker::BankUS.routing_number first two digits [@professor]
|
20
|
+
|
21
|
+
## 2.23.0
|
22
|
+
- Add FFaker::BankUS.accounting_number [@professor]
|
23
|
+
- Add FFaker::BankUS.routing_number [@professor]
|
24
|
+
- Resolve a lot of RuboCop offenses [@AlexWayfer]
|
25
|
+
- Change `Image.url`, `Image.file`, `Book.cover` and `Avatar.image` arguments to keywords [@AlexWayfer]
|
26
|
+
- Adds FFaker::Date.birthday [@professor]
|
27
|
+
- Adds FFaker::Crypto.sha256 [@professor]
|
28
|
+
- Update README [@professor]
|
29
|
+
- Adds FFaker::Number.between [@professor]
|
30
|
+
- Fixed `FFaker::Number.unique.number(digits: 1)` under Ruby 3 [@simonhildebrandt]
|
31
|
+
|
32
|
+
## 2.22.0
|
33
|
+
- *BREAKING CHANGE*: Drop support under ruby 2.7 [@marocchino]
|
34
|
+
- Correct Vehicle::VIN result [@philippevezina]
|
35
|
+
- Improve performance unique [@iiwo]
|
36
|
+
- Drop gemspec generation in rake [@technicalpickles]
|
37
|
+
- Add identification EC [@josieljunior]
|
38
|
+
- Update data for AddressDE [@slowjack2k]
|
39
|
+
- Add ruby 3.2 to CI [@petergoldstein]
|
40
|
+
- Add JoJo module [@ar2em1s]
|
41
|
+
- Fix crash in FFaker::Time#datetime when defining FFaker::Date module [@brupla6126]
|
42
|
+
|
43
|
+
## 2.21.0
|
44
|
+
- Generate valid VINs [@xunker]
|
45
|
+
- Add neighborhood and address complement to AddressBR [@az3vedo]
|
46
|
+
- Ensure FFaker::HTMLIpsum.fancy_string return includes at least one tag [@gabrielcosta42]
|
47
|
+
- Fix IdentificationTW area code [@timfanda35]
|
48
|
+
- Add Ruby 3.1 to CI matrix [@petergoldstein]
|
49
|
+
- Add AnimalBr [@thiago-henrique-leite]
|
50
|
+
- Fix rubocop warnings [@mmrshk]
|
51
|
+
- Consistently generate REFERENCE.md [@technicalpickles] and [@Volosh1n]
|
52
|
+
|
5
53
|
## 2.20.0
|
6
54
|
- Remove date from gem specification [@AlexWayfer]
|
7
55
|
- Add Number module [@Volosh1n]
|
@@ -23,7 +71,7 @@
|
|
23
71
|
- Test with Github actions & Ruby 3 [@marocchino]
|
24
72
|
- Generate reference by CI [@marocchino]
|
25
73
|
- Change the regex to cover all scenarios in lorem_fr [@abnersajr]
|
26
|
-
- Add "Freedom Ipsum" text generator option [@hmaack and @lynnd335]
|
74
|
+
- Add "Freedom Ipsum" text generator option [@hmaack] and [@lynnd335]
|
27
75
|
- Fix issues with `FFaker::Image` module [@hmaack]
|
28
76
|
- Fix typo in animal.rb module [@renius]
|
29
77
|
|
@@ -186,21 +234,6 @@
|
|
186
234
|
- many internal library and test suite refactorings
|
187
235
|
|
188
236
|
|
189
|
-
[#181]: https://github.com/ffaker/ffaker/issues/181
|
190
|
-
[#191]: https://github.com/ffaker/ffaker/issues/191
|
191
|
-
[#193]: https://github.com/ffaker/ffaker/issues/193
|
192
|
-
[#195]: https://github.com/ffaker/ffaker/issues/195
|
193
|
-
[#196]: https://github.com/ffaker/ffaker/issues/196
|
194
|
-
[#199]: https://github.com/ffaker/ffaker/issues/199
|
195
|
-
[#200]: https://github.com/ffaker/ffaker/issues/200
|
196
|
-
[#203]: https://github.com/ffaker/ffaker/issues/203
|
197
|
-
[#211]: https://github.com/ffaker/ffaker/pull/211
|
198
|
-
[#212]: https://github.com/ffaker/ffaker/pull/212
|
199
|
-
[#213]: https://github.com/ffaker/ffaker/pull/213
|
200
|
-
[@marocchino]: https://github.com/marocchino
|
201
|
-
[@rstacruz]: https://github.com/rstacruz
|
202
|
-
[@anderscarling]: https://github.com/anderscarling
|
203
|
-
|
204
237
|
|
205
238
|
## 2.0.0
|
206
239
|
- switched faker to ffaker namespace, you should now be able to use
|
@@ -380,7 +413,7 @@ Api additions by Rafael Souza
|
|
380
413
|
|
381
414
|
## 0.3.2 2010-01-14
|
382
415
|
|
383
|
-
* Several Optimizations, renamed gem
|
416
|
+
* Several Optimizations, renamed gem package to ffaker.
|
384
417
|
|
385
418
|
## 0.3.1 2008-04-03
|
386
419
|
|
@@ -410,3 +443,116 @@ Api additions by Rafael Souza
|
|
410
443
|
## 0.1.0 2007-11-22
|
411
444
|
|
412
445
|
* Initial release
|
446
|
+
|
447
|
+
[#181]: https://github.com/ffaker/ffaker/issues/181
|
448
|
+
[#191]: https://github.com/ffaker/ffaker/issues/191
|
449
|
+
[#193]: https://github.com/ffaker/ffaker/issues/193
|
450
|
+
[#195]: https://github.com/ffaker/ffaker/issues/195
|
451
|
+
[#196]: https://github.com/ffaker/ffaker/issues/196
|
452
|
+
[#199]: https://github.com/ffaker/ffaker/issues/199
|
453
|
+
[#200]: https://github.com/ffaker/ffaker/issues/200
|
454
|
+
[#203]: https://github.com/ffaker/ffaker/issues/203
|
455
|
+
[#211]: https://github.com/ffaker/ffaker/pull/211
|
456
|
+
[#212]: https://github.com/ffaker/ffaker/pull/212
|
457
|
+
[#213]: https://github.com/ffaker/ffaker/pull/213
|
458
|
+
[@44uk]: https://github.com/44uk
|
459
|
+
[@AlexAvlonitis]: https://github.com/AlexAvlonitis
|
460
|
+
[@AlexWayfer]: https://github.com/AlexWayfer
|
461
|
+
[@CarlosMouraJR]: https://github.com/CarlosMouraJR
|
462
|
+
[@GuillaumeOcculy]: https://github.com/GuillaumeOcculy
|
463
|
+
[@IgorMarques]: https://github.com/IgorMarques
|
464
|
+
[@Krap]: https://github.com/Krap
|
465
|
+
[@Kutomore]: https://github.com/Kutomore
|
466
|
+
[@MQuy]: https://github.com/MQuy
|
467
|
+
[@Moafak]: https://github.com/Moafak
|
468
|
+
[@Phanithism]: https://github.com/Phanithism
|
469
|
+
[@Sephyros]: https://github.com/Sephyros
|
470
|
+
[@SteveRedka]: https://github.com/SteveRedka
|
471
|
+
[@Volosh1n]: https://github.com/Volosh1n
|
472
|
+
[@YutaGoto]: https://github.com/YutaGoto
|
473
|
+
[@aaronsama]: https://github.com/aaronsama
|
474
|
+
[@abnersajr]: https://github.com/abnersajr
|
475
|
+
[@adimircolen]: https://github.com/adimircolen
|
476
|
+
[@alagu]: https://github.com/alagu
|
477
|
+
[@alibby]: https://github.com/alibby
|
478
|
+
[@anderscarling]: https://github.com/anderscarling
|
479
|
+
[@andyklimczak]: https://github.com/andyklimczak
|
480
|
+
[@ar2em1s]: https://github.com/ar2em1s
|
481
|
+
[@artplan1]: https://github.com/artplan1
|
482
|
+
[@az3vedo]: https://github.com/az3vedo
|
483
|
+
[@boimw]: https://github.com/boimw
|
484
|
+
[@brain64bit]: https://github.com/brain64bit
|
485
|
+
[@brnrdog]: https://github.com/brnrdog
|
486
|
+
[@brupla6126]: https://github.com/brupla6126
|
487
|
+
[@ckyOL]: https://github.com/ckyOL
|
488
|
+
[@cookiepingyen]: https://github.com/cookiepingyen
|
489
|
+
[@danderozier]: https://github.com/danderozier
|
490
|
+
[@dankimio]: https://github.com/dankimio
|
491
|
+
[@delucas]: https://github.com/delucas
|
492
|
+
[@dimroc]: https://github.com/dimroc
|
493
|
+
[@dphurley]: https://github.com/dphurley
|
494
|
+
[@eikes]: https://github.com/eikes
|
495
|
+
[@falegk]: https://github.com/falegk
|
496
|
+
[@firedev]: https://github.com/firedev
|
497
|
+
[@gabrielcosta42]: https://github.com/gabrielcosta42
|
498
|
+
[@gerard76]: https://github.com/gerard76
|
499
|
+
[@gruz0]: https://github.com/gruz0
|
500
|
+
[@hmaack]: https://github.com/hmaack
|
501
|
+
[@hulous]: https://github.com/hulous
|
502
|
+
[@iamarmanjon]: https://github.com/iamarmanjon
|
503
|
+
[@iiwo]: https://github.com/iiwo
|
504
|
+
[@j0al]: https://github.com/j0al
|
505
|
+
[@jakubm]: https://github.com/jakubm
|
506
|
+
[@jasonleonhard]: https://github.com/jasonleonhard
|
507
|
+
[@joshdvir]: https://github.com/joshdvir
|
508
|
+
[@josieljunior]: https://github.com/josieljunior
|
509
|
+
[@jvanbaarsen]: https://github.com/jvanbaarsen
|
510
|
+
[@kianmeng]: https://github.com/kianmeng
|
511
|
+
[@kmayer]: https://github.com/kmayer
|
512
|
+
[@kojino]: https://github.com/kojino
|
513
|
+
[@ktroutner]: https://github.com/ktroutner
|
514
|
+
[@lilsweetcaligula]: https://github.com/lilsweetcaligula
|
515
|
+
[@lynnd335]: https://github.com/lynnd335
|
516
|
+
[@makketagg]: https://github.com/makketagg
|
517
|
+
[@marocchino]: https://github.com/marocchino
|
518
|
+
[@max-si-m]: https://github.com/max-si-m
|
519
|
+
[@mechos3d]: https://github.com/mechos3d
|
520
|
+
[@metalelf0]: https://github.com/metalelf0
|
521
|
+
[@miscelatore]: https://github.com/miscelatore
|
522
|
+
[@mklemme]: https://github.com/mklemme
|
523
|
+
[@mmrshk]: https://github.com/mmrshk
|
524
|
+
[@nav16]: https://github.com/nav16
|
525
|
+
[@ni3t]: https://github.com/ni3t
|
526
|
+
[@nicholaskillin]: https://github.com/nicholaskillin
|
527
|
+
[@nicolas-brousse]: https://github.com/nicolas-brousse
|
528
|
+
[@nigelgomesot]: https://github.com/nigelgomesot
|
529
|
+
[@pawelma]: https://github.com/pawelma
|
530
|
+
[@petergoldstein]: https://github.com/petergoldstein
|
531
|
+
[@philippevezina]: https://github.com/philippevezina
|
532
|
+
[@pominx]: https://github.com/pominx
|
533
|
+
[@professor]: https://github.com/professor
|
534
|
+
[@renius]: https://github.com/renius
|
535
|
+
[@rgcamus]: https://github.com/rgcamus
|
536
|
+
[@robin]: https://github.com/robin
|
537
|
+
[@rocknruby]: https://github.com/rocknruby
|
538
|
+
[@rstacruz]: https://github.com/rstacruz
|
539
|
+
[@rvisuvasam]: https://github.com/rvisuvasam
|
540
|
+
[@simonhildebrandt]: https://github.com/simonhildebrandt
|
541
|
+
[@slowjack2k]: https://github.com/slowjack2k
|
542
|
+
[@spheric]: https://github.com/spheric
|
543
|
+
[@steverovsky]: https://github.com/steverovsky
|
544
|
+
[@stilist]: https://github.com/stilist
|
545
|
+
[@tatey]: https://github.com/tatey
|
546
|
+
[@technicalpickles]: https://github.com/technicalpickles
|
547
|
+
[@thiago-henrique-leite]: https://github.com/thiago-henrique-leite
|
548
|
+
[@thilonel]: https://github.com/thilonel
|
549
|
+
[@thutterer]: https://github.com/thutterer
|
550
|
+
[@timfanda35]: https://github.com/timfanda35
|
551
|
+
[@tvarley]: https://github.com/tvarley
|
552
|
+
[@ulzr]: https://github.com/ulzr
|
553
|
+
[@vinhnglx]: https://github.com/vinhnglx
|
554
|
+
[@waldyr]: https://github.com/waldyr
|
555
|
+
[@walerian777]: https://github.com/walerian777
|
556
|
+
[@xunker]: https://github.com/xunker
|
557
|
+
[@zHarrowed]: https://github.com/zHarrowed
|
558
|
+
|
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
@@ -65,7 +65,7 @@ If you want to add new modules or localization data, use one of the
|
|
65
65
|
(or create a new one!).
|
66
66
|
|
67
67
|
**const_missing** is
|
68
|
-
[
|
68
|
+
[overridden](https://github.com/ffaker/ffaker/blob/main/lib/ffaker/utils/module_utils.rb#L9)
|
69
69
|
for Faker modules, so if you try to use a constant that is not defined
|
70
70
|
in the module, the
|
71
71
|
[override](https://github.com/ffaker/ffaker/blob/main/lib/ffaker/utils/module_utils.rb#L9)
|
@@ -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.
|