From 28a80141e998895fd396485a6406ec7dd7c5bf57 Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Wed, 7 Jan 2026 12:50:32 -0700 Subject: [PATCH 1/2] 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. --- .github/workflows/ruby.yml | 10 ++-------- .rubocop.yml | 2 +- faker.gemspec | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 15c20cd888..2cc35fde6d 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -38,11 +38,11 @@ jobs: fail-fast: false # don't fail all matrix builds if one fails matrix: ruby: - - '3.0' - '3.1' - '3.2' - '3.3' - '3.4' + - '4.0' - 'head' - truffleruby-head continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} @@ -53,13 +53,7 @@ jobs: ruby-version: ${{ matrix.ruby }} - name: Install dependencies - run: | - if [[ "${{ matrix.ruby }}" < "3.1" ]]; then - gem install bundler:2.4.22 - bundle _2.4.22_ install - else - bundle install - fi + run: bundle install - name: Run tests run: bundle exec rake test diff --git a/.rubocop.yml b/.rubocop.yml index 8e415bdc85..a0e62b8292 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,7 +3,7 @@ plugins: - rubocop-rake AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 NewCops: enable # Suppress noise for obvious operator precedence. diff --git a/faker.gemspec b/faker.gemspec index b13fed9e55..9455a5e572 100644 --- a/faker.gemspec +++ b/faker.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.bindir = 'bin' spec.executables = ['faker'] spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 3.0' + spec.required_ruby_version = '>= 3.1' spec.metadata['changelog_uri'] = 'https://github.com/faker-ruby/faker/blob/main/CHANGELOG.md' spec.metadata['source_code_uri'] = 'https://github.com/faker-ruby/faker' From 9927436c3de02415cedb3b6b4777c88123b0841f Mon Sep 17 00:00:00 2001 From: Stefanni Brasil Date: Wed, 7 Jan 2026 12:55:35 -0700 Subject: [PATCH 2/2] Fix Rubocop offenses We can now anonymously forward blocks in Ruby > 3.1 :) --- lib/faker.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/faker.rb b/lib/faker.rb index 5e5bb5924e..4c2a487a46 100644 --- a/lib/faker.rb +++ b/lib/faker.rb @@ -65,8 +65,8 @@ def bothify(string) letterify(numerify(string)) end - def generate(as_type, &block) - PositionalGenerator.new(as_type, &block).generate + def generate(as_type, &) + PositionalGenerator.new(as_type, &).generate end # Given a regular expression, attempt to generate a string @@ -195,7 +195,7 @@ def flexible(key) # name: # girls_name: ["Alice", "Cheryl", "Tatiana"] # Then you can call Faker::Name.girls_name and it will act like #first_name - def method_missing(mth, *args, &block) + def method_missing(mth, *args, &) super unless flexible_key if (translation = translate("faker.#{flexible_key}.#{mth}"))