diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
commit | 9694bb8cac12969300692dac5a1cf7aa4e3a46cd (patch) | |
tree | c3cb423d701f7049ba9382de052e2a937cd1302d /lib/rubygems/platform.rb | |
parent | 3f606b7063fc7a8b191556365ad343a314719a8d (diff) |
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto.
* common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
* tool/change_maker.rb: Allow invalid UTF-8 characters in source
files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/platform.rb')
-rw-r--r-- | lib/rubygems/platform.rb | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index f67e4022b6..7301153c4b 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -21,7 +21,8 @@ class Gem::Platform def self.match(platform) Gem.platforms.any? do |local_platform| - platform.nil? or local_platform == platform or + platform.nil? or + local_platform == platform or (local_platform != Gem::Platform::RUBY and local_platform =~ platform) end end @@ -65,28 +66,28 @@ class Gem::Platform @cpu, os = nil, cpu if os.nil? # legacy jruby @os, @version = case os - when /aix(\d+)/ then [ 'aix', $1 ] - when /cygwin/ then [ 'cygwin', nil ] - when /darwin(\d+)?/ then [ 'darwin', $1 ] - when /^macruby$/ then [ 'macruby', nil ] - when /freebsd(\d+)/ then [ 'freebsd', $1 ] - when /hpux(\d+)/ then [ 'hpux', $1 ] - when /^java$/, /^jruby$/ then [ 'java', nil ] - when /^java([\d.]*)/ then [ 'java', $1 ] - when /^dotnet$/ then [ 'dotnet', nil ] - when /^dotnet([\d.]*)/ then [ 'dotnet', $1 ] - when /linux/ then [ 'linux', $1 ] - when /mingw32/ then [ 'mingw32', nil ] + when /aix(\d+)?/ then [ 'aix', $1 ] + when /cygwin/ then [ 'cygwin', nil ] + when /darwin(\d+)?/ then [ 'darwin', $1 ] + when /^macruby$/ then [ 'macruby', nil ] + when /freebsd(\d+)?/ then [ 'freebsd', $1 ] + when /hpux(\d+)?/ then [ 'hpux', $1 ] + when /^java$/, /^jruby$/ then [ 'java', nil ] + when /^java([\d.]*)/ then [ 'java', $1 ] + when /^dotnet$/ then [ 'dotnet', nil ] + when /^dotnet([\d.]*)/ then [ 'dotnet', $1 ] + when /linux/ then [ 'linux', $1 ] + when /mingw32/ then [ 'mingw32', nil ] when /(mswin\d+)(\_(\d+))?/ then os, version = $1, $3 @cpu = 'x86' if @cpu.nil? and os =~ /32$/ [os, version] - when /(netbsd[a-z]*)(\d+)/ then [ $1, $2 ] - when /openbsd(\d+\.\d+)/ then [ 'openbsd', $1 ] - when /solaris(\d+\.\d+)/ then [ 'solaris', $1 ] + when /netbsdelf/ then [ 'netbsdelf', nil ] + when /openbsd(\d+\.\d+)?/ then [ 'openbsd', $1 ] + when /solaris(\d+\.\d+)?/ then [ 'solaris', $1 ] # test - when /^(\w+_platform)(\d+)/ then [ $1, $2 ] - else [ 'unknown', nil ] + when /^(\w+_platform)(\d+)?/ then [ $1, $2 ] + else [ 'unknown', nil ] end when Gem::Platform then @cpu = arch.cpu @@ -109,10 +110,6 @@ class Gem::Platform to_a.compact.join '-' end - def empty? - to_s.empty? - end - ## # Is +other+ equal to this platform? Two platforms are equal if they have # the same CPU, OS and version. @@ -186,9 +183,5 @@ class Gem::Platform # This will be replaced with Gem::Platform::local. CURRENT = 'current' - - extend Gem::Deprecate - - deprecate :empty?, :none, 2011, 11 end |