ffaker 2.21.0 → 2.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +11 -0
  3. data/README.md +15 -4
  4. data/REFERENCE.md +316 -290
  5. data/Rakefile +9 -40
  6. data/bin/console +9 -0
  7. data/ffaker.gemspec +9 -19
  8. data/lib/ffaker/address_ua.rb +1 -1
  9. data/lib/ffaker/book.rb +5 -5
  10. data/lib/ffaker/code.rb +1 -1
  11. data/lib/ffaker/company.rb +1 -1
  12. data/lib/ffaker/company_fr.rb +1 -1
  13. data/lib/ffaker/data/address_de/state +1 -0
  14. data/lib/ffaker/data/jo_jo/first_names +356 -0
  15. data/lib/ffaker/data/jo_jo/full_names +225 -0
  16. data/lib/ffaker/data/jo_jo/last_names +153 -0
  17. data/lib/ffaker/data/jo_jo/stands +149 -0
  18. data/lib/ffaker/date.rb +31 -0
  19. data/lib/ffaker/geolocation.rb +2 -2
  20. data/lib/ffaker/identification_br.rb +1 -1
  21. data/lib/ffaker/identification_ec.rb +39 -0
  22. data/lib/ffaker/identification_es_cl.rb +2 -2
  23. data/lib/ffaker/identification_es_co.rb +1 -1
  24. data/lib/ffaker/identification_kr.rb +3 -3
  25. data/lib/ffaker/identification_pl.rb +4 -4
  26. data/lib/ffaker/identification_tw.rb +1 -1
  27. data/lib/ffaker/jo_jo.rb +24 -0
  28. data/lib/ffaker/name_pl.rb +1 -1
  29. data/lib/ffaker/number.rb +2 -2
  30. data/lib/ffaker/ssn_se.rb +2 -2
  31. data/lib/ffaker/string.rb +1 -1
  32. data/lib/ffaker/time.rb +3 -3
  33. data/lib/ffaker/utils/module_utils.rb +4 -5
  34. data/lib/ffaker/utils/unique_utils.rb +29 -21
  35. data/lib/ffaker/vehicle.rb +2 -2
  36. data/lib/{version.rb → ffaker/version.rb} +1 -1
  37. data/lib/ffaker.rb +7 -4
  38. data/test/helper.rb +2 -4
  39. data/test/test_address_da.rb +3 -3
  40. data/test/test_address_fi.rb +2 -2
  41. data/test/test_address_se.rb +2 -2
  42. data/test/test_cheesy_lingo.rb +1 -1
  43. data/test/test_color.rb +3 -3
  44. data/test/test_date.rb +37 -0
  45. data/test/test_filesystem.rb +3 -3
  46. data/test/test_freedom_ipsum.rb +1 -1
  47. data/test/test_gender_it.rb +1 -1
  48. data/test/test_gender_ja.rb +1 -1
  49. data/test/test_gender_jp.rb +1 -1
  50. data/test/test_gender_pl.rb +1 -1
  51. data/test/test_healthcare_ru.rb +1 -1
  52. data/test/test_hipster_ipsum.rb +1 -1
  53. data/test/test_html_ipsum.rb +2 -2
  54. data/test/test_identification_ec.rb +33 -0
  55. data/test/test_identification_es_mx.rb +1 -1
  56. data/test/test_internet_se.rb +2 -1
  57. data/test/test_jo_jo.rb +29 -0
  58. data/test/test_lorem_br.rb +1 -1
  59. data/test/test_lorem_cn.rb +3 -3
  60. data/test/test_lorem_fr.rb +3 -3
  61. data/test/test_lorem_ie.rb +2 -2
  62. data/test/test_lorem_kr.rb +3 -3
  63. data/test/test_lorem_pl.rb +2 -2
  64. data/test/test_lorem_ru.rb +3 -3
  65. data/test/test_lorem_ua.rb +3 -3
  66. data/test/test_module_utils.rb +33 -0
  67. data/test/test_name_da.rb +1 -1
  68. data/test/test_name_ph.rb +1 -1
  69. data/test/test_name_ru.rb +2 -2
  70. data/test/test_name_ua.rb +2 -2
  71. data/test/test_phone_number_se.rb +1 -1
  72. data/test/test_phone_number_sg.rb +8 -8
  73. data/test/test_unique_utils.rb +25 -5
  74. data/test/test_vehicle.rb +22 -0
  75. metadata +19 -198
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c192ca9da2eae4b0b7cde440c26750a269de60ff3b07dcd5c73ef3fcc11afb1b
4
- data.tar.gz: a8ff030a5c7141b36fdc15c1842a13b1fca40b07f5c2883e7f53bdd83a471dd0
3
+ metadata.gz: 69babe3a9f0990b8b651d7e65f4f5732fe6c6962db3ea1da4fb86844bdaaf03d
4
+ data.tar.gz: 1674cbeb87e1090fd2690ba9c7474b98bb12332ceef6f3810e9f31ffad72191b
5
5
  SHA512:
6
- metadata.gz: 8a32d059e758d8bdd370cefb0e445e03db4f46bb2a0faf19b2754d3dc0faf7cbb3dabab69c3e89253fc3e09600b453c1f56ed87efd730515de53768524603372
7
- data.tar.gz: 795d9c1c1c3bf9f3f38007a771463c6a46290f11445755c30ce0b712c903a729d4bf2b3048a70f5118abe12075dfbc3a1a65a3b6443056768d8bad0b95655aa4
6
+ metadata.gz: bdf2002a82d25612594f949fec41b148f1761071a8416e9b391efedb0f6b9d01a0180b0932bb2fad5016474f3316e7697712e1a030d6466577d916ee47812293
7
+ data.tar.gz: f2e9d9990797621b093250daeb851267b3146cf6933fe0e82fc21cda6f18ca0144483bdea78ec10c150bea4752d877f5ab6166cac6a085d89652203518f11ea4
data/Changelog.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  - Add your change HERE
4
4
 
5
+ # 2.22.0
6
+ - *BREAKING CHANGE*: Drop support under ruby 2.7 [@marocchino]
7
+ - Correct Vehicle::VIN result [@philippevezina]
8
+ - Improve performance unique [@iiwo]
9
+ - Drop gemspec generation in rake [@technicalpickles]
10
+ - Add identification EC [@josieljunior]
11
+ - Update data for AddressDE [@slowjack2k]
12
+ - Add ruby 3.2 to CI [@petergoldstein]
13
+ - Add JoJo module [@ar2em1s]
14
+ - Fix crash in FFaker::Time#datetime when defining FFaker::Date module [@brupla6126]
15
+
5
16
  ## 2.21.0
6
17
  - Generate valid VINs [@xunker]
7
18
  - Add neighborhood and address complement to AddressBR [@az3vedo]
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 results
80
+ ## Unique values
81
81
 
82
- You can get unique value from any methods in FFaker like this:
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
- ```rb
85
- FFaker::Name.unique.name
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