Skip to content

Commit 6610090

Browse files
eightbitraptorandrykonchin
authored andcommitted
Include the currently active GC in RUBY_DESCRIPTION
This will add +MOD_GC to the version string and Ruby description when Ruby is compiled with shared gc support. When shared GC support is compiled in and a GC module has been loaded using RUBY_GC_LIBRARY, the version string will include the name of the currently active GC as reported by the rb_gc_active_gc_name function in the form +MOD_GC[gc_name] [Feature #20794]
1 parent 4b49637 commit 6610090

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

command_line/dash_v_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ruby_exe(nil, args: '-v').sub("+PRISM ", "").should include(RUBY_DESCRIPTION.sub("+PRISM ", ""))
1010
end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
1111
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) ||
12+
(ENV['RUBY_GC_LIBRARY'] && ENV['RUBY_GC_LIBRARY'].length > 0) ||
1213
(ENV['RUBY_MN_THREADS'] == '1')
1314
end
1415
end

command_line/rubyopt_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
guard -> { RbConfig::CONFIG["CROSS_COMPILING"] != "yes" } do
2626
it "prints the version number for '-v'" do
2727
ENV["RUBYOPT"] = '-v'
28-
ruby_exe("").sub("+PRISM ", "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "")
28+
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")
2929
end
3030

3131
it "ignores whitespace around the option" do
3232
ENV["RUBYOPT"] = ' -v '
33-
ruby_exe("").sub("+PRISM ", "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "")
33+
ruby_exe("").sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")[/\A.*/].should == RUBY_DESCRIPTION.sub("+PRISM ", "").sub(/\+GC(\[\w+\]\s|\s)?/, "")
3434
end
3535
end
3636

0 commit comments

Comments
 (0)