summaryrefslogtreecommitdiff
path: root/gem_prelude.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 14:12:42 (GMT)
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 14:12:42 (GMT)
commitb5b8e5e0f4e2d220073d69032c9b2b8a8289d49f (patch)
tree729b5afd7f6f2c0191adc18eb014473e5cd32485 /gem_prelude.rb
parente60463034a468ec9fcee73466e76bd541c9a39c3 (diff)
* gem_prelude.rb (Gem.path): uses Gem.default_path as a default value
so that ruby finds gems in ~/.gem/. (Gem.user_home): reduced version of lib/rubygems.rb's. Gem.default_path needs it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gem_prelude.rb')
-rw-r--r--gem_prelude.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/gem_prelude.rb b/gem_prelude.rb
index d32cbe9..ca865aa 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -42,7 +42,7 @@ if defined?(Gem) then
def self.path
@gem_path ||= nil
unless @gem_path
- paths = [ENV['GEM_PATH']]
+ paths = [ENV['GEM_PATH'] || default_path]
paths << APPLE_GEM_HOME if defined? APPLE_GEM_HOME
set_paths(paths.compact.join(File::PATH_SEPARATOR))
end
@@ -89,6 +89,16 @@ if defined?(Gem) then
@gem_path.uniq!
end
+ def self.user_home
+ @user_home ||= File.expand_path("~")
+ rescue
+ if File::ALT_SEPARATOR then
+ "C:/"
+ else
+ "/"
+ end
+ end
+
# begin rubygems/defaults
# NOTE: this require will be replaced with in-place eval before compilation.
require 'lib/rubygems/defaults.rb'