faker 3.2.2 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +141 -0
  3. data/README.md +11 -5
  4. data/lib/faker/default/id_number.rb +23 -20
  5. data/lib/faker/default/internet.rb +1 -39
  6. data/lib/faker/default/json.rb +2 -2
  7. data/lib/faker/default/phone_number.rb +37 -18
  8. data/lib/faker/default/south_africa.rb +3 -3
  9. data/lib/faker/japanese_media/fullmetal_alchemist_brotherhood.rb +13 -10
  10. data/lib/faker/locations/australia.rb +43 -38
  11. data/lib/faker/movies/{room.rb → the_room.rb} +4 -4
  12. data/lib/faker/version.rb +1 -1
  13. data/lib/helpers/deprecator.rb +30 -0
  14. data/lib/locales/bg.yml +0 -1
  15. data/lib/locales/da-DK.yml +529 -37
  16. data/lib/locales/de-AT.yml +3487 -26
  17. data/lib/locales/de-CH.yml +51 -59
  18. data/lib/locales/de.yml +7182 -100
  19. data/lib/locales/ee.yml +0 -1
  20. data/lib/locales/en/address.yml +1826 -561
  21. data/lib/locales/en/australia.yml +106 -105
  22. data/lib/locales/en/bank.yml +1 -1
  23. data/lib/locales/en/finance.yml +3 -3
  24. data/lib/locales/en/{fma_brotherhood.yml → fullmetal_alchemist_brotherhood.yml} +3 -3
  25. data/lib/locales/en/harry_potter.yml +1 -1
  26. data/lib/locales/en/id_number.yml +1 -1
  27. data/lib/locales/en/internet.yml +0 -4
  28. data/lib/locales/en/phone_number.yml +78 -3
  29. data/lib/locales/en/{room.yml → the_room.yml} +1 -1
  30. data/lib/locales/en-AU.yml +718 -47
  31. data/lib/locales/en-CA.yml +373 -19
  32. data/lib/locales/en-GB.yml +116 -9
  33. data/lib/locales/en-IND.yml +1259 -17
  34. data/lib/locales/en-KE.yml +212 -0
  35. data/lib/locales/en-MS.yml +364 -18
  36. data/lib/locales/en-NEP.yml +212 -38
  37. data/lib/locales/en-NZ.yml +1153 -124
  38. data/lib/locales/en-PAK.yml +369 -11
  39. data/lib/locales/en-SG.yml +581 -17
  40. data/lib/locales/en-US.yml +6923 -83
  41. data/lib/locales/en-au-ocker.yml +266 -24
  42. data/lib/locales/es-AR.yml +4569 -4600
  43. data/lib/locales/es-MX.yml +0 -1
  44. data/lib/locales/es.yml +0 -1
  45. data/lib/locales/fr/internet.yml +0 -1
  46. data/lib/locales/fr-CA.yml +2733 -44
  47. data/lib/locales/fr-CH.yml +0 -1
  48. data/lib/locales/fr.yml +3 -1
  49. data/lib/locales/hy.yml +3624 -120
  50. data/lib/locales/id.yml +839 -12
  51. data/lib/locales/it.yml +1304 -33
  52. data/lib/locales/ko.yml +0 -1
  53. data/lib/locales/lt.yml +297 -16
  54. data/lib/locales/lv.yml +0 -1
  55. data/lib/locales/nb-NO.yml +518 -30
  56. data/lib/locales/nl.yml +0 -1
  57. data/lib/locales/pl.yml +0 -1
  58. data/lib/locales/pt-BR.yml +8155 -665
  59. data/lib/locales/pt.yml +844 -45
  60. data/lib/locales/ru.yml +1353 -70
  61. data/lib/locales/sk.yml +4410 -44
  62. data/lib/locales/tr.yml +0 -2
  63. data/lib/locales/uk.yml +1808 -47
  64. metadata +8 -7
  65. data/History.md +0 -176
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a39a95efd06da2c5f87dfd84f6c251e7731ece3edffc9c9d52a6f95a5ec0751e
4
- data.tar.gz: a881cedce22c1ca2c8bd7d1cc8789371e99829f354872e325ebeada4460de382
3
+ metadata.gz: be60c8141d31082df945cc901a037a7cb113f778e55ad162ac94437591d8077e
4
+ data.tar.gz: 9daf53dae40a7ff80301d2b6ee34add1362ece01847d575fe60b8486d36956ad
5
5
  SHA512:
