faker 3.5.1 → 3.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad65b0b170d18a8541ff81c4db2ccce41263844bd877e4ecb0b78261a04f916a
4
- data.tar.gz: 2c84244f6994575b1d94fb1a7e60a3d16122e17aeed81bcb6945360aeb5b7eda
3
+ metadata.gz: dc659ae3f4a2f8e2d7f7fc3a22903c5a1e81138110b8ddeced3b6969ad92e22d
4
+ data.tar.gz: a0370b7a158c4fe7a40b3a32500e45997cb0fa5b753e507f65cbbebe66523c2a
5
5
  SHA512:
6
- metadata.gz: a436fa77b8d61b96a5f52748061e823528c234b5e8ce5e6e3876254eaddb3f72b6fca43e52c0aeed3d6e00701c2ab81b77a192846929d46920f088182e20e5d9
7
- data.tar.gz: 0d2eb003ccd5492d09a2e5565994380bbb61fb1cfa0ca94efcae3f556e27bce231dfc13e643be150893040137e6c856011c7891fcde0b19c4aea99bf3d2853a4
6
+ metadata.gz: fa3feb382544da65be21255d723278ef89ba1c470a572267b61c5adb9c4e5b171668356bd30f339be12a735d605722118ad0e6d302b3c3774e987cd76bdc3763
7
+ data.tar.gz: 031cadfc32e4f3faaf68d971a18cda06caa01a610da3449a4fe3d5fe9c0523979b4426b9fbb699a6a6f2511958223875d783e7b792aebb390a4d871bbbbae59d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.5.2](https://github.com/faker-ruby/faker/tree/v3.5.2) (2025-07-01)
4
+
5
+ Happy Canada Day! 🍁
6
+
7
+ This version adds and improves some locales and fixes some bugs.
8
+
9
+ Thanks to all contributors!
10
+
11
+ ### Improvements & Bug fixes
12
+ * Correct `Faker::Address.city` and `Faker::Address.street_address` for `:fr` locale by @brupla6126 in https://github.com/faker-ruby/faker/pull/3018
13
+ * fix condominium_fiscal_code generator length from 9 to 11 characters by @FiloSpaTeam in https://github.com/faker-ruby/faker/pull/3037
14
+ * Add Cell Phone, Default Time Zone and State Abbreviation translation for en-PAK locale by @wonderer007 in https://github.com/faker-ruby/faker/pull/3024
15
+ * Fix usage docs header indentation by @jaredsmithse in https://github.com/faker-ruby/faker/pull/3049
16
+ * Fix nl phone format by @klaaspieter in https://github.com/faker-ruby/faker/pull/3050
17
+ * Fix typo in `ja/book` locale by @thdaraujo in https://github.com/faker-ruby/faker/pull/3062
18
+ * fix a typo by @jethrodaniel in https://github.com/faker-ruby/faker/pull/3060
19
+ * Fix typo in `restaurant.yml` by @daniel-nerdgeschoss in https://github.com/faker-ruby/faker/pull/3067
20
+ * Fix city address with number in `locales/fr/address.yml` by @brupla6126 in https://github.com/faker-ruby/faker/pull/3071
21
+ * Fix unclosed quote in `locales/en/cosmere.yml` by @bensheldon in https://github.com/faker-ruby/faker/pull/3075
22
+ * Remove inappropriate word from ja lorem by @se4weed in https://github.com/faker-ruby/faker/pull/3095
23
+ * Add mountains to de-CH locale by @codez in https://github.com/faker-ruby/faker/pull/3066
24
+ * Bump i18n from 1.14.6 to 1.14.7 by @dependabot in https://github.com/faker-ruby/faker/pull/3042
25
+
26
+ ### Chore
27
+ * ci: run against Ruby 3.4 by @thdaraujo in https://github.com/faker-ruby/faker/pull/3079
28
+ * Fix Broken CI by @wonderer007 in https://github.com/faker-ruby/faker/pull/3073
29
+
30
+ ### Update local dependencies
31
+ * Bump rubocop from 1.67.0 to 1.68.0 by @dependabot in https://github.com/faker-ruby/faker/pull/3020
32
+ * Bump rubocop from 1.68.0 to 1.69.2 by @dependabot in https://github.com/faker-ruby/faker/pull/3035
33
+ * Bump rubocop version + offenses fixes by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3053
34
+ * deps: update dev dependencies by @thdaraujo in https://github.com/faker-ruby/faker/pull/3078
35
+ * Bump rubocop-minitest and fix rubocop's offense by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3052
36
+ * Bump rubocop-minitest from 0.38.0 to 0.38.1 by @dependabot in https://github.com/faker-ruby/faker/pull/3088
37
+ * Bump rubocop-rake from 0.6.0 to 0.7.1 by @dependabot in https://github.com/faker-ruby/faker/pull/3059
38
+ * deps: bump `rubocop-minitest` from `0.37.1` to `0.38.0`. by @thdaraujo in https://github.com/faker-ruby/faker/pull/3080
39
+ * Bump minitest from 5.25.1 to 5.25.4 by @dependabot in https://github.com/faker-ruby/faker/pull/3031
40
+ * Bump test-unit from 3.6.2 to 3.6.7 by @dependabot in https://github.com/faker-ruby/faker/pull/3038
41
+ * Bump benchmark from 0.3.0 to 0.4.0 by @dependabot in https://github.com/faker-ruby/faker/pull/3021
42
+ * Bump benchmark from 0.4.0 to 0.4.1 by @dependabot in https://github.com/faker-ruby/faker/pull/3087
43
+ * Bump pry from 0.14.2 to 0.15.2 by @dependabot in https://github.com/faker-ruby/faker/pull/3039
44
+ * Bump rake from 13.2.1 to 13.3.0 by @dependabot in https://github.com/faker-ruby/faker/pull/3086
45
+ * Bump test-unit from 3.6.8 to 3.6.9 by @dependabot in https://github.com/faker-ruby/faker/pull/3096
46
+
47
+ ### New Contributors
48
+ * @brupla6126 made their first contribution in https://github.com/faker-ruby/faker/pull/3018
49
+ * @jaredsmithse made their first contribution in https://github.com/faker-ruby/faker/pull/3049
50
+ * @klaaspieter made their first contribution in https://github.com/faker-ruby/faker/pull/3050
51
+ * @jethrodaniel made their first contribution in https://github.com/faker-ruby/faker/pull/3060
52
+ * @daniel-nerdgeschoss made their first contribution in https://github.com/faker-ruby/faker/pull/3067
53
+ * @bensheldon made their first contribution in https://github.com/faker-ruby/faker/pull/3075
54
+ * @se4weed made their first contribution in https://github.com/faker-ruby/faker/pull/3095
55
+
56
+ **Full Changelog**: https://github.com/faker-ruby/faker/compare/v3.5.1...v3.5.2
57
+
58
+ ---------------------------------
59
+
3
60
  ## [v3.5.1](https://github.com/faker-ruby/faker/tree/v3.5.1) (2024-10-18)
4
61
 
5
62
  Happy October! 🎃
@@ -10,7 +67,7 @@ Besides that, this version removes deprecated generators, fixes some bugs, and a
10
67
 
11
68
  Thanks to all contributors!
12
69
 
13
- ## Breaking Changes
70
+ ### Breaking Changes
14
71
  * Drop support for Ruby 2.7 by @tatheerf02 in https://github.com/faker-ruby/faker/pull/3006
15
72
  * Removes deprecated generators by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3014
16
73
 
@@ -46,7 +103,7 @@ The following deprecated generators are being removed. Please use the new genera
46
103
  * Bump yard from 0.9.36 to 0.9.37 by @dependabot in https://github.com/faker-ruby/faker/pull/3000
47
104
  * Bump rubocop from 1.65.1 to 1.66.1 by @dependabot in https://github.com/faker-ruby/faker/pull/3001
48
105
 
49
- ## New Contributors
106
+ ### New Contributors
50
107
  * @murichristopher made their first contribution in https://github.com/faker-ruby/faker/pull/2960
51
108
  * @admtnnr made their first contribution in https://github.com/faker-ruby/faker/pull/2996
52
109
  * @dirschn made their first contribution in https://github.com/faker-ruby/faker/pull/3007
@@ -93,7 +150,7 @@ Breaking change was introduced in "Add test range param to NHS numbers" by @nean
93
150
  * Bump rubocop from 1.64.1 to 1.65.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2979
94
151
  * Bump rubocop-minitest from 0.35.0 to 0.35.1 by @dependabot in https://github.com/faker-ruby/faker/pull/2980
95
152
 
96
- ## New Contributors
153
+ ### New Contributors
97
154
  * @twk-mn made their first contribution in https://github.com/faker-ruby/faker/pull/2961
98
155
  * @neanias made their first contribution in https://github.com/faker-ruby/faker/pull/2947
99
156
  * @garrettgregor made their first contribution in https://github.com/faker-ruby/faker/pull/2963
@@ -136,7 +193,7 @@ Breaking change was introduced in "Add test range param to NHS numbers" by @nean
136
193
  * Bump minitest from 5.22.3 to 5.23.1 by @dependabot in https://github.com/faker-ruby/faker/pull/2957
137
194
  * Bump rubocop from 1.63.4 to 1.64.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2958
138
195
 
139
- ## New Contributors
196
+ ### New Contributors
140
197
 
141
198
  * @connie-feng made their first contribution in https://github.com/faker-ruby/faker/pull/2930
142
199
  * @andrelaszlo made their first contribution in https://github.com/faker-ruby/faker/pull/2927
@@ -291,7 +348,7 @@ This version:
291
348
  * Bump rubocop from 1.57.1 to 1.57.2 by @dependabot in https://github.com/faker-ruby/faker/pull/2844
292
349
  * Bump timecop from 0.9.6 to 0.9.8 by @dependabot in https://github.com/faker-ruby/faker/pull/2811
293
350
 
294
- ## New Contributors
351
+ ### New Contributors
295
352
  * @BelaBartok39 made their first contribution in https://github.com/faker-ruby/faker/pull/2812
296
353
  * @fernandomenolli made their first contribution in https://github.com/faker-ruby/faker/pull/2816
297
354
  * @hoshy made their first contribution in https://github.com/faker-ruby/faker/pull/2818
@@ -355,7 +412,7 @@ Other changes included in this version:
355
412
  * Update rubocop-minitest requirement from = 0.30.0 to = 0.31.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2759
356
413
  * Bump minitest from 5.18.1 to 5.19.0 by @dependabot in https://github.com/faker-ruby/faker/pull/2804
357
414
 
358
- ## New Contributors
415
+ ### New Contributors
359
416
  * @old-dead-account made their first contribution in https://github.com/faker-ruby/faker/pull/2742
360
417
  * @IvanReyesO7 made their first contribution in https://github.com/faker-ruby/faker/pull/2744
361
418
  * @DeepakRaj228 made their first contribution in https://github.com/faker-ruby/faker/pull/2741
@@ -422,7 +479,7 @@ Other changes included in this version:
422
479
  * Add Faker::Company.department generator by @acuppy in https://github.com/faker-ruby/faker/pull/2737
423
480
  * Update Pull Request template and guides by @stefannibrasil in https://github.com/faker-ruby/faker/pull/2749
424
481
 
425
- ## New Contributors
482
+ ### New Contributors
426
483
  * @lexisvar made their first contribution in https://github.com/faker-ruby/faker/pull/2699
427
484
  * @danieldiekmeier made their first contribution in https://github.com/faker-ruby/faker/pull/2700
428
485
  * @AaronRustad made their first contribution in https://github.com/faker-ruby/faker/pull/2706
data/README.md CHANGED
@@ -38,7 +38,7 @@ and it was the original impetus for the creation of this gem.
38
38
  - [Notes](#notes)
39
39
  - [Getting Started](#getting-started)
40
40
  - [Usage](#usage)
41
- - [A note about the Generators versions](#a-note-about-the-generators-versions)
41
+ - [A note about the Generators versions](#a-note-about-the-generators-versions)
42
42
  - [Ensuring unique values](#ensuring-unique-values)
43
43
  - [Deterministic Random](#deterministic-random)
44
44
  - [Customization](#customization)
@@ -89,7 +89,7 @@ Faker::ProgrammingLanguage.name #=> "Ruby"
89
89
 
90
90
  For a complete list of the generators, see [Generators](#generators).
91
91
 
92
- #### A note about the Generators versions
92
+ ### A note about the Generators versions
93
93
 
94
94
  If you get a `uninitialized constant Faker::[some_class]` error, your version of
95
95
  the gem is behind main.
@@ -168,6 +168,7 @@ module Faker
168
168
 
169
169
  # Reporting body identifier
170
170
  RBI = %w[01 10 30 33 35 44 45 49 50 51 52 53 54 86 91 98 99].freeze
171
+ private_constant :RBI
171
172
 
172
173
  def generate_imei
173
174
  str = Array.new(15, 0)
@@ -269,7 +270,10 @@ module Faker
269
270
  end
270
271
 
271
272
  EAN_CHECK_DIGIT8 = [3, 1, 3, 1, 3, 1, 3].freeze
273
+ private_constant :EAN_CHECK_DIGIT8
274
+
272
275
  EAN_CHECK_DIGIT13 = [1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3].freeze
276
+ private_constant :EAN_CHECK_DIGIT13
273
277
 
274
278
  def rut_verificator_digit(rut)
275
279
  total = rut.to_s.rjust(8, '0').chars.zip(%w[3 2 7 6 5 4 3 2]).collect { |a, b| a.to_i * b.to_i }.inject(:+)
@@ -494,7 +494,7 @@ module Faker
494
494
  # Construct taxpayer number
495
495
  gen.group(name: :taxpayer_number) do |g_|
496
496
  g_.letter(length: 3, ranges: ['A'..'Z'])
497
- g_.letter(length: 1, ranges: [%w[A B C F G H L J P T K]].to_a)
497
+ g_.letter(length: 1, ranges: [%w[A B C F G H L J P T K]])
498
498
  g_.letter(length: 1, ranges: ['A'..'Z'])
499
499
  g_.int(length: 4, ranges: [0..9999])
500
500
  g_.letter(length: 1, ranges: ['A'..'Z'])
@@ -104,7 +104,7 @@ module Faker
104
104
  end
105
105
  g.computed do
106
106
  gender_marker = gender == :female ? 50 : 0
107
- format('%02d', (dob.month + gender_marker))
107
+ format('%02d', dob.month + gender_marker)
108
108
  end
109
109
  g.computed do
110
110
  format('%02d', dob.day)
@@ -97,11 +97,11 @@ module Faker
97
97
  ##
98
98
  # Returns a random condominium fiscal code.
99
99
  #
100
- # @param country [String] Two capital letter country code to use for the vat number.
100
+ # @param country [String] Two capital letter country code to use for the condominium fiscal code number.
101
101
  # @return [String]
102
102
  #
103
103
  # @example
104
- # Faker::Finance.condominium_fiscal_code #=> "012345678"
104
+ # Faker::Finance.condominium_fiscal_code #=> "01234567890"
105
105
  #
106
106
  # @faker.version next
107
107
  def condominium_fiscal_code(country: 'IT')
@@ -267,7 +267,7 @@ module Faker
267
267
  # Faker::Internet.mac_address(prefix: 'aa:44') #=> "aa:44:30:88:6e:95"
268
268
  def mac_address(prefix: '')
269
269
  prefix_digits = prefix.split(':').map { |d| d.to_i(16) }
270
- address_digits = Array.new((6 - prefix_digits.size)) { rand(256) }
270
+ address_digits = Array.new(6 - prefix_digits.size) { rand(256) }
271
271
  (prefix_digits + address_digits).map { |d| format('%02x', d) }.join(':')
272
272
  end
273
273
 
@@ -13,8 +13,8 @@ module Faker
13
13
  # @return [Integer]
14
14
  #
15
15
  # @example
16
- # Faker::Finance.amount_between #=> 0
17
- # Faker::Finance.amount_between(0, 10) #=> 4.33
16
+ # Faker::Invoice.amount_between #=> 0
17
+ # Faker::Invoice.amount_between(from: 0, to: 10) #=> 4.33
18
18
  #
19
19
  # @faker.version 1.9.0
20
20
  def amount_between(from: 0, to: 0)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Faker
2
4
  class Json < Base
3
5
  require 'json'
@@ -104,17 +106,20 @@ module Faker
104
106
  end
105
107
 
106
108
  def add_hash(key_array, hash, width, options)
107
- string_to_eval = 'hash'
109
+ string_to_eval = 'hash'.dup
110
+
108
111
  key_array.length.times do |index|
109
112
  string_to_eval << "['#{key_array[index]}']"
110
113
  end
111
114
  string_to_eval << " = #{build_shallow_hash(width, options)}"
112
115
  eval(string_to_eval)
116
+
113
117
  hash
114
118
  end
115
119
 
116
120
  def build_keys_from_array(key_array)
117
- key_string = ''
121
+ key_string = ''.dup
122
+
118
123
  key_array.each do |value|
119
124
  key_string << "['#{value}']"
120
125
  end
@@ -20,8 +20,7 @@ module Faker
20
20
  # If the check digit is equivalent to 10, the number is invalid.
21
21
  # See https://en.wikipedia.org/wiki/NHS_number
22
22
  base_number -= 1 if check_digit(number: base_number) == 10
23
- "#{base_number}#{check_digit(number: base_number)}".to_s
24
- .chars
23
+ "#{base_number}#{check_digit(number: base_number)}".chars
25
24
  .insert(3, ' ')
26
25
  .insert(7, ' ')
27
26
  .join
@@ -45,7 +45,7 @@ module Faker
45
45
  private
46
46
 
47
47
  def generate_color
48
- format('%06x', (rand * 0xffffff))
48
+ format('%06x', rand * 0xffffff)
49
49
  end
50
50
  end
51
51
  end
data/lib/faker/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faker # :nodoc:
4
- VERSION = '3.5.1'
4
+ VERSION = '3.5.2'
5
5
  end
@@ -103,7 +103,7 @@ module Faker
103
103
  end
104
104
 
105
105
  def self.skip_warning?
106
- skip == true
106
+ @skip == true
107
107
  end
108
108
 
109
109
  def self.skip
@@ -4866,6 +4866,37 @@ de-CH:
4866
4866
  - Parsec
4867
4867
  - Kiloparsec
4868
4868
  - Megaparsec
4869
+ mountain:
4870
+ name:
4871
+ - Aletschhorn
4872
+ - Bietschhorn
4873
+ - Blüemlisalp
4874
+ - Chasseral
4875
+ - Dent Blanche
4876
+ - Dents du Midi
4877
+ - Dom
4878
+ - Dufourspitze
4879
+ - Finsteraarhorn
4880
+ - Grand Combin
4881
+ - Gurten
4882
+ - Jungfrau
4883
+ - Matterhorn
4884
+ - Grosser Mythen
4885
+ - Napf
4886
+ - Pilatus
4887
+ - Piz Bernina
4888
+ - Säntis
4889
+ - Silvrettahorn
4890
+ - Titlis
4891
+ - Tödi
4892
+ - Wildstrubel
4893
+ range:
4894
+ - Alpstein
4895
+ - Berner Alpen
4896
+ - Engadin
4897
+ - Gotthardmassiv
4898
+ - Jura
4899
+ - Walliser Alpen
4869
4900
  music:
4870
4901
  instruments:
4871
4902
  - Akkordeon
@@ -26,7 +26,7 @@ en:
26
26
  'Skybreaker', 'Stoneward', 'Truthwatcher', 'Willshaper', 'Windrunner'
27
27
  ]
28
28
  metals: [
29
- 'Steel', 'Iron', 'Pewter', 'Tin', 'Zinc', 'Brass', 'Copper', Bronze',
29
+ 'Steel', 'Iron', 'Pewter', 'Tin', 'Zinc', 'Brass', 'Copper', 'Bronze',
30
30
  'Duralumin', 'Aluminum', 'Nicrosil', 'Chromium', 'Gold', 'Electrum',
31
31
  'Cadmium', 'Bendalloy', 'Atium', 'Lerasium', 'Ettmetal', 'Malatium'
32
32
  ]
@@ -49,7 +49,7 @@ en:
49
49
  - /6771#########{5,6}L/
50
50
  - /6709#########{5,6}L/
51
51
  condominium_fiscal_code:
52
- IT: "#########"
52
+ IT: "###########"
53
53
  vat_number:
54
54
  AT: "ATU########"
55
55
  AR: "AR###########"
@@ -125,5 +125,5 @@ en:
125
125
  - "Ambience was good, service was no nonsense but friendly."
126
126
  - "Id have to say that each piece was fresh and had their own slight unique flavor twist to it, pushing the line between traditional edomae and fusion. The Hokkaido uni and the ocean trout topped with cook seaweed was the highlights of the meal. But each piece served was really something special."
127
127
  - "Staff was very accommodating but the chef were no nonsense. The ambiance is clean and tranquil which is perfect if youre looking to have a conversation with a date or a friend."
128
- - "My only critique would be that the rice could of used more vingaer and for them to use real wasabi. Also the variety of fish in stock wasnt a lot but hopefully that can change over time. The cost justify the quality youre getting. A solid 4 stars."
128
+ - "My only critique would be that the rice could of used more vinegar and for them to use real wasabi. Also the variety of fish in stock wasnt a lot but hopefully that can change over time. The cost justify the quality youre getting. A solid 4 stars."
129
129
  - "In terms of omakase, they had a few options but the one we chose was the 87 dollar version which include sashimi and sushi."
@@ -341,14 +341,23 @@ en-PAK:
341
341
  - Punjab
342
342
  - Sindh
343
343
  - Islamabad Capital Territory
344
- - Federally Administered Tribal Areas
345
344
  - Azad Jammu and Kashmir
346
345
  - Gilgit-Baltistan
346
+ state_abbr:
347
+ - BA
348
+ - KPK
349
+ - PB
350
+ - SD
351
+ - ICT
352
+ - AJK
353
+ - GB
347
354
  default_country:
348
355
  - Pakistan
349
356
  - Islamic Republic of Pakistan
350
357
  default_country_code:
351
358
  - PK
359
+ default_time_zone:
360
+ - Asia/Karachi
352
361
  internet:
353
362
  domain_suffix:
354
363
  - pk
@@ -376,3 +385,17 @@ en-PAK:
376
385
  - "##########"
377
386
  - "### #######"
378
387
  - 03##-#######
388
+ cell_phone:
389
+ formats:
390
+ - "0311#######"
391
+ - "0312#######"
392
+ - "0313#######"
393
+ - "0314#######"
394
+ - "0315#######"
395
+ - "0300#######"
396
+ - "0301#######"
397
+ - "0321#######"
398
+ - "0322#######"
399
+ - "0345#######"
400
+ - "0346#######"
401
+ - "0346#######"