mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update RubyGems to 1.1.1 r1778 (almost 1.2)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f98e6b91de
commit
9d4f37f51f
71 changed files with 3765 additions and 1127 deletions
|
@ -1,7 +1,8 @@
|
|||
require 'rubygems'
|
||||
|
||||
##
|
||||
# Available list of platforms for targeting Gem installations.
|
||||
#
|
||||
|
||||
class Gem::Platform
|
||||
|
||||
@local = nil
|
||||
|
@ -122,11 +123,20 @@ class Gem::Platform
|
|||
to_a.compact.join '-'
|
||||
end
|
||||
|
||||
##
|
||||
# Is +other+ equal to this platform? Two platforms are equal if they have
|
||||
# the same CPU, OS and version.
|
||||
|
||||
def ==(other)
|
||||
self.class === other and
|
||||
@cpu == other.cpu and @os == other.os and @version == other.version
|
||||
end
|
||||
|
||||
##
|
||||
# Does +other+ match this platform? Two platforms match if they have the
|
||||
# same CPU, or either has a CPU of 'universal', they have the same OS, and
|
||||
# they have the same version, or either has no version.
|
||||
|
||||
def ===(other)
|
||||
return nil unless Gem::Platform === other
|
||||
|
||||
|
@ -140,6 +150,10 @@ class Gem::Platform
|
|||
(@version.nil? or other.version.nil? or @version == other.version)
|
||||
end
|
||||
|
||||
##
|
||||
# Does +other+ match this platform? If +other+ is a String it will be
|
||||
# converted to a Gem::Platform first. See #=== for matching rules.
|
||||
|
||||
def =~(other)
|
||||
case other
|
||||
when Gem::Platform then # nop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue