ruby-changes:31267
From: drbrain <ko1@a...>
Date: Fri, 18 Oct 2013 06:04:11 +0900 (JST)
Subject: [ruby-changes:31267] drbrain:r43346 (trunk): * lib/rubygems: Update to RubyGems master f738c67. Changes:
drbrain 2013-10-18 06:03:49 +0900 (Fri, 18 Oct 2013) New Revision: 43346 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43346 Log: * lib/rubygems: Update to RubyGems master f738c67. Changes: Fixed test bug for ruby with ENABLE_SHARED = no * test/rubygems: ditto. Modified files: trunk/ChangeLog trunk/lib/rubygems/basic_specification.rb trunk/lib/rubygems.rb trunk/test/rubygems/test_gem.rb trunk/test/rubygems/test_gem_specification.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 43345) +++ ChangeLog (revision 43346) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Oct 18 06:02:49 2013 Eric Hodel <drbrain@s...> + + * lib/rubygems: Update to RubyGems master f738c67. Changes: + + Fixed test bug for ruby with ENABLE_SHARED = no + + * test/rubygems: ditto. + Fri Oct 18 00:57:07 2013 Tanaka Akira <akr@f...> * lib/tsort.rb (TSort.tsort): Extracted from TSort#tsort. Index: lib/rubygems/basic_specification.rb =================================================================== --- lib/rubygems/basic_specification.rb (revision 43345) +++ lib/rubygems/basic_specification.rb (revision 43346) @@ -63,15 +63,8 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L63 # end def extension_install_dir - ruby_api_version = - if 'no' == RbConfig::CONFIG['ENABLE_SHARED'] then - "#{Gem.ruby_api_version}-static" - else - Gem.ruby_api_version - end - File.join base_dir, 'extensions', Gem::Platform.local.to_s, - ruby_api_version, full_name + Gem.extension_api_version, full_name end def find_full_gem_path # :nodoc: @@ -184,7 +177,7 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L177 relative_extension_install_dir = File.join '..', '..', '..', 'extensions', Gem::Platform.local.to_s, - Gem.ruby_api_version, full_name + Gem.extension_api_version, full_name @require_paths + [relative_extension_install_dir] end Index: lib/rubygems.rb =================================================================== --- lib/rubygems.rb (revision 43345) +++ lib/rubygems.rb (revision 43346) @@ -439,6 +439,18 @@ module Gem https://github.com/ruby/ruby/blob/trunk/lib/rubygems.rb#L439 end ## + # The extension API version of ruby. This includes the static vs non-static + # distinction as extensions cannot be shared between the two. + + def self.extension_api_version # :nodoc: + if 'no' == RbConfig::CONFIG['ENABLE_SHARED'] then + "#{ruby_api_version}-static" + else + ruby_api_version + end + end + + ## # Returns a list of paths matching +glob+ that can be used by a gem to pick # up features from other gems. For example: # Index: test/rubygems/test_gem.rb =================================================================== --- test/rubygems/test_gem.rb (revision 43345) +++ test/rubygems/test_gem.rb (revision 43346) @@ -338,6 +338,24 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L338 end end + def test_self_extension_install_dir_shared + enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = + RbConfig::CONFIG['ENABLE_SHARED'], 'yes' + + assert_equal Gem.ruby_api_version, Gem.extension_api_version + ensure + RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared + end + + def test_self_extension_install_dir_static + enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = + RbConfig::CONFIG['ENABLE_SHARED'], 'no' + + assert_equal "#{Gem.ruby_api_version}-static", Gem.extension_api_version + ensure + RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared + end + def test_self_find_files cwd = File.expand_path("test/rubygems", @@project_dir) $LOAD_PATH.unshift cwd Index: test/rubygems/test_gem_specification.rb =================================================================== --- test/rubygems/test_gem_specification.rb (revision 43345) +++ test/rubygems/test_gem_specification.rb (revision 43346) @@ -1366,24 +1366,7 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L1366 assert_equal ['ext/extconf.rb'], ext_spec.extensions end - def test_extension_install_dir_shared - enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = - RbConfig::CONFIG['ENABLE_SHARED'], 'yes' - - ext_spec - - refute_empty @ext.extensions - - expected = - File.join(@ext.base_dir, 'extensions', Gem::Platform.local.to_s, - Gem.ruby_api_version,@ext.full_name) - - assert_equal expected, @ext.extension_install_dir - ensure - RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared - end - - def test_extension_install_dir_static + def test_extension_install_dir enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = RbConfig::CONFIG['ENABLE_SHARED'], 'no' @@ -1667,6 +1650,9 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L1650 end def test_require_paths + enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = + RbConfig::CONFIG['ENABLE_SHARED'], 'no' + ext_spec @ext.require_path = 'lib' @@ -1677,6 +1663,8 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L1663 Pathname(@ext.extension_install_dir).relative_path_from lib assert_equal ['lib', ext_install_dir.to_s], @ext.require_paths + ensure + RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared end def test_full_require_paths -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/