Skip to content

Commit 92186cd

Browse files
Drop support for Ruby EOL 3.0 (#3167)
* Drop support for Ruby 3.0 Ruby 3.0 is not maintained anymore. Following our Maintaining guidelines, we aim to support only one EOL version at a time. The minimum Ruby version is going to be 3.1. * Fix Rubocop offenses We can now anonymously forward blocks in Ruby > 3.1 :)
1 parent 9aafdd4 commit 92186cd

4 files changed

Lines changed: 7 additions & 13 deletions

File tree

.github/workflows/ruby.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
fail-fast: false # don't fail all matrix builds if one fails
3939
matrix:
4040
ruby:
41-
- '3.0'
4241
- '3.1'
4342
- '3.2'
4443
- '3.3'
4544
- '3.4'
45+
- '4.0'
4646
- 'head'
4747
- truffleruby-head
4848
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
@@ -53,13 +53,7 @@ jobs:
5353
ruby-version: ${{ matrix.ruby }}
5454

5555
- name: Install dependencies
56-
run: |
57-
if [[ "${{ matrix.ruby }}" < "3.1" ]]; then
58-
gem install bundler:2.4.22
59-
bundle _2.4.22_ install
60-
else
61-
bundle install
62-
fi
56+
run: bundle install
6357

6458
- name: Run tests
6559
run: bundle exec rake test

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins:
33
- rubocop-rake
44

55
AllCops:
6-
TargetRubyVersion: 3.0
6+
TargetRubyVersion: 3.1
77
NewCops: enable
88

99
# Suppress noise for obvious operator precedence.

faker.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
1919
spec.bindir = 'bin'
2020
spec.executables = ['faker']
2121
spec.require_paths = ['lib']
22-
spec.required_ruby_version = '>= 3.0'
22+
spec.required_ruby_version = '>= 3.1'
2323

2424
spec.metadata['changelog_uri'] = 'https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md'
2525
spec.metadata['source_code_uri'] = 'https://github.com/faker-ruby/faker'

lib/faker.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def bothify(string)
6565
letterify(numerify(string))
6666
end
6767

68-
def generate(as_type, &block)
69-
PositionalGenerator.new(as_type, &block).generate
68+
def generate(as_type, &)
69+
PositionalGenerator.new(as_type, &).generate
7070
end
7171

7272
# Given a regular expression, attempt to generate a string
@@ -195,7 +195,7 @@ def flexible(key)
195195
# name:
196196
# girls_name: ["Alice", "Cheryl", "Tatiana"]
197197
# Then you can call Faker::Name.girls_name and it will act like #first_name
198-
def method_missing(mth, *args, &block)
198+
def method_missing(mth, *args, &)
199199
super unless flexible_key
200200

201201
if (translation = translate("faker.#{flexible_key}.#{mth}"))

0 commit comments

Comments
 (0)