mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Extract gemspec to versioned file
Not to be overwritten by test-bundler-prepare. gem files often contain useless gemspec files which have not been processed.
This commit is contained in:
parent
e025113d71
commit
91f831ac17
2 changed files with 9 additions and 4 deletions
|
@ -10,7 +10,7 @@ def Gem.unpack(file, dir = nil)
|
||||||
target = spec.full_name
|
target = spec.full_name
|
||||||
target = File.join(dir, target) if dir
|
target = File.join(dir, target) if dir
|
||||||
pkg.extract_files target
|
pkg.extract_files target
|
||||||
spec_file = File.join(target, "#{spec.name}.gemspec")
|
spec_file = File.join(target, "#{spec.name}-#{spec.version}.gemspec")
|
||||||
open(spec_file, 'wb') do |f|
|
open(spec_file, 'wb') do |f|
|
||||||
f.print spec.to_ruby
|
f.print spec.to_ruby
|
||||||
end
|
end
|
||||||
|
|
|
@ -965,9 +965,14 @@ install?(:ext, :comm, :gem, :'bundled-gems') do
|
||||||
next if /^\s*(?:#|$)/ =~ name
|
next if /^\s*(?:#|$)/ =~ name
|
||||||
next unless /^(\S+)\s+(\S+).*/ =~ name
|
next unless /^(\S+)\s+(\S+).*/ =~ name
|
||||||
gem_name = "#$1-#$2"
|
gem_name = "#$1-#$2"
|
||||||
path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec"
|
path = "#{srcdir}/.bundle/gems/#{gem_name}/#{gem_name}.gemspec"
|
||||||
next unless File.exist?(path)
|
if File.exist?(path)
|
||||||
spec = load_gemspec(path, true)
|
spec = load_gemspec(path)
|
||||||
|
else
|
||||||
|
path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec"
|
||||||
|
next unless File.exist?(path)
|
||||||
|
spec = load_gemspec(path, true)
|
||||||
|
end
|
||||||
next unless spec.platform == Gem::Platform::RUBY
|
next unless spec.platform == Gem::Platform::RUBY
|
||||||
next unless spec.full_name == gem_name
|
next unless spec.full_name == gem_name
|
||||||
spec.extension_dir = "#{extensions_dir}/#{spec.full_name}"
|
spec.extension_dir = "#{extensions_dir}/#{spec.full_name}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue