Skip to content

Commit f971d48

Browse files
authored
Merge branch 'main' into de-ch-mountains
2 parents c2cb3f8 + 898dbd8 commit f971d48

22 files changed

+74
-63
lines changed

.github/workflows/ruby.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@v3
2525
- uses: ruby/setup-ruby@v1
2626
with:
27-
ruby-version: '3.0'
27+
ruby-version: '3.4'
2828

2929
- name: Install dependencies
3030
run: bundle install
@@ -42,6 +42,7 @@ jobs:
4242
- '3.1'
4343
- '3.2'
4444
- '3.3'
45+
- '3.4'
4546
- 'head'
4647
- truffleruby-head
4748
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}

.rubocop.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require:
1+
plugins:
22
- rubocop-minitest
33
- rubocop-rake
44

@@ -78,9 +78,6 @@ Style/FormatStringToken:
7878

7979
Style/FrozenStringLiteralComment:
8080
Description: Add the frozen_string_literal comment to the top of files to help transition from Ruby 2.3.0 to Ruby 3.0.
81-
Exclude:
82-
- 'lib/faker/default/json.rb'
83-
- 'test/faker/default/test_faker_json.rb'
8481

8582
Style/For:
8683
Description: Checks use of for or each in multiline loops.

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ source 'https://rubygems.org'
66
gemspec
77

88
gem 'benchmark'
9-
gem 'minitest', '5.25.4'
9+
gem 'minitest', '5.25.5'
1010
gem 'pry', '0.15.2'
1111
gem 'rake', '13.2.1'
12-
gem 'rubocop', '1.73.0'
13-
gem 'rubocop-minitest', '0.37.0'
12+
gem 'rubocop', '1.75.4'
13+
gem 'rubocop-minitest', '0.38.0'
1414
gem 'rubocop-rake', '0.7.1'
1515
gem 'simplecov', '0.22.0'
16-
gem 'test-unit', '3.6.7'
16+
gem 'test-unit', '3.6.8'
1717
gem 'timecop', '0.9.10'
1818
gem 'yard', '0.9.37'

Gemfile.lock

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,48 @@ PATH
77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
ast (2.4.2)
10+
ast (2.4.3)
1111
benchmark (0.4.0)
1212
coderay (1.1.3)
1313
concurrent-ruby (1.3.5)
14-
docile (1.4.0)
14+
docile (1.4.1)
1515
i18n (1.14.7)
1616
concurrent-ruby (~> 1.0)
17-
json (2.10.1)
17+
json (2.11.3)
1818
language_server-protocol (3.17.0.4)
1919
lint_roller (1.1.0)
2020
method_source (1.1.0)
21-
minitest (5.25.4)
22-
parallel (1.26.3)
23-
parser (3.3.7.1)
21+
minitest (5.25.5)
22+
parallel (1.27.0)
23+
parser (3.3.8.0)
2424
ast (~> 2.4.1)
2525
racc
2626
power_assert (2.0.5)
27+
prism (1.4.0)
2728
pry (0.15.2)
2829
coderay (~> 1.1)
2930
method_source (~> 1.0)
3031
racc (1.8.1)
3132
rainbow (3.1.1)
3233
rake (13.2.1)
3334
regexp_parser (2.10.0)
34-
rubocop (1.73.0)
35+
rubocop (1.75.4)
3536
json (~> 2.3)
3637
language_server-protocol (~> 3.17.0.2)
3738
lint_roller (~> 1.1.0)
3839
parallel (~> 1.10)
3940
parser (>= 3.3.0.2)
4041
rainbow (>= 2.2.2, < 4.0)
4142
regexp_parser (>= 2.9.3, < 3.0)
42-
rubocop-ast (>= 1.38.0, < 2.0)
43+
rubocop-ast (>= 1.44.0, < 2.0)
4344
ruby-progressbar (~> 1.7)
4445
unicode-display_width (>= 2.4.0, < 4.0)
45-
rubocop-ast (1.38.1)
46-
parser (>= 3.3.1.0)
47-
rubocop-minitest (0.37.0)
46+
rubocop-ast (1.44.1)
47+
parser (>= 3.3.7.2)
48+
prism (~> 1.4)
49+
rubocop-minitest (0.38.0)
4850
lint_roller (~> 1.1)
49-
rubocop (>= 1.61, < 2.0)
51+
rubocop (>= 1.75.0, < 2.0)
5052
rubocop-ast (>= 1.38.0, < 2.0)
5153
rubocop-rake (0.7.1)
5254
lint_roller (~> 1.1)
@@ -56,9 +58,9 @@ GEM
5658
docile (~> 1.1)
5759
simplecov-html (~> 0.11)
5860
simplecov_json_formatter (~> 0.1)
59-
simplecov-html (0.12.3)
61+
simplecov-html (0.13.1)
6062
simplecov_json_formatter (0.1.4)
61-
test-unit (3.6.7)
63+
test-unit (3.6.8)
6264
power_assert
6365
timecop (0.9.10)
6466
unicode-display_width (3.1.4)
@@ -73,14 +75,14 @@ PLATFORMS
7375
DEPENDENCIES
7476
benchmark
7577
faker!
76-
minitest (= 5.25.4)
78+
minitest (= 5.25.5)
7779
pry (= 0.15.2)
7880
rake (= 13.2.1)
79-
rubocop (= 1.73.0)
80-
rubocop-minitest (= 0.37.0)
81+
rubocop (= 1.75.4)
82+
rubocop-minitest (= 0.38.0)
8183
rubocop-rake (= 0.7.1)
8284
simplecov (= 0.22.0)
83-
test-unit (= 3.6.7)
85+
test-unit (= 3.6.8)
8486
timecop (= 0.9.10)
8587
yard (= 0.9.37)
8688

