1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rubygems: Update to RubyGems master f738c67. Changes:

Fixed test bug for ruby with ENABLE_SHARED = no

* test/rubygems:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2013-10-17 21:03:49 +00:00
parent ef761f0888
commit 4fa08bbaf8
5 changed files with 46 additions and 27 deletions

View file

@ -1,3 +1,11 @@
Fri Oct 18 06:02:49 2013 Eric Hodel <drbrain@segment7.net>
* 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@fsij.org> Fri Oct 18 00:57:07 2013 Tanaka Akira <akr@fsij.org>
* lib/tsort.rb (TSort.tsort): Extracted from TSort#tsort. * lib/tsort.rb (TSort.tsort): Extracted from TSort#tsort.

View file

@ -438,6 +438,18 @@ module Gem
File.umask old_umask File.umask old_umask
end 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 # Returns a list of paths matching +glob+ that can be used by a gem to pick
# up features from other gems. For example: # up features from other gems. For example:

View file

@ -63,15 +63,8 @@ class Gem::BasicSpecification
# end # end
def extension_install_dir 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, File.join base_dir, 'extensions', Gem::Platform.local.to_s,
ruby_api_version, full_name Gem.extension_api_version, full_name
end end
def find_full_gem_path # :nodoc: def find_full_gem_path # :nodoc:
@ -184,7 +177,7 @@ class Gem::BasicSpecification
relative_extension_install_dir = relative_extension_install_dir =
File.join '..', '..', '..', 'extensions', Gem::Platform.local.to_s, 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] @require_paths + [relative_extension_install_dir]
end end

View file

@ -338,6 +338,24 @@ class TestGem < Gem::TestCase
end end
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 def test_self_find_files
cwd = File.expand_path("test/rubygems", @@project_dir) cwd = File.expand_path("test/rubygems", @@project_dir)
$LOAD_PATH.unshift cwd $LOAD_PATH.unshift cwd

View file

@ -1366,24 +1366,7 @@ dependencies: []
assert_equal ['ext/extconf.rb'], ext_spec.extensions assert_equal ['ext/extconf.rb'], ext_spec.extensions
end end
def test_extension_install_dir_shared def test_extension_install_dir
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
enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] =
RbConfig::CONFIG['ENABLE_SHARED'], 'no' RbConfig::CONFIG['ENABLE_SHARED'], 'no'
@ -1667,6 +1650,9 @@ dependencies: []
end end
def test_require_paths def test_require_paths
enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] =
RbConfig::CONFIG['ENABLE_SHARED'], 'no'
ext_spec ext_spec
@ext.require_path = 'lib' @ext.require_path = 'lib'
@ -1677,6 +1663,8 @@ dependencies: []
Pathname(@ext.extension_install_dir).relative_path_from lib Pathname(@ext.extension_install_dir).relative_path_from lib
assert_equal ['lib', ext_install_dir.to_s], @ext.require_paths assert_equal ['lib', ext_install_dir.to_s], @ext.require_paths
ensure
RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared
end end
def test_full_require_paths def test_full_require_paths