Skip to content

Commit

Permalink
Merge pull request #634 from mjankowski/more-ruby-version-stuff
Browse files Browse the repository at this point in the history
Restore 3.0 to CI, bump gemspec
  • Loading branch information
searls authored Jun 17, 2024
2 parents 5156402 + 7cf2d26 commit 75852ca
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
matrix:
os: [ubuntu-latest]
ruby-version:
- '3.0'
- '3.1'
- '3.2'
- '3.3'
Expand Down
4 changes: 2 additions & 2 deletions config/default.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AllCops:
# Prevent RuboCop from exploding when it finds an older-than-2.6 .ruby-version
TargetRubyVersion: 2.6
# Prevent RuboCop from exploding when it finds an older .ruby-version
TargetRubyVersion: 3.0
Exclude: []
DisabledByDefault: true
StyleGuideBaseURL: https://github.com/standardrb/standard
Expand Down
2 changes: 1 addition & 1 deletion config/ruby-3.2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
inherit_from: ./base.yml
inherit_from: ./ruby-3.3.yml

AllCops:
TargetRubyVersion: 3.2
4 changes: 4 additions & 0 deletions config/ruby-3.3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
inherit_from: ./base.yml

AllCops:
TargetRubyVersion: 3.3
2 changes: 2 additions & 0 deletions lib/standard/base/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def determine_yaml_path(desired_version)
"ruby-3.1.yml"
elsif desired_version < Gem::Version.new("3.3")
"ruby-3.2.yml"
elsif desired_version < Gem::Version.new("3.4")
"ruby-3.3.yml"
else
default
end
Expand Down
2 changes: 1 addition & 1 deletion standard.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
spec.version = Standard::VERSION
spec.authors = ["Justin Searls"]
spec.email = ["[email protected]"]
spec.required_ruby_version = ">= 2.6.0"
spec.required_ruby_version = ">= 3.0.0"

spec.summary = "Ruby Style Guide, with linter & automatic code fixer"
spec.homepage = "https://github.com/standardrb/standard"
Expand Down
3 changes: 2 additions & 1 deletion test/standard/base/plugin_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def setup
end

def test_paths
assert_match "base.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.3.0")).value.to_s
assert_match "base.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.4.0")).value.to_s
assert_match "ruby-3.3.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.3.3")).value.to_s
assert_match "ruby-3.2.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: "3.2.1")).value.to_s
assert_match "ruby-2.7.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: Gem::Version.new("2.8.2"))).value.to_s
assert_match "ruby-1.9.yml", @subject.rules(LintRoller::Context.new(target_ruby_version: Gem::Version.new("1.9.3"))).value.to_s
Expand Down

0 comments on commit 75852ca

Please sign in to comment.