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 HEAD(c202db2).

this version contains many enhancements see http://git.io/vtNwF
* test/rubygems: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2015-07-01 21:50:14 +00:00
parent 9c4ef4b191
commit effdbf5936
90 changed files with 2489 additions and 1159 deletions

View file

@ -61,10 +61,16 @@ use with other commands.
ss.map { |spec, _| spec }
end
def fetch_specs dependency # :nodoc:
def fetch_specs name_pattern, dependency # :nodoc:
specs = []
specs.concat dependency.matching_specs if local?
if local?
specs.concat Gem::Specification.stubs.find_all { |spec|
name_pattern =~ spec.name and
dependency.requirement.satisfied_by? spec.version
}.map(&:to_spec)
end
specs.concat fetch_remote_specs dependency if remote?
ensure_specs specs
@ -72,16 +78,7 @@ use with other commands.
specs.uniq.sort
end
def gem_dependency args, version, prerelease # :nodoc:
args << '' if args.empty?
pattern = if args.length == 1 and args.first =~ /\A\/(.*)\/(i)?\z/m then
flags = $2 ? Regexp::IGNORECASE : nil
Regexp.new $1, flags
else
/\A#{Regexp.union(*args)}/
end
def gem_dependency pattern, version, prerelease # :nodoc:
dependency = Gem::Deprecate.skip_during {
Gem::Dependency.new pattern, version
}
@ -121,10 +118,12 @@ use with other commands.
def execute
ensure_local_only_reverse_dependencies
dependency =
gem_dependency options[:args], options[:version], options[:prerelease]
pattern = name_pattern options[:args]
specs = fetch_specs dependency
dependency =
gem_dependency pattern, options[:version], options[:prerelease]
specs = fetch_specs pattern, dependency
reverse = reverse_dependencies specs
@ -203,5 +202,16 @@ use with other commands.
result
end
end
private
def name_pattern args
args << '' if args.empty?
if args.length == 1 and args.first =~ /\A\/(.*)\/(i)?\z/m then
flags = $2 ? Regexp::IGNORECASE : nil
Regexp.new $1, flags
else
/\A#{Regexp.union(*args)}/
end
end
end