Skip to content

Commit

Permalink
fix #2885: Set target ruby version to 3.0 and remove references to 2.7
Browse files Browse the repository at this point in the history
Co-authored-by: Ayana Siddiqui [email protected]
  • Loading branch information
tatheerf02 committed Oct 16, 2024
1 parent b5a034c commit be56200
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.0'

- name: Install dependencies
run: bundle install
Expand All @@ -38,7 +38,6 @@ jobs:
fail-fast: false # don't fail all matrix builds if one fails
matrix:
ruby:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require:
- rubocop-rake

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0
NewCops: enable

# Suppress noise for obvious operator precedence.
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you're reviewing a PR, ask yourself:
## Managing libraries dependencies EOL

As a guideline for Ruby's End of Life (EOL) versions, a good heuristic (that's not too hard on maintainers) is to keep support for 1 EOL version.
In other words, once Ruby 3.0 is EOL, drop support for 2.7.
In other words, once Ruby 3.1 is EOL, drop support for 3.0.

## Security

Expand Down
2 changes: 1 addition & 1 deletion faker.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.bindir = 'bin'
spec.executables = ['faker']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.7'
spec.required_ruby_version = '>= 3.0'

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'
Expand Down
4 changes: 2 additions & 2 deletions lib/faker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'psych'
require 'i18n'

Dir.glob(File.join(mydir, 'helpers', '*.rb')).sort.each { |file| require file }
Dir.glob(File.join(mydir, 'helpers', '*.rb')).each { |file| require file }

I18n.load_path += Dir[File.join(mydir, 'locales', '**/*.yml')]

Expand Down Expand Up @@ -275,4 +275,4 @@ def disable_enforce_available_locales
end

# require faker objects
Dir.glob(File.join(mydir, 'faker', '/**/*.rb')).sort.each { |file| require file }
Dir.glob(File.join(mydir, 'faker', '/**/*.rb')).each { |file| require file }
2 changes: 1 addition & 1 deletion lib/faker/default/id_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class IdNumber < Base
].freeze
ZA_RACE_DIGIT = '8'
ZA_CITIZENSHIP_DIGITS = %w[0 1].freeze
BRAZILIAN_ID_FORMAT = /(\d{1,2})(\d{3})(\d{3})([\dX])/.freeze
BRAZILIAN_ID_FORMAT = /(\d{1,2})(\d{3})(\d{3})([\dX])/
BRAZILIAN_ID_FROM = 10_000_000
BRAZILIAN_ID_TO = 99_999_999

Expand Down
6 changes: 3 additions & 3 deletions test/faker/default/test_faker_crypto_coin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class TestFakerCryptoCoin < Test::Unit::TestCase
ACRONYM = 1
URL_LOGO = 2

REGEX_COIN_NAME = /[a-zA-Z .]{3,}/.freeze
REGEX_ACRONYM = /\w+{3,}/.freeze
REGEX_URL_LOGO = /^https:\/\/i.imgur.com\/.......\./.freeze
REGEX_COIN_NAME = /[a-zA-Z .]{3,}/
REGEX_ACRONYM = /\w+{3,}/
REGEX_URL_LOGO = /^https:\/\/i.imgur.com\/.......\./

def setup
@tester = Faker::CryptoCoin
Expand Down
4 changes: 2 additions & 2 deletions test/faker/default/test_faker_vehicle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_relative '../../test_helper'

class TestFakerVehicle < Test::Unit::TestCase
WORD_MATCH = /\w+\.?/.freeze
VIN_REGEX = /\A[A-HJ-NPR-Z0-9]{17}\z/.freeze
WORD_MATCH = /\w+\.?/
VIN_REGEX = /\A[A-HJ-NPR-Z0-9]{17}\z/

def setup
@tester = Faker::Vehicle
Expand Down

0 comments on commit be56200

Please sign in to comment.