Skip to content

Commit 8df927d

Browse files
committed
Read the next Ruby version from a file instead of hardcoding it in spec/truffleruby.mspec
1 parent d97011e commit 8df927d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/contributor/updating-ruby.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Update all of these:
160160

161161
For a new major version:
162162
* Update `TargetRubyVersion` in `.rubocop.yml`
163-
* Update the list of `:next` specs and change the "next version" in `spec/truffleruby.mspec`.
163+
* Update the list of `:next` specs.
164164
* Update the docs for next version specs in [workflow.md](workflow.md).
165165
* Update the versions in the `ruby/spec on CRuby` job of `.github/workflows/ci.yml`.
166166

spec/truffleruby.mspec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,13 @@ if MSpecScript.child_process?
154154
::VersionGuard.send :remove_const, :FULL_RUBY_VERSION
155155
::VersionGuard::FULL_RUBY_VERSION = SpecVersion.new(version)
156156
elsif ARGV.include? ":next"
157+
version = File.read(".ruby-version")
158+
159+
# get the next version, e.g. 3.1.2 -> 3.2.0
160+
next_version = version.split(".").tap { |ary| ary[1] = ary[1].next; ary[2] = '0' }.join(".")
161+
157162
::VersionGuard.send :remove_const, :FULL_RUBY_VERSION
158-
::VersionGuard::FULL_RUBY_VERSION = SpecVersion.new("3.2.0")
163+
::VersionGuard::FULL_RUBY_VERSION = SpecVersion.new(next_version)
159164
end
160165
end
161166

0 commit comments

Comments
 (0)