mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
merge revision(s) 9f708d48f6df37ee9600db9d51b57a156609a13b,0301473fb523c71d8cdc4966971f31f502001185,7f0e26b7f99bf76408569892ce20318501f74729: [Backport #20516]
Clear runtime dependencies if default gems is specified. The current build system uses runtime dependencies from only `.bundle` directory. We shouldn't install runtime dependencies from rubygems.org when `make test-bundled-gems` is invoked. Fixed dependencies list format Re-use strscan with ruby repo
This commit is contained in:
parent
262582ee46
commit
bbc71e6801
1 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,16 @@ require 'rubygems/package'
|
|||
# unpack bundled gem files.
|
||||
|
||||
module BundledGem
|
||||
DEFAULT_GEMS_DEPENDENCIES = [
|
||||
"net-protocol", # net-ftp
|
||||
"time", # net-ftp
|
||||
"singleton", # prime
|
||||
"ipaddr", # rinda
|
||||
"forwardable", # prime, rinda
|
||||
"ruby2_keywords", # drb
|
||||
"strscan" # rexml
|
||||
]
|
||||
|
||||
module_function
|
||||
|
||||
def unpack(file, *rest)
|
||||
|
@ -35,6 +45,9 @@ module BundledGem
|
|||
gem_dir = File.join(dir, "gems", target)
|
||||
yield gem_dir
|
||||
spec_dir = spec.extensions.empty? ? "specifications" : File.join("gems", target)
|
||||
if spec.extensions.empty?
|
||||
spec.dependencies.reject! {|dep| DEFAULT_GEMS_DEPENDENCIES.include?(dep.name)}
|
||||
end
|
||||
File.binwrite(File.join(dir, spec_dir, "#{target}.gemspec"), spec.to_ruby)
|
||||
unless spec.extensions.empty?
|
||||
spec.dependencies.clear
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue