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' 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}"))