faker 3.6.0 → 3.7.1

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: 93fd1390fde066edf506ec3222f2e26a42a038fe9a7065c13bb2b085d1ec34ab
4
- data.tar.gz: f34ed750ff9f8bf3e89db66a94e99ecd83518bc0f96e39faf0254e43a2dab328
3
+ metadata.gz: 78d4c5b5bfa5fdebf9bf09a55173557109e4e55ca1fdd6458a065157d5d3a380
4
+ data.tar.gz: cdd36c405854936c9281c0c181194c12765956d36b2ff91a20520f308c4a1a71
5
5
  SHA512:
6
- metadata.gz: b5dda78d9ef08db5a8cfd572d9d2cb7983db27c17122468239dd4dea53cba2581bec484f604c4a2a67eee4ca23ba3406c327dbfc2377fd3a1cb6c6126ce56228
7
- data.tar.gz: dbfaa6124b325fa82b240e77b8bf3e49e1f29b55d6f8ccbd12aab57746a7c6f01948b58825f041397540808f7c400ebc3d92dc17528ed928ca1c19becec4ef7f
6
+ metadata.gz: c09170d534ec923fd18fca0c4d21e6f1c76c85f9fe83b7d98b3e8695263c3f446ff6f0576e52b0f99b7ac75381b2c7585b80b9a29d9bb29200465267fbfe7337
7
+ data.tar.gz: e2cdc970656cc8abddc2bacf5219262be2fd4ae4a22dcaaf3279028fb7d67fa0f4b5db149f63ca72337e4022a50a51c38074960a390beb69ec05cf62860cc2e2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,64 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.7.1](https://github.com/faker-ruby/faker/tree/v3.7.1) (2026-04-14)
4
+
5
+ Thanks to all contributors!
6
+
7
+ ### Drops support for Ruby 3.1
8
+
9
+ * Drop support for Ruby EOL 3.1 by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3240
10
+
11
+ ### What's changed
12
+
13
+ * Remove json_schema and public-suffix versions constraint by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3224
14
+ * Added additional football teams by @John222 in https://github.com/faker-ruby/faker/pull/3231
15
+ * Remove duplicate 'Recalled to Life' book title by @gkrimer in https://github.com/faker-ruby/faker/pull/3238
16
+
17
+ ### Update development dependencies
18
+
19
+ * Bump yard from 0.9.38 to 0.9.40 by @dependabot[bot] in https://github.com/faker-ruby/faker/pull/3237
20
+ * Bump timecop from 0.9.10 to 0.9.11 by @dependabot[bot] in https://github.com/faker-ruby/faker/pull/3236
21
+ * Bump rubocop from 1.85.1 to 1.86.1 by @dependabot[bot] in https://github.com/faker-ruby/faker/pull/3235
22
+
23
+ ### New Contributors
24
+ * @John222 made their first contribution in https://github.com/faker-ruby/faker/pull/3231
25
+ * @gkrimer made their first contribution in https://github.com/faker-ruby/faker/pull/3238
26
+
27
+ **Full Changelog**: https://github.com/faker-ruby/faker/compare/v3.6.1...v3.7.1
28
+
29
+ ## [v3.6.1](https://github.com/faker-ruby/faker/tree/v3.6.1) (2026-03-04)
30
+
31
+ It's almost Spring time in the Northern hemisphere 🌸
32
+
33
+ ### Security, performance improvements and bug fixes
34
+
35
+ * fix: polynomial regex on uncontrolled input by @thdaraujo in https://github.com/faker-ruby/faker/pull/3196
36
+ * perf: replaces list of postcodes in `ja/address.yml` with a 7-digit format by @thdaraujo in https://github.com/faker-ruby/faker/pull/3201
37
+ * Remove unnecessary whitespace from code blocks in READMEs by @ryotaro-shirai in https://github.com/faker-ruby/faker/pull/3209
38
+ * Document lazy load experiment results by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3205
39
+ * [skip ci] Add-backtick by @OzuAkira in https://github.com/faker-ruby/faker/pull/3210
40
+ * Zeitwerk experiment changes and results [skip ci] by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3213
41
+ * Remove duplicate reference link in README.md by @yutasb in https://github.com/faker-ruby/faker/pull/3217
42
+
43
+ ### Update development dependencies
44
+
45
+ * Bump rubocop from 1.84.0 to 1.84.1 by @dependabot[bot] in https://github.com/faker-ruby/faker/pull/3202
46
+ * Bump irb from 1.16.0 to 1.17.0 by @dependabot[bot] in https://github.com/faker-ruby/faker/pull/3203
47
+ * Bump rubocop version and fix offenses by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3198
48
+ * Bump rdoc from 7.1.0 to 7.2.0 by @dependabot[bot] in https://github.com/faker-ruby/faker/pull/3204
49
+ * Bump rubocop to 1.84.2 by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3215
50
+ * Bump rubocop-minitest from 0.38.2 to 0.39.1 by @dependabot[bot] in https://github.com/faker-ruby/faker/pull/3216
51
+ * Bump rubocop to v1.85.0 by @stefannibrasil in https://github.com/faker-ruby/faker/pull/3220
52
+
53
+ ### New Contributors
54
+ * @ryotaro-shirai made their first contribution in https://github.com/faker-ruby/faker/pull/3209
55
+ * @OzuAkira made their first contribution in https://github.com/faker-ruby/faker/pull/3210
56
+ * @yutasb made their first contribution in https://github.com/faker-ruby/faker/pull/3217
57
+
58
+ **Full Changelog**: https://github.com/faker-ruby/faker/compare/v3.6.0...v3.6.1
59
+
60
+ ---------------------------------
61
+
3
62
  ## [v3.6.0](https://github.com/faker-ruby/faker/tree/v3.6.0) (2026-01-21)
4
63
 
5
64
  First release of the new year!
data/README.md CHANGED
@@ -11,7 +11,6 @@
11
11
  [github-actions]: https://github.com/faker-ruby/faker/actions
12
12
  [downloads-total]: https://img.shields.io/gem/dt/faker.svg
13
13
  [downloads-badge]: https://img.shields.io/gem/dtv/faker.svg
14
- [downloads-badge]: https://img.shields.io/gem/dtv/faker.svg
15
14
 
16
15
  ## Quick links
17
16
 
@@ -157,7 +156,7 @@ To prevent Faker (version >= 2.22) from [generating duplicate values](https://gi
157
156
  you might need to add the following to the `test_helper.rb` or `rails_helper.rb` file:
158
157
 
159
158
  ```ruby
160
- Faker::Config.random = Random.new
159
+ Faker::Config.random = Random.new
161
160
  ```
162
161
 
163
162
  ## Generators
@@ -61,11 +61,11 @@ module Faker
61
61
  # Faker::DrivingLicence.uk_driving_licence #=> "70702548"
62
62
  #
63
63
  # @faker.version 1.9.2
64
- def uk_driving_licence(*args)
64
+ def uk_driving_licence(*)
65
65
  if Faker::Config.random.rand < NI_CHANCE
66
66
  northern_irish_driving_licence
67
67
  else
68
- british_driving_licence(*args)
68
+ british_driving_licence(*)
69
69
  end
70
70
  end
71
71
 
@@ -137,7 +137,7 @@ module Faker
137
137
  Faker::Number.number(digits: 2),
138
138
  Faker::Number.between(from: 13, to: 99),
139
139
  Faker::Number.between(from: 32, to: 99)
140
- ].map(&:to_s).join
140
+ ].join
141
141
 