lib/faker/default/code.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def sin
168168

169169
# Reporting body identifier
170170
RBI = %w[01 10 30 33 35 44 45 49 50 51 52 53 54 86 91 98 99].freeze
171+
private_constant :RBI
171172

172173
def generate_imei
173174
str = Array.new(15, 0)
@@ -269,7 +270,10 @@ def generate_base13_ean
269270
end
270271

271272
EAN_CHECK_DIGIT8 = [3, 1, 3, 1, 3, 1, 3].freeze
273+
private_constant :EAN_CHECK_DIGIT8
274+
272275
EAN_CHECK_DIGIT13 = [1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3].freeze
276+
private_constant :EAN_CHECK_DIGIT13
273277

274278
def rut_verificator_digit(rut)
275279
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(:+)

lib/faker/default/driving_licence.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def gb_licence_year(dob, gender)
104104
end
105105
g.computed do
106106
gender_marker = gender == :female ? 50 : 0
107-
format('%02d', (dob.month + gender_marker))
107+
format('%02d', dob.month + gender_marker)
108108
end
109109
g.computed do
110110
format('%02d', dob.day)

lib/faker/default/internet.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def domain_suffix(safe: nil)
267267
# Faker::Internet.mac_address(prefix: 'aa:44') #=> "aa:44:30:88:6e:95"
268268
def mac_address(prefix: '')
269269
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) }
271271
(prefix_digits + address_digits).map { |d| format('%02x', d) }.join(':')
272272
end
273273

lib/faker/default/json.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Faker
24
class Json < Base
35
require 'json'
@@ -104,17 +106,20 @@ def add_hash_to_bottom(hash, key_array, width, options)
104106
end
105107

106108
def add_hash(key_array, hash, width, options)
107-
string_to_eval = 'hash'
109+
string_to_eval = 'hash'.dup
110+
108111
key_array.length.times do |index|
109112
string_to_eval << "['#{key_array[index]}']"
110113
end
111114
string_to_eval << " = #{build_shallow_hash(width, options)}"
112115
eval(string_to_eval)
116+
113117
hash
114118
end
115119

116120
def build_keys_from_array(key_array)
117-
key_string = ''
121+
key_string = ''.dup
122+
118123
key_array.each do |value|
119124
key_string << "['#{value}']"
120125
end

lib/faker/default/placeholdit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def image(size: '300x300', format: 'png', background_color: nil, text_color: nil
4545
private
4646

4747
def generate_color
48-
format('%06x', (rand * 0xffffff))
48+
format('%06x', rand * 0xffffff)
4949
end
5050
end
5151
end

lib/locales/en/cosmere.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ en:
2626
'Skybreaker', 'Stoneward', 'Truthwatcher', 'Willshaper', 'Windrunner'
2727
]
2828
metals: [
29-
'Steel', 'Iron', 'Pewter', 'Tin', 'Zinc', 'Brass', 'Copper', Bronze',
29+
'Steel', 'Iron', 'Pewter', 'Tin', 'Zinc', 'Brass', 'Copper', 'Bronze',
3030
'Duralumin', 'Aluminum', 'Nicrosil', 'Chromium', 'Gold', 'Electrum',
3131
'Cadmium', 'Bendalloy', 'Atium', 'Lerasium', 'Ettmetal', 'Malatium'
3232
]

0 commit comments

Comments
 (0)