6
- metadata.gz: ed6d8dfc1d75c7639f26ff617755cd421f7bff7152277aa999c26af5991d94c8efe9bb9abfdaadf1349bfd93d2b3ddb16d5c36783680fa463cf86f5836698b39
7
- data.tar.gz: 6d2f16a39cca245bfc2e28cd55f4a76f5066787719bb371b3ee4edb53fbf59c31098c7c0997e32ad6af280e3b1e742762dbbd6d6a569fba91665427775c4925d
6
+ metadata.gz: ef12b97fb9cfc95debc587e978c0d88d7a8fb46a3fe9f88069f2bd5e1472a747c5ff8b2fc970b71a36cee26323c5efe3252cf2bd20e936e0dc5e7f7aeaa3778d
7
+ data.tar.gz: 547705e2465dc97198c5b1da5a9bfa5e859f46f035fef05f6b4a5b5fe9b4302a3daef2ed8964d765b29781eeca81d41dca9100540f71808f2d4cbcf9be6f332f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,146 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.3.0](https://github.com/faker-ruby/faker/tree/v3.3.0) (2024-03-25)
4
+
5
+ ### Bug Fixes
6
+
7
+ * Remove the duplicate method Faker::Commerce.material description by @mmarusyk in https://github.com/faker-ruby/faker/pull/2914
8
+
9
+ ### Features
10
+
11
+ * Add Kenya to supported countries by @AndrewNduati in https://github.com/faker-ruby/faker/pull/2871
12
+ * Benchmarking loading JSON file vs YML file by @salochara in https://github.com/faker-ruby/faker/pull/2897
13
+
14
+ ### What's changed
15
+
16
+ * Fix/Deprecate `Faker::IDNumber` to `Faker::IdNumber` to be more consistent with other generator's naming convention. by @Jamal-A-Mohamed in https://github.com/faker-ruby/faker/pull/2858
17
+ * Fix/Deprecate FmaBrotherhood Generator by @kirkkwang in https://github.com/faker-ruby/faker/pull/2856
18
+ * Fix/Deprecate Faker::Australia to Faker::Locations::Australia by @keshavbiswa in https://github.com/faker-ruby/faker/pull/2869
19
+ * Add note about EOL dependencies by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2890
20
+
21
+ ### Update local dependencies
22
+
23
+ * Bump test-unit from 3.6.1 to 3.6.2 by @dependabot in https://github.com/faker-ruby/faker/pull/2906
24
+ * Bump i18n from 1.14.1 to 1.14.4 by @dependabot in https://github.com/faker-ruby/faker/pull/2913
25
+ * Bump rubocop from 1.60.2 to 1.62.1 by @dependabot in https://github.com/faker-ruby/faker/pull/2916
26
+ * Bump yard from 0.9.34 to 0.9.36 by @dependabot in https://github.com/faker-ruby/faker/pull/2909
27
+ * Bump minitest from 5.22.2 to 5.22.3 by @dependabot in https://github.com/faker-ruby/faker/pull/2917
28
+
29
+ ### New Contributors
30
+
31
+ * @AndrewNduati made their first contribution in https://github.com/faker-ruby/faker/pull/2871
32
+ * @Jamal-A-Mohamed made their first contribution in https://github.com/faker-ruby/faker/pull/2858
33
+ * @mmarusyk made their first contribution in https://github.com/faker-ruby/faker/pull/2914
34
+
35
+ **Full Changelog**: https://github.com/faker-ruby/faker/compare/v3.2.3...v3.3.0
36
+
37
+ -------------------------
38
+
39
+ ## [v3.2.3](https://github.com/faker-ruby/faker/tree/v3.2.3) (2024-01-12)
40
+
41
+ ### What's Changed
42
+
43
+ Happy 2024 with a new faker-ruby release.
44
+
45
+ This version includes bug and documentation fixes, and some changes on the contributing guides.
46
+
47
+ ### faker-ruby is is not accepting new features proposals
48
+
49
+ As we [discussed here](https://github.com/orgs/faker-ruby/discussions/2877), we want to improve faker's performance and organization. There hasn't been to many bug reports and most of the open issues are related to performance and confusion around using faker.
50
+
51
+ As we have limited time to invest in faker, reviewing _new_ generators and locales prevent us from focusing on the big picture work. With this decision, we hope to make the necessary changes for faker to go to the next level. Please read the Contributing guides for ways to help us get there.
52
+
53
+ ### Bug fixes
54
+ * Fix Phone number long number and other updates by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2842
55
+ * Favor 'The Room' instead of 'Room' by @kirkkwang in https://github.com/faker-ruby/faker/pull/2854
56
+ * Limit generated Discover cards to 19 digits by @jamie in https://github.com/faker-ruby/faker/pull/2845
57
+ * Fix Typo in README Link: Update sports.md to sport.md by @hatsu38 in https://github.com/faker-ruby/faker/pull/2859
58
+ * Fix country names and codes in address by @sudeeptarlekar in https://github.com/faker-ruby/faker/pull/2850
59
+ * fixed typo for README. Faker::JapaneseMedia::CowboyBebop by @jacoyutorius in https://github.com/faker-ruby/faker/pull/2863
60
+ * Fix typo in `Faker::Movies::HarryPotter.location` (Castelobruxo) by @leomartins1999 in https://github.com/faker-ruby/faker/pull/2866
61
+ * Fix flaky spec on `TestFakerFile#test_file_name` by @keshavbiswa in https://github.com/faker-ruby/faker/pull/2868
62
+ * Update `Internet#username` separator param to match with the example by @AlexandreL0pes in https://github.com/faker-ruby/faker/pull/2882
63
+ * fix polish bban_pattern by @artur1313 in https://github.com/faker-ruby/faker/pull/2887
64
+
65
+ ### What's Changed
66
+ * Add benchmark by @salochara in https://github.com/faker-ruby/faker/pull/2855
67
+ * Freeze new generator and locales by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2886
68
+ * Remove deprecate safe_email and free_email methods by @hatsu38 in https://github.com/faker-ruby/faker/pull/2841
69
+ * Update contribution guidelines and PULL_REQUEST_TEMPLATE by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2878
70
+ * Remove unmaintained `History.md` by @y-yagi in https://github.com/faker-ruby/faker/pull/2880
71
+ * Adds Ruby 3.3 to the CI matrix by @m-nakamura145 in https://github.com/faker-ruby/faker/pull/2883
72
+
73
+ ### Update local dependencies
74
+ * Bump rubocop from 1.58.0 to 1.59.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2865
75
+ * Bump rubocop-minitest from 0.34.3 to 0.34.4 by @dependabot in https://github.com/faker-ruby/faker/pull/2884
76
+ * Bump minitest version by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2889
77
+
78
+ ### New Contributors
79
+ * @kirkkwang made their first contribution in https://github.com/faker-ruby/faker/pull/2854
80
+ * @jamie made their first contribution in https://github.com/faker-ruby/faker/pull/2845
81
+ * @hatsu38 made their first contribution in https://github.com/faker-ruby/faker/pull/2859
82
+ * @salochara made their first contribution in https://github.com/faker-ruby/faker/pull/2855
83
+ * @jacoyutorius made their first contribution in https://github.com/faker-ruby/faker/pull/2863
84
+ * @leomartins1999 made their first contribution in https://github.com/faker-ruby/faker/pull/2866
85
+ * @keshavbiswa made their first contribution in https://github.com/faker-ruby/faker/pull/2868
86
+ * @y-yagi made their first contribution in https://github.com/faker-ruby/faker/pull/2880
87
+ * @AlexandreL0pes made their first contribution in https://github.com/faker-ruby/faker/pull/2882
88
+ * @m-nakamura145 made their first contribution in https://github.com/faker-ruby/faker/pull/2883
89
+ * @artur1313 made their first contribution in https://github.com/faker-ruby/faker/pull/2887
90
+
91
+ **Full Changelog**: https://github.com/faker-ruby/faker/compare/v3.2.2...v.3.2.3
92
+
93
+ -------------------------
94
+
95
+ ## [v3.2.2](https://github.com/faker-ruby/faker/tree/v3.2.2) (2023-11-03)
96
+
97
+ Happy November with a new faker-ruby release.
98
+
99
+ This version:
100
+ - adds generators
101
+ - fixes bugs
102
+ - updates dev and dependencies
103
+ - updates docs
104
+
105
+ ### Features
106
+ * feat: add danish country code by @hoshy in https://github.com/faker-ruby/faker/pull/2818
107
+ * Add `zh-CN` translations for Bank names by @guxiaobai in https://github.com/faker-ruby/faker/pull/2840
108
+ * Add Code Scanning by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2835
109
+ * Add Japanese for Games Touhou by @shiroemons in https://github.com/faker-ruby/faker/pull/2829
110
+ * Added Faker::Company.indian_gst_number fixed #2823 by @ankitkhadria in https://github.com/faker-ruby/faker/pull/2825
111
+ * Adds Smashing Pumpkins to the Music module by @redconfetti in https://github.com/faker-ruby/faker/pull/2817
112
+
113
+ ### Bug fixes
114
+ * Delete doc/default/michael_scott.md by @jmromer in https://github.com/faker-ruby/faker/pull/2837
115
+ * Fix typo in `lib/locales/README.md` by @BelaBartok39 in https://github.com/faker-ruby/faker/pull/2812
116
+
117
+ ### What's Changed
118
+ * Update contributing and maintaining guides by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2836
119
+ * Changed tests from x.times loop to deterministically_verify helper. #2813 issue by @fernandomenolli in https://github.com/faker-ruby/faker/pull/2816
120
+ * Improve `#deterministically_verify` helper by @erichmachado in https://github.com/faker-ruby/faker/pull/2828
121
+
122
+ ### Update local dependencies
123
+ * Bump minitest from 5.19.0 to 5.20.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2826
124
+ * Bump rake from 13.0.6 to 13.1.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2846
125
+ * Bump rubocop-minitest from 0.32.2 to 0.33.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2843
126
+ * Bump rubocop from 1.57.1 to 1.57.2 by @dependabot in https://github.com/faker-ruby/faker/pull/2844
127
+ * Bump timecop from 0.9.6 to 0.9.8 by @dependabot in https://github.com/faker-ruby/faker/pull/2811
128
+
129
+ ## New Contributors
130
+ * @BelaBartok39 made their first contribution in https://github.com/faker-ruby/faker/pull/2812
131
+ * @fernandomenolli made their first contribution in https://github.com/faker-ruby/faker/pull/2816
132
+ * @hoshy made their first contribution in https://github.com/faker-ruby/faker/pull/2818
133
+ * @shiroemons made their first contribution in https://github.com/faker-ruby/faker/pull/2829
134
+ * @erichmachado made their first contribution in https://github.com/faker-ruby/faker/pull/2828
135
+ * @jmromer made their first contribution in https://github.com/faker-ruby/faker/pull/2837
136
+ * @guxiaobai made their first contribution in https://github.com/faker-ruby/faker/pull/2840
137
+ * @redconfetti made their first contribution in https://github.com/faker-ruby/faker/pull/2817
138
+ * @ankitkhadria made their first contribution in https://github.com/faker-ruby/faker/pull/2825
139
+
140
+ **Full Changelog**: https://github.com/faker-ruby/faker/compare/v3.2.1...v3.2.2
141
+
142
+ -------------------------
143
+
3
144
  ## [v3.2.1](https://github.com/faker-ruby/faker/tree/v3.2.1) (2023-08-11)
4
145
 
5
146
  Happy August with a new Faker release! 🎉
data/README.md CHANGED
@@ -248,7 +248,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
248
248
  - [Faker::Hipster](doc/default/hipster.md)
249
249
  - [Faker::Hobby](doc/default/hobby.md)
250
250
  - [Faker::House](doc/default/house.md)
251
- - [Faker::IDNumber](doc/default/id_number.md)
251
+ - [Faker::IdNumber](doc/default/id_number.md)
252
252
  - [Faker::IndustrySegments](doc/default/industry_segments.md)
253
253
  - [Faker::Internet](doc/default/internet.md)
254
254
  - [Faker::Invoice](doc/default/invoice.md)
@@ -376,7 +376,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
376
376
  - [Faker::JapaneseMedia::Naruto](doc/japanese_media/naruto.md)
377
377
  - [Faker::JapaneseMedia::Doraemon](doc/japanese_media/doraemon.md)
378
378
  - [Faker::JapaneseMedia::Conan](doc/japanese_media/conan.md)
379
- - [Faker::JapaneseMedia::FmaBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
379
+ - [Faker::JapaneseMedia::FullmetalAlchemistBrotherhood](doc/japanese_media/fullmetal_alchemist_brotherhood.md)
380
380
  </details>
381
381
 
382
382
  <details>
@@ -427,7 +427,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
427
427
  <details>
428
428
  <summary>Sports</summary>
429
429
 
430
- - [Faker::Sports](doc/sports/sports.md)
430
+ - [Faker::Sport](doc/sports/sport.md)
431
431
  - [Faker::Sports::Basketball](doc/sports/basketball.md)
432
432
  - [Faker::Sports::Chess](doc/sports/chess.md)
433
433
  - [Faker::Sports::Football](doc/sports/football.md)
@@ -477,12 +477,18 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main
477
477
  - [Faker::TvShows::VentureBros](doc/tv_shows/venture_bros.md)
478
478
  </details>
479
479
 
480
+ <details>
481
+ <summary>Locations</summary>
482
+
483
+ - [Faker::Locations::Australia](doc/locations/australia.md)
484
+ </details>
485
+
480
486
  ## Contributing
481
487
 
482
- If you have problems, please create a [GitHub Issue](/.github/ISSUE_TEMPLATE/bug-report.md).
488
+ **Note**: We are not accepting proposals for new generators and locales. The [Contributing](CONTRIBUTING.md) guide has a few notes about this decision.
483
489
 
484
490
  Take a look at the [Contributing](CONTRIBUTING.md) document for
485
- instructions on setting up the repo on your machine, understanding the codebase,
491
+ instructions on setting up the repo on your machine, opening bug reports, understanding the codebase,
486
492
  and creating a good pull request.
487
493
 
488
494
  There is a [Discord channel](https://discord.gg/RMumTwB) to discuss anything
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faker
4
- class IDNumber < Base
4
+ class IdNumber < Base
5
5
  CHECKS = 'TRWAGMYFPDXBNJZSQVHLCKE'
6
6
  INVALID_SSN = [
7
7
  /0{3}-\d{2}-\d{4}/,
@@ -25,7 +25,7 @@ module Faker
25
25
  # @return [String]
26
26
  #
27
27
  # @example
28
- # Faker::IDNumber.valid #=> "552-56-3593"
28
+ # Faker::IdNumber.valid #=> "552-56-3593"
29
29
  #
30
30
  # @faker.version 1.6.0
31
31
  def valid
@@ -38,7 +38,7 @@ module Faker
38
38
  # @return [String]
39
39
  #
40
40
  # @example
41
- # Faker::IDNumber.invalid #=> "311-72-0000"
41
+ # Faker::IdNumber.invalid #=> "311-72-0000"
42
42
  #
43
43
  # @faker.version 1.6.0
44
44
  def invalid
@@ -71,7 +71,7 @@ module Faker
71
71
  # @return [String]
72
72
  #
73
73
  # @example
74
- # Faker::IDNumber.spanish_citizen_number #=> "53290236-H"
74
+ # Faker::IdNumber.spanish_citizen_number #=> "53290236-H"
75
75
  #
76
76
  # @faker.version 1.9.0
77
77
  def spanish_citizen_number
@@ -87,7 +87,7 @@ module Faker
87
87
  # @return [String]
88
88
  #
89
89
  # @example
90
- # Faker::IDNumber.spanish_foreign_citizen_number #=> "Z-1600870-Y"
90
+ # Faker::IdNumber.spanish_foreign_citizen_number #=> "Z-1600870-Y"
91
91
  #
92
92
  # @faker.version 1.9.0
93
93
  def spanish_foreign_citizen_number
@@ -106,8 +106,8 @@ module Faker
106
106
  # @return [String]
107
107
  #
108
108
  # @example
109
- # Faker::IDNumber.south_african_id_number #=> "8105128870184"
110
- # Faker::IDNumber.valid_south_african_id_number #=> "8105128870184"
109
+ # Faker::IdNumber.south_african_id_number #=> "8105128870184"
110
+ # Faker::IdNumber.valid_south_african_id_number #=> "8105128870184"
111
111
  #
112
112
  # @faker.version 1.9.2
113
113
  def valid_south_african_id_number
@@ -129,7 +129,7 @@ module Faker
129
129
  # @return [String]
130
130
  #
131
131
  # @example
132
- # Faker::IDNumber.invalid_south_african_id_number #=> "1642972065088"
132
+ # Faker::IdNumber.invalid_south_african_id_number #=> "1642972065088"
133
133
  #
134
134
  # @faker.version 1.9.2
135
135
  def invalid_south_african_id_number
@@ -156,8 +156,8 @@ module Faker
156
156
  # @return [String]
157
157
  #
158
158
  # @example
159
- # Faker::IDNumber.brazilian_citizen_number #=> "53540542221"
160
- # Faker::IDNumber.brazilian_citizen_number(formatted: true) #=> "535.405.422-21"
159
+ # Faker::IdNumber.brazilian_citizen_number #=> "53540542221"
160
+ # Faker::IdNumber.brazilian_citizen_number(formatted: true) #=> "535.405.422-21"
161
161
  #
162
162
  # @faker.version 1.9.2
163
163
  def brazilian_citizen_number(formatted: false)
@@ -177,8 +177,8 @@ module Faker
177
177
  # @return [String]
178
178
  #
179
179
  # @example
180
- # Faker::IDNumber.brazilian_id #=> "493054029"
181
- # Faker::IDNumber.brazilian_id(formatted: true) #=> "49.305.402-9"
180
+ # Faker::IdNumber.brazilian_id #=> "493054029"
181
+ # Faker::IdNumber.brazilian_id(formatted: true) #=> "49.305.402-9"
182
182
  #
183
183
  # @faker.version 2.1.2
184
184
  def brazilian_id(formatted: false)
@@ -196,7 +196,7 @@ module Faker
196
196
  # @return [String]
197
197
  #
198
198
  # @example
199
- # Faker::IDNumber.chilean_id #=> "15620613-K"
199
+ # Faker::IdNumber.chilean_id #=> "15620613-K"
200
200
  #
201
201
  # @faker.version 2.1.2
202
202
  def chilean_id
@@ -213,8 +213,8 @@ module Faker
213
213
  # @return [String]
214
214
  #
215
215
  # @example
216
- # Faker::IDNumber.croatian_id #=> "88467617508"
217
- # Faker::IDNumber.croatian_id(international: true) #=> "HR88467617508"
216
+ # Faker::IdNumber.croatian_id #=> "88467617508"
217
+ # Faker::IdNumber.croatian_id(international: true) #=> "HR88467617508"
218
218
  #
219
219
  # @faker.version next
220
220
  def croatian_id(international: false)
@@ -238,10 +238,10 @@ module Faker
238
238
  # @return [String]
239
239
  #
240
240
  # @example
241
- # Faker::IDNumber.danish_id_number #=> "0503909980"
242
- # Faker::IDNumber.danish_id_number(formatted: true) #=> "050390-9980"
243
- # Faker::IDNumber.danish_id_number(birthday: Date.new(1990, 3, 5)) #=> "0503909980"
244
- # Faker::IDNumber.danish_id_number(gender: :female) #=> "0503909980"
241
+ # Faker::IdNumber.danish_id_number #=> "0503909980"
242
+ # Faker::IdNumber.danish_id_number(formatted: true) #=> "050390-9980"
243
+ # Faker::IdNumber.danish_id_number(birthday: Date.new(1990, 3, 5)) #=> "0503909980"
244
+ # Faker::IdNumber.danish_id_number(gender: :female) #=> "0503909980"
245
245
  #
246
246
  # @faker.version next
247
247
  def danish_id_number(formatted: false, birthday: Faker::Date.birthday, gender: nil)
@@ -275,7 +275,7 @@ module Faker
275
275
  # @return [String]
276
276
  #
277
277
  # @example
278
- # Faker::IDNumber.french_insee_number #=> "53290236-H"
278
+ # Faker::IdNumber.french_insee_number #=> "53290236-H"
279
279
  #
280
280
  # @faker.version next
281
281
  def french_insee_number
@@ -421,4 +421,7 @@ module Faker
421
421
  end
422
422
  end
423
423
  end
424
+
425
+ include Faker::Deprecator
426
+ deprecate_generator('IDNumber', IdNumber)
424
427
  end
@@ -15,8 +15,6 @@ module Faker
15
15
  ].each(&:freeze).freeze
16
16
 
17
17
  class << self
18
- extend Gem::Deprecate
19
-
20
18
  ##
21
19
  # Returns the email address
22
20
  #
@@ -50,42 +48,6 @@ module Faker
50
48
  construct_email(sanitized_local_part, generate_domain)
51
49
  end
52
50
 
53
- ##
54
- # Returns the email address with domain either gmail.com, yahoo.com or hotmail.com
55
- #
56
- # @return [String]
57
- #
58
- # @param name [String]
59
- #
60
- # @example
61
- # Faker::Internet.free_email #=> "samsmith@gmail.com"
62
- # Faker::Internet.free_email(name: 'smith') #=> "smith@yahoo.com"
63
- def free_email(name: nil)
64
- construct_email(
65
- sanitize_email_local_part(username(specifier: name)),
66
- fetch('internet.free_email')
67
- )
68
- end
69
- deprecate :free_email, :email, 2023, 10
70
-
71
- ##
72
- # Returns the email address with fixed domain name as 'example'
73
- #
74
- # @return [String]
75
- #
76
- # @param name [String]
77
- #
78
- # @example
79
- # Faker::Internet.safe_email #=> "samsmith@example.com"
80
- # Faker::Internet.safe_email(name: 'smith') #=> "smith@example.net"
81
- def safe_email(name: nil)
82
- construct_email(
83
- sanitize_email_local_part(username(specifier: name)),
84
- "example.#{sample(%w[org com net])}"
85
- )
86
- end
87
- deprecate :safe_email, :email, 2023, 10
88
-
89
51
  ##
90
52
  # Returns the username
91
53
  #
@@ -98,7 +60,7 @@ module Faker
98
60
  # Faker::Internet.username(specifier: 10) #=> "lulu.goodwin"
99
61
  # Faker::Internet.username(specifier: 5..10) #=> "morris"
100
62
  # Faker::Internet.username(specifier: 5..10) #=> "berryberry"
101
- # Faker::Internet.username(specifier: 20, separators: ['-']) #=> "nikki_sawaynnikki_saway"
63
+ # Faker::Internet.username(specifier: 20, separators: ['_']) #=> "nikki_sawaynnikki_saway"
102
64
  def username(specifier: nil, separators: %w[. _])
103
65
  with_locale(:en) do
104
66
  return shuffle(specifier.scan(/[[:word:]]+/)).join(sample(separators)).downcase if specifier.respond_to?(:scan)
@@ -71,7 +71,7 @@ module Faker
71
71
  options[:value] = "Faker::#{options[:value]}"
72
72
 
73
73
  hash = JSON.parse(json)
74
- hash.each do |key, _|
74
+ hash.each_key do |key|
75
75
  add_hash_to_bottom(hash, [key], width, options)
76
76
  end
77
77
  JSON.generate(hash)
@@ -93,7 +93,7 @@ module Faker
93
93
  def add_hash_to_bottom(hash, key_array, width, options)
94
94
  key_string = build_keys_from_array(key_array)
95
95
  if eval("hash#{key_string}").is_a?(::Hash)
96
- eval("hash#{key_string}").each do |key, _|
96
+ eval("hash#{key_string}").each_key do |key|
97
97
  key_array << key
98
98
  add_hash_to_bottom(hash, key_array, width, options)
99
99
  end
@@ -4,12 +4,14 @@ module Faker
4
4
  class PhoneNumber < Base
5
5
  class << self
6
6
  ##
7
- # Produces a random phone number in a random format (may or may not have a country code, extension and can have different dividers).
7
+ # Produces a phone number in a random format without the country code and it can have different dividers.
8
8
  #
9
9
  # @return [String]
10
10
  #
11
11
  # @example
12
- # Faker::PhoneNumber.phone_number #=> "397.693.1309 x4321"
12
+ # Faker::PhoneNumber.phone_number #=> "(504) 113-1705"
13
+ # Faker::PhoneNumber.phone_number #=> "662.291.7201"
14
+ # Faker::PhoneNumber.phone_number #=> "9415283713"
13
15
  #
14
16
  # @faker.version 0.3.0
15
17
  def phone_number
@@ -17,12 +19,14 @@ module Faker
17
19
  end
18
20
 
19
21
  ##
20
- # Produces a random cell phone number in a random format (may or may not have a country code and can have different dividers).
22
+ # Produces a random cell phone number in a random format without the country code and it can have different dividers.
21
23
  #
22
24
  # @return [String]
23
25
  #
24
26
  # @example
25
- # Faker::PhoneNumber.cell_phone #=> "(186)285-7925"
27
+ # Faker::PhoneNumber.cell_phone #=> "(836) 115-8995"
28
+ # Faker::PhoneNumber.cell_phone #=> "382-597-5739"
29
+ # Faker::PhoneNumber.cell_phone #=> "316.828.1822"
26
30
  #
27
31
  # @faker.version 1.0.0
28
32
  def cell_phone
@@ -36,10 +40,12 @@ module Faker
36
40
  #
37
41
  # @example
38
42
  # Faker::PhoneNumber.country_code #=> "+20"
43
+ # Faker::PhoneNumber.country_code #=> "+39"
44
+ # Faker::PhoneNumber.country_code #=> "+852"
39
45
  #
40
46
  # @faker.version 1.9.2
41
47
  def country_code
42
- "+#{fetch('country_code')}"
48
+ "+#{fetch('phone_number.country_code')}"
43
49
  end
44
50
 
45
51
  ##
@@ -48,7 +54,9 @@ module Faker
48
54
  # @return [String]
49
55
  #
50
56
  # @example
51
- # Faker::PhoneNumber.phone_number_with_country_code #=> "+95 1-672-173-8153"
57
+ # Faker::PhoneNumber.phone_number_with_country_code #=> "+55 466-746-6882"
58
+ # Faker::PhoneNumber.phone_number_with_country_code #=> "+81 3718219558"
59
+ # Faker::PhoneNumber.phone_number_with_country_code #=> "+49 140 957 9846"
52
60
  #
53
61
  # @faker.version 1.9.2
54
62
  def phone_number_with_country_code
@@ -61,7 +69,9 @@ module Faker
61
69
  # @return [String]
62
70
  #
63
71
  # @example
64
- # Faker::PhoneNumber.cell_phone_with_country_code #=> "+974 (190) 987-9034"
72
+ # Faker::PhoneNumber.cell_phone_with_country_code #=> "+852 (190) 987-9034"
73
+ # Faker::PhoneNumber.cell_phone_with_country_code #=> "+64 (820) 583-6474"
74
+ # Faker::PhoneNumber.cell_phone_with_country_code #=> "+1 591.871.7985"
65
75
  #
66
76
  # @faker.version 1.9.2
67
77
  def cell_phone_with_country_code
@@ -69,12 +79,14 @@ module Faker
69
79
  end
70
80
 
71
81
  ##
72
- # Produces a random phone number in e164 format.
82
+ # Produces a random phone number in e164 format, i.e., without any dividers.
73
83
  #
74
84
  # @return [String]
75
85
  #
76
86
  # @example
77
- # Faker::PhoneNumber.cell_phone_in_e164 #=> "+944937040625"
87
+ # Faker::PhoneNumber.cell_phone_in_e164 #=> "+542024834991"
88
+ # Faker::PhoneNumber.cell_phone_in_e164 #=> "+8522846847703"
89
+ # Faker::PhoneNumber.cell_phone_in_e164 #=> "+649477546575"
78
90
  #
79
91
  # @faker.version 1.9.2
80
92
  def cell_phone_in_e164
@@ -82,49 +94,56 @@ module Faker
82
94
  end
83
95
 
84
96
  ##
85
- # Produces a random US or Canada-based area code.
97
+ # Produces a random area code.
86
98
  #
87
99
  # @return [String]
88
100
  #
89
101
  # @example
90
102
  # Faker::PhoneNumber.area_code #=> "201"
103
+ # Faker::PhoneNumber.area_code #=> "613"
104
+ # Faker::PhoneNumber.area_code #=> "321"
91
105
  #
92
106
  # @faker.version 1.3.0
93
107
  def area_code
94
108
  fetch('phone_number.area_code')
95
- rescue I18n::MissingTranslationData
96
- nil
97
109
  end
98
110
 
99
111
  ##
100
- # Produces a random US or Canada-based exchange code.
112
+ # Produces a random exchange code.
101
113
  #
102
114
  # @return [String]
103
115
  #
104
116
  # @example
105
117
  # Faker::PhoneNumber.exchange_code #=> "208"
118
+ # Faker::PhoneNumber.exchange_code #=> "415"
119
+ # Faker::PhoneNumber.exchange_code #=> "652"
106
120
  #
107
121
  # @faker.version 1.3.0
108
122
  def exchange_code
109
123
  fetch('phone_number.exchange_code')
110
- rescue I18n::MissingTranslationData
111
- nil
112
124
  end
113
125
 
114
126
  ##
115
- # Produces a random US or Canada-based extension / subscriber number. Can be used for both extensions and last four digits of phone number.
127
+ # Produces a random extension / subscriber number. Can be used for both extensions and last four digits of phone number.
116
128
  #
117
- # @param length [Integer] Specifies the length of the return value.
129
+ # @param length [Integer] Specifies the length of the return value. Defaults to 4.
118
130
  # @return [String]
119
131
  #
120
132
  # @example
121
133
  # Faker::PhoneNumber.subscriber_number #=> "3873"
122
134
  # Faker::PhoneNumber.subscriber_number(length: 2) #=> "39"
123
135
  # Faker::PhoneNumber.extension #=> "3764"
136
+ # Faker::PhoneNumber.extension(length: 2) => "37"
124
137
  #
125
138
  # @faker.version 1.3.0
126
139
  def subscriber_number(length: 4)
127
- rand.to_s[2..(1 + length)]
140
+ if !length.is_a?(Integer) || length > 10
141
+ raise ArgumentError, 'length must be an Integer and be lesser than 10'
142
+ end
143
+
144
+ generate(:string) do |g|
145
+ g.int(length: length)
146
+ end
128
147
  end
129
148
 
130
149
  alias extension subscriber_number
@@ -13,7 +13,7 @@ module Faker
13
13
  #
14
14
  # @faker.version 1.9.2
15
15
  def id_number
16
- Faker::IDNumber.south_african_id_number
16
+ Faker::IdNumber.south_african_id_number
17
17
  end
18
18
 
19
19
  ##
@@ -26,7 +26,7 @@ module Faker
26
26
  #
27
27
  # @faker.version 1.9.2
28
28
  def valid_id_number
29
- Faker::IDNumber.valid_south_african_id_number
29
+ Faker::IdNumber.valid_south_african_id_number
30
30
  end
31
31
 
32
32
  ##
@@ -39,7 +39,7 @@ module Faker
39
39
  #
40
40
  # @faker.version 1.9.2
41
41
  def invalid_id_number
42
- Faker::IDNumber.invalid_south_african_id_number
42
+ Faker::IdNumber.invalid_south_african_id_number
43
43
  end
44
44
 
45
45
  ##
@@ -2,47 +2,50 @@
2
2
 
3
3
  module Faker
4
4
  class JapaneseMedia
5
- class FmaBrotherhood < Base
5
+ class FullmetalAlchemistBrotherhood < Base
6
6
  class << self
7
7
  ##
8
- # Produces a character from FmaBrotherhood.
8
+ # Produces a character from FullmetalAlchemistBrotherhood.
9
9
  #
10
10
  # @return [String]
11
11
  #
12
12
  # @example
13
- # Faker::JapaneseMedia::FmaBrotherhood.character #=> "Edward Elric"
13
+ # Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.character #=> "Edward Elric"
14
14
  #
15
15
  # @faker.version next
16
16
  def character
17
- fetch('fma_brotherhood.characters')
17
+ fetch('fullmetal_alchemist_brotherhood.characters')
18
18
  end
19
19
 
20
20
  ##
21
- # Produces a cities from FmaBrotherhood.
21
+ # Produces a cities from FullmetalAlchemistBrotherhood.
22
22
  #
23
23
  # @return [String]
24
24
  #
25
25
  # @example
26
- # Faker::JapaneseMedia::FmaBrotherhood.city #=> "Central City"
26
+ # Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.city #=> "Central City"
27
27
  #
28
28
  # @faker.version next
29
29
  def city
30
- fetch('fma_brotherhood.cities')
30
+ fetch('fullmetal_alchemist_brotherhood.cities')
31
31
  end
32
32
 
33
33
  ##
34
- # Produces a country from FmaBrotherhood.
34
+ # Produces a country from FullmetalAlchemistBrotherhood.
35
35
  #
36
36
  # @return [String]
37
37
  #
38
38
  # @example
39
- # Faker::JapaneseMedia::FmaBrotherhood.country #=> "Xing"
39
+ # Faker::JapaneseMedia::FullmetalAlchemistBrotherhood.country #=> "Xing"
40
40
  #
41
41
  # @faker.version next
42
42
  def country
43
- fetch('fma_brotherhood.countries')
43
+ fetch('fullmetal_alchemist_brotherhood.countries')
44
44
  end
45
45
  end
46
46
  end
47
+
48
+ include Faker::Deprecator
49
+ deprecate_generator('FmaBrotherhood', FullmetalAlchemistBrotherhood)
47
50
  end
48
51
  end