142
142
  id_number = [
143
143
  invalid_date_of_birth,
@@ -24,7 +24,7 @@ module Faker
24
24
  private
25
25
 
26
26
  def select_a(length)
27
- if length.class.included_modules.include? Enumerable
27
+ if length.class.include?(Enumerable)
28
28
  select_a sample(length.to_enum.to_a)
29
29
  else
30
30
  length # recursive base case
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.6.0'
4
+ VERSION = '3.7.1'
5
5
  end
data/lib/faker.rb CHANGED
@@ -95,12 +95,12 @@ module Faker
95
95
  reg
96
96
  .gsub(%r{^/?\^?}, '').gsub(%r{\$?/?$}, '') # Ditch the anchors
97
97
  .gsub(/\{(\d+)\}/, '{\1,\1}').gsub('?', '{0,1}') # All {2} become {2,2} and ? become {0,1}
98
- .gsub(/(\[[^\]]+\])\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # [12]{1,2} becomes [12] or [12][12]
99
- .gsub(/(\([^)]+\))\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # (12|34){1,2} becomes (12|34) or (12|34)(12|34)
100
- .gsub(/(\\?.)\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # A{1,2} becomes A or AA or \d{3} becomes \d\d\d
101
- .gsub(/\((.*?)\)/) { |match| sample(match.gsub(/[()]/, '').split('|')) } # (this|that) becomes 'this' or 'that'
102
- .gsub(/\[([^\]]+)\]/) { |match| match.gsub(/(\w-\w)/) { |range| sample(Array(Range.new(*range.split('-')))) } } # All A-Z inside of [] become C (or X, or whatever)
103
- .gsub(/\[([^\]]+)\]/) { |_match| sample(Regexp.last_match(1).chars) } # All [ABC] become B (or A or C)
98
+ .gsub(/(\[[^\]]++\])\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # [12]{1,2} becomes [12] or [12][12]
99
+ .gsub(/(\([^)]++\))\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # (12|34){1,2} becomes (12|34) or (12|34)(12|34)
100
+ .gsub(/(\\?.)\{(\d+),(\d+)\}/) { |_match| Regexp.last_match(1) * sample(Array(Range.new(Regexp.last_match(2).to_i, Regexp.last_match(3).to_i))) } # A{1,2} becomes A or AA or \d{3} becomes \d\d\d
101
+ .gsub(/\((.*?)\)/) { |match| sample(match.gsub(/[()]/, '').split('|')) } # (this|that) becomes 'this' or 'that'
102
+ .gsub(/\[([^\]]++)\]/) { |match| match.gsub(/(\w-\w)/) { |range| sample(Array(Range.new(*range.split('-')))) } } # All A-Z inside of [] become C (or X, or whatever)
103
+ .gsub(/\[([^\]]++)\]/) { |_match| sample(Regexp.last_match(1).chars) } # All [ABC] become B (or A or C)
104
104
  .gsub('\d') { |_match| sample(Numbers) }
