mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to RubyGems 1.3.7.pre.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d0e5a34ac7
commit
372dcece3f
64 changed files with 759 additions and 240 deletions
|
@ -68,9 +68,6 @@ class Gem::Dependency
|
|||
@version_requirements = @requirement
|
||||
end
|
||||
|
||||
##
|
||||
# What does this dependency require?
|
||||
|
||||
##
|
||||
# A dependency's hash is the XOR of the hashes of +name+, +type+,
|
||||
# and +requirement+.
|
||||
|
@ -106,6 +103,9 @@ class Gem::Dependency
|
|||
end
|
||||
end
|
||||
|
||||
##
|
||||
# What does this dependency require?
|
||||
|
||||
def requirement
|
||||
return @requirement if defined?(@requirement) and @requirement
|
||||
|
||||
|
@ -160,7 +160,16 @@ class Gem::Dependency
|
|||
__requirement
|
||||
end
|
||||
|
||||
alias_method :version_requirement, :version_requirements
|
||||
alias version_requirement version_requirements # :nodoc:
|
||||
|
||||
def version_requirements= requirements # :nodoc:
|
||||
warn "#{Gem.location_of_caller.join ':'}:Warning: " \
|
||||
"Gem::Dependency#version_requirements= is deprecated " \
|
||||
"and will be removed on or after August 2010. " \
|
||||
"Use Gem::Dependency.new."
|
||||
|
||||
@requirement = Gem::Requirement.create requirements
|
||||
end
|
||||
|
||||
def == other # :nodoc:
|
||||
Gem::Dependency === other &&
|
||||
|
@ -188,9 +197,12 @@ class Gem::Dependency
|
|||
end
|
||||
|
||||
pattern = name
|
||||
pattern = /\A#{Regexp.escape pattern}\Z/ unless Regexp === pattern
|
||||
|
||||
return false unless pattern =~ other.name
|
||||
if Regexp === pattern then
|
||||
return false unless pattern =~ other.name
|
||||
else
|
||||
return false unless pattern == other.name
|
||||
end
|
||||
|
||||
reqs = other.requirement.requirements
|
||||
|
||||
|
@ -202,5 +214,19 @@ class Gem::Dependency
|
|||
requirement.satisfied_by? version
|
||||
end
|
||||
|
||||
def match?(spec_name, spec_version)
|
||||
pattern = name
|
||||
|
||||
if Regexp === pattern
|
||||
return false unless pattern =~ spec_name
|
||||
else
|
||||
return false unless pattern == spec_name
|
||||
end
|
||||
|
||||
return true if requirement.none?
|
||||
|
||||
requirement.satisfied_by? Gem::Version.new(spec_version)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue