ruby-changes:53388
From: nobu <ko1@a...>
Date: Wed, 7 Nov 2018 20:38:14 +0900 (JST)
Subject: [ruby-changes:53388] nobu:r65604 (trunk): `+` sign in the path of ruby needs to be escaped
nobu 2018-11-07 20:38:08 +0900 (Wed, 07 Nov 2018) New Revision: 65604 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65604 Log: `+` sign in the path of ruby needs to be escaped Modified files: trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb trunk/test/rubygems/test_gem_ext_rake_builder.rb trunk/test/rubygems/test_gem_installer.rb Index: test/rubygems/test_gem_installer.rb =================================================================== --- test/rubygems/test_gem_installer.rb (revision 65603) +++ test/rubygems/test_gem_installer.rb (revision 65604) @@ -692,7 +692,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L692 @installer.generate_bin - default_shebang = Gem.ruby + default_shebang = Gem.ruby.shellescape shebang_line = open("#{@gemhome}/bin/executable") { |f| f.readlines.first } assert_match(/\A#!/, shebang_line) assert_match(/#{default_shebang}/, shebang_line) Index: test/rubygems/test_gem_ext_rake_builder.rb =================================================================== --- test/rubygems/test_gem_ext_rake_builder.rb (revision 65603) +++ test/rubygems/test_gem_ext_rake_builder.rb (revision 65604) @@ -25,8 +25,8 @@ class TestGemExtRakeBuilder < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L25 output = output.join "\n" refute_match %r%^rake failed:%, output - assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output - assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output + assert_match %r%^#{Regexp.escape @@ruby.shellescape} mkrf_conf\.rb%, output + assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape}%, output end end @@ -46,8 +46,8 @@ class TestGemExtRakeBuilder < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L46 output = output.join "\n" refute_match %r%^rake failed:%, output - assert_match %r%^#{Regexp.escape @@ruby} mkrf_conf\.rb%, output - assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path}%, output + assert_match %r%^#{Regexp.escape @@ruby.shellescape} mkrf_conf\.rb%, output + assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape}%, output end end @@ -62,7 +62,7 @@ class TestGemExtRakeBuilder < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_rake_builder.rb#L62 output = output.join "\n" refute_match %r%^rake failed:%, output - assert_match %r%^#{Regexp.escape rake} RUBYARCHDIR\\=#{Regexp.escape @dest_path} RUBYLIBDIR\\=#{Regexp.escape @dest_path} test1 test2%, output + assert_match %r%^#{Regexp.escape rake.shellsplit.shelljoin} RUBYARCHDIR\\=#{Regexp.escape @dest_path.shellescape} RUBYLIBDIR\\=#{Regexp.escape @dest_path.shellescape} test1 test2%, output end end Index: test/rubygems/test_gem_ext_ext_conf_builder.rb =================================================================== --- test/rubygems/test_gem_ext_ext_conf_builder.rb (revision 65603) +++ test/rubygems/test_gem_ext_ext_conf_builder.rb (revision 65604) @@ -35,7 +35,7 @@ class TestGemExtExtConfBuilder < Gem::Te https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb#L35 end assert_match(/^current directory:/, output[0]) - assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1]) + assert_match(/^#{Regexp.quote(Gem.ruby.shellescape)}.* extconf.rb/, output[1]) assert_equal "creating Makefile\n", output[2] assert_match(/^current directory:/, output[3]) assert_contains_make_command 'clean', output[4] @@ -109,7 +109,7 @@ class TestGemExtExtConfBuilder < Gem::Te https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_ext_conf_builder.rb#L109 assert_equal 'extconf failed, exit code 1', error.message - assert_match(/^#{Gem.ruby}.* extconf.rb/, output[1]) + assert_match(/^#{Regexp.quote(Gem.ruby.shellescape)}.* extconf.rb/, output[1]) assert_match(File.join(@dest_path, 'mkmf.log'), output[4]) assert_includes(output, "To see why this extension failed to compile, please check the mkmf.log which can be found here:\n") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/