105
105
  .gsub('\w') { |_match| sample(Letters) }
106
106
  end
@@ -133,7 +133,8 @@ module Faker
133
133
  # formatted translation: e.g., "#{first_name} #{last_name}".
134
134
  def parse(key)
135
135
  fetched = fetch(key)
136
- parts = fetched.scan(/(\(?)#\{([A-Za-z]+\.)?([^}]+)\}([^#]+)?/).map do |prefix, kls, meth, etc|
136
+
137
+ parts = fetched.scan(/(\(?)#\{([A-Za-z]+\.)?([^}]+)\}([^#]++)?/).map do |prefix, kls, meth, etc|
137
138
  # If the token had a class Prefix (e.g., Name.first_name)
138
139
  # grab the constant, otherwise use self
139
140
  cls = kls ? Faker.const_get(kls.chop) : self
@@ -278,8 +278,6 @@ class PositionalGenerator
278
278
  # [2]
279
279
  # ]
280
280
  def build_stack(graph)
281
- require 'set'
282
-
283
281
  terminals = graph.filter_map { |(from, to)| to.nil? && from }
284
282
  stack = [terminals]
285
283
  seen = Set.new(terminals)
@@ -30,7 +30,7 @@ module Faker
30
30
  method_name.to_s.start_with?('faker_') || super
31
31
  end
32
32
 
33
- RetryLimitExceeded = Class.new(StandardError)
33
+ class RetryLimitExceeded < StandardError; end
34
34
 
35
35
  def previous_results
36
36
  Thread.current[:faker_unique_generator_previous_results] ||= {}
@@ -20,7 +20,7 @@ Faker::Hipster.word #=> "kogi"
20
20
 
21
21
  ## How to update a locale with more translations
22
22
 
23
- To update a locale with more translation features, simply add a new field to the .yml file that corresponds to an existing piece of functionality in the "en.yml" file. In this example, that would mean providing Chinese hipster words.
23
+ To update a locale with more translation features, simply add a new field to the `.yml` file that corresponds to an existing piece of functionality in the "en.yml" file. In this example, that would mean providing Chinese hipster words.
24
24
 
25
25
  ```yaml
26
26
  # /lib/locales/zh-CN.yml
@@ -52,5 +52,5 @@ Faker::Config.default_locale = :pt
52
52
  In threaded server environments, e.g., Puma, locale per thread can be set as the following:
53
53
 
54
54
  ```ruby
55
- Faker::Config.locale = :es
55
+ Faker::Config.locale = :es
56
56
  ```
@@ -139,7 +139,6 @@ en:
139
139
  - The Proper Study
140
140
  - Quo Vadis
141
141
  - Recalled to Life
142
- - Recalled to Life
143
142
  - Ring of Bright Water
144
143
  - The Road Less Traveled
145
144
  - A Scanner Darkly
@@ -23,6 +23,15 @@ en:
23
23
  - PSV Eindhoven
24
24
  - LA Galaxy
25
25
  - Paris Saint Germain
26
+ - FC Porto
27
+ - Manchester City
28
+ - Sporting
29
+ - Atalanta
30
+ - Villareal
31
+ - Lyon
32
+ - AS Monaco
33
+ - Bayer 04 Leverkusen
34
+ - Aston Villa
26
35
  players:
27
36
  - Lionel Messi
28
37
  - Gerard Pique