summaryrefslogtreecommitdiffstats
path: root/lib/rubygems/platform.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-25 03:26:36 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-25 03:26:36 +0000
commit7ff481f97e9f4a7ecfc163afa7f5d5f6fc9ff8bc (patch)
tree84ee86a60d6ec70522b79996c5d5d7ca2c068a45 /lib/rubygems/platform.rb
parent8af643f16b5c33bfd9e4720d5bec1dfe9ca7bf4c (diff)
downloadruby-7ff481f97e9f4a7ecfc163afa7f5d5f6fc9ff8bc.tar.gz
ruby-7ff481f97e9f4a7ecfc163afa7f5d5f6fc9ff8bc.tar.xz
ruby-7ff481f97e9f4a7ecfc163afa7f5d5f6fc9ff8bc.zip
Import fast-loading gem_prelude.rb from RubyGems.
Import RubyGems r1516. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/platform.rb')
-rw-r--r--lib/rubygems/platform.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index 24081d4fe..496c4b1fb 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -13,7 +13,7 @@ class Gem::Platform
attr_accessor :version
def self.local
- arch = Config::CONFIG['arch']
+ arch = Gem::ConfigMap[:arch]
arch = "#{arch}_60" if arch =~ /mswin32$/
@local ||= new(arch)
end
@@ -27,6 +27,8 @@ class Gem::Platform
def self.new(arch) # :nodoc:
case arch
+ when Gem::Platform::CURRENT then
+ Gem::Platform.local
when Gem::Platform::RUBY, nil, '' then
Gem::Platform::RUBY
else
@@ -71,7 +73,10 @@ class Gem::Platform
when /^java([\d.]*)/ then [ 'java', $1 ]
when /linux/ then [ 'linux', $1 ]
when /mingw32/ then [ 'mingw32', nil ]
- when /(mswin\d+)(\_(\d+))?/ then [ $1, $3 ]
+ when /(mswin\d+)(\_(\d+))?/ then
+ os, version = $1, $3
+ @cpu = 'x86' if @cpu.nil? and os =~ /32$/
+ [os, version]
when /netbsdelf/ then [ 'netbsdelf', nil ]
when /openbsd(\d+\.\d+)/ then [ 'openbsd', $1 ]
when /solaris(\d+\.\d+)/ then [ 'solaris', $1 ]