Skip to content

Commit

Permalink
Add ruby-3.3.yml for targetting
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jun 16, 2024
1 parent 0ae5ea7 commit 7cf2d26
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
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
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 7cf2d26

Please sign in to comment.