summaryrefslogtreecommitdiff
path: root/lib/rubygems/platform.rb
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/platform.rb16
1 files changed, 15 insertions, 1 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
def ==(other)
self.class === other and
@cpu == other.cpu and @os == other.os and @version == other.version
end
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
def =~(other)
case other
when Gem::Platform then # nop