ruby-changes:51316
From: nobu <ko1@a...>
Date: Tue, 29 May 2018 17:47:11 +0900 (JST)
Subject: [ruby-changes:51316] nobu:r63522 (trunk): fake.rb: fix RUBY_DESCRIPTION for MJIT
nobu 2018-05-29 17:47:07 +0900 (Tue, 29 May 2018) New Revision: 63522 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63522 Log: fake.rb: fix RUBY_DESCRIPTION for MJIT * template/fake.rb.in: reflect MJIT to RUBY_DESCRIPTION. Modified files: trunk/template/fake.rb.in trunk/test/ruby/test_rubyoptions.rb Index: test/ruby/test_rubyoptions.rb =================================================================== --- test/ruby/test_rubyoptions.rb (revision 63521) +++ test/ruby/test_rubyoptions.rb (revision 63522) @@ -116,11 +116,7 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyoptions.rb#L116 def test_verbose assert_in_out_err(["-vve", ""]) do |r, e| assert_match(VERSION_PATTERN, r[0]) - if RbConfig::CONFIG.fetch('cppflags', '').match?(/(\A|\s)-DMJIT_FORCE_ENABLE\b/) - assert_equal(RUBY_DESCRIPTION, r[0]) - else - assert_equal(NO_JIT_DESCRIPTION, r[0]) - end + assert_equal(RUBY_DESCRIPTION, r[0]) assert_equal([], e) end Index: template/fake.rb.in =================================================================== --- template/fake.rb.in (revision 63521) +++ template/fake.rb.in (revision 63522) @@ -7,12 +7,15 @@ while /\A(\w+)=(.*)/ =~ ARGV[0] https://github.com/ruby/ruby/blob/trunk/template/fake.rb.in#L7 end if inc = arg['i'] src = inc == '-' ? STDIN.read : File.read(inc) + def src.value(name) + eval(self[/\bruby_#{name}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#')) + end arg['versions'] = version = {} File.read(File.join(arg['srcdir'], 'version.c')). scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|STR)\(([^()]*)\)/m) do |n, v| - version[n] = - eval(src[/\bruby_#{v}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#')) + version[n] = src.value(v) end + version['RUBY_DESCRIPTION'] = src.value('description_with_jit') if RubyVM::MJIT.enabled? end %>baseruby="<%=arg['BASERUBY']%>" _\ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/