mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems master 1c5f4b3. Allows rubygems
repackagers to disable backward-compatible shared gem directory behavior. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
45c858d918
commit
e80f2c118a
4 changed files with 65 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Dec 17 05:18:17 2013 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/rubygems: Update to RubyGems master 1c5f4b3. Allows rubygems
|
||||
repackagers to disable backward-compatible shared gem directory
|
||||
behavior.
|
||||
* test/rubygems: ditto.
|
||||
|
||||
Tue Dec 17 05:14:35 2013 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* NEWS (RDoc): Update version number so I don't have to change it
|
||||
|
|
|
@ -152,4 +152,12 @@ module Gem
|
|||
def self.default_gems_use_full_paths?
|
||||
ruby_engine != 'ruby'
|
||||
end
|
||||
|
||||
##
|
||||
# Install extensions into lib as well as into the extension directory.
|
||||
|
||||
def self.install_extension_in_lib # :nodoc:
|
||||
true
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -44,7 +44,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||
|
||||
if tmp_dest
|
||||
# TODO remove in RubyGems 3
|
||||
if lib_dir then
|
||||
if Gem.install_extension_in_lib and lib_dir then
|
||||
FileUtils.mkdir_p lib_dir
|
||||
entries = Dir.entries(tmp_dest) - %w[. ..]
|
||||
entries = entries.map { |entry| File.join tmp_dest, entry }
|
||||
|
|
|
@ -132,6 +132,55 @@ install:
|
|||
assert_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
|
||||
end
|
||||
|
||||
def test_build_extensions_install_ext_only
|
||||
class << Gem
|
||||
alias orig_install_extension_in_lib install_extension_in_lib
|
||||
|
||||
def Gem.install_extension_in_lib
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
@spec.extensions << 'ext/extconf.rb'
|
||||
|
||||
ext_dir = File.join @spec.gem_dir, 'ext'
|
||||
|
||||
FileUtils.mkdir_p ext_dir
|
||||
|
||||
extconf_rb = File.join ext_dir, 'extconf.rb'
|
||||
|
||||
open extconf_rb, 'w' do |f|
|
||||
f.write <<-'RUBY'
|
||||
require 'mkmf'
|
||||
|
||||
create_makefile 'a'
|
||||
RUBY
|
||||
end
|
||||
|
||||
ext_lib_dir = File.join ext_dir, 'lib'
|
||||
FileUtils.mkdir ext_lib_dir
|
||||
FileUtils.touch File.join ext_lib_dir, 'a.rb'
|
||||
FileUtils.mkdir File.join ext_lib_dir, 'a'
|
||||
FileUtils.touch File.join ext_lib_dir, 'a', 'b.rb'
|
||||
|
||||
use_ui @ui do
|
||||
@builder.build_extensions
|
||||
end
|
||||
|
||||
assert_path_exists @spec.extension_dir
|
||||
assert_path_exists @spec.gem_build_complete_path
|
||||
assert_path_exists File.join @spec.extension_dir, 'gem_make.out'
|
||||
assert_path_exists File.join @spec.extension_dir, 'a.rb'
|
||||
refute_path_exists File.join @spec.gem_dir, 'lib', 'a.rb'
|
||||
refute_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb'
|
||||
ensure
|
||||
class << Gem
|
||||
remove_method :install_extension_in_lib
|
||||
|
||||
alias install_extension_in_lib orig_install_extension_in_lib
|
||||
end
|
||||
end
|
||||
|
||||
def test_build_extensions_none
|
||||
use_ui @ui do
|
||||
@builder.build_extensions
|
||||
|
|
Loading…
Reference in a new issue