ruby-changes:31567
From: drbrain <ko1@a...>
Date: Mon, 11 Nov 2013 04:37:11 +0900 (JST)
Subject: [ruby-changes:31567] drbrain:r43646 (trunk): * lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking
drbrain 2013-11-11 04:37:05 +0900 (Mon, 11 Nov 2013) New Revision: 43646 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43646 Log: * lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking if extensions should be built. Fixes a ruby-ci failure. * test/rubygems/test_gem_specification.rb: Test for the above. Modified files: trunk/ChangeLog trunk/lib/rubygems/specification.rb trunk/test/rubygems/test_gem_specification.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 43645) +++ ChangeLog (revision 43646) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Nov 11 04:36:14 2013 Eric Hodel <drbrain@s...> + + * lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking + if extensions should be built. Fixes a ruby-ci failure. + * test/rubygems/test_gem_specification.rb: Test for the above. + Mon Nov 11 03:15:56 2013 Koichi Sasada <ko1@a...> * vm_trace.c (symbol2event_flag): add secret feature. Index: lib/rubygems/specification.rb =================================================================== --- lib/rubygems/specification.rb (revision 43645) +++ lib/rubygems/specification.rb (revision 43646) @@ -1407,7 +1407,7 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L1407 def build_extensions # :nodoc: return if default_gem? return if extensions.empty? - return if installed_by_version < Gem::Version.new('2.2') + return if installed_by_version < Gem::Version.new('2.2.0.preview.2') return if File.exist? gem_build_complete_path return if !File.writable?(base_dir) && !File.exist?(File.join(base_dir, 'extensions')) Index: test/rubygems/test_gem_specification.rb =================================================================== --- test/rubygems/test_gem_specification.rb (revision 43645) +++ test/rubygems/test_gem_specification.rb (revision 43646) @@ -1260,6 +1260,32 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L1260 refute_path_exists gem_make_out end + def test_build_extensions_preview + ext_spec + + extconf_rb = File.join @ext.gem_dir, @ext.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + + open extconf_rb, 'w' do |f| + f.write <<-'RUBY' + open 'Makefile', 'w' do |f| + f.puts "clean:\n\techo clean" + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" + end + RUBY + end + + refute_empty @ext.extensions, 'sanity check' + + @ext.installed_by_version = v('2.2.0.preview.2') + + @ext.build_extensions + + gem_make_out = File.join @ext.extension_install_dir, 'gem_make.out' + assert_path_exists gem_make_out + end + def test_contains_requirable_file_eh code_rb = File.join @a1.gem_dir, 'lib', 'code.rb' FileUtils.mkdir_p File.dirname code_rb -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/