summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 20:57:02 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 20:57:02 +0000
commite72b71d56a1f369cb7eb3892c61715460bac8109 (patch)
tree6f55131cbd153845e71dadc91f08636aa6707423 /lib/rubygems.rb
parent0ae6c7f816cbc3ba0cdd97f609b9ffcbf49bf9bb (diff)
Update to RubyGems 1.1.1 r1701.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb34
1 files changed, 29 insertions, 5 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 3f9657ac1e..1cb205cbc9 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -97,7 +97,7 @@ module Gem
@configuration = nil
@loaded_specs = {}
- @platforms = nil
+ @platforms = []
@ruby = nil
@sources = []
@@ -215,7 +215,7 @@ module Gem
def self.bindir(install_dir=Gem.dir)
return File.join(install_dir, 'bin') unless
- install_dir.to_s == Gem.default_dir
+ install_dir.to_s == Gem.default_dir
Gem.default_bindir
end
@@ -451,10 +451,21 @@ module Gem
end
##
- # Array of platforms this RubyGems supports.
+ # Set array of platforms this RubyGems supports (primarily for testing).
+
+ def self.platforms=(platforms)
+ @platforms = platforms
+ end
+ ##
+ # Array of platforms this RubyGems supports.
+
def self.platforms
- @platforms ||= [Gem::Platform::RUBY, Gem::Platform.local]
+ @platforms ||= []
+ if @platforms.empty?
+ @platforms = [Gem::Platform::RUBY, Gem::Platform.local]
+ end
+ @platforms
end
##
@@ -463,7 +474,9 @@ module Gem
def self.prefix
prefix = File.dirname File.expand_path(__FILE__)
- if prefix == File.expand_path(ConfigMap[:sitelibdir]) then
+ if File.dirname(prefix) == File.expand_path(ConfigMap[:sitelibdir]) or
+ File.dirname(prefix) == File.expand_path(ConfigMap[:libdir]) or
+ 'lib' != File.basename(prefix) then
nil
else
File.dirname prefix
@@ -471,6 +484,17 @@ module Gem
end
##
+ # Refresh source_index from disk and clear searcher.
+
+ def self.refresh
+ source_index.refresh!
+
+ MUTEX.synchronize do
+ @searcher = nil
+ end
+ end
+
+ ##
# Safely read a file in binary mode on all platforms.
def self.read_binary(path)