mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
e60463034a
commit
b5b8e5e0f4
2 changed files with 18 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Thu Jul 30 23:04:32 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* 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.
|
||||
|
||||
Thu Jul 30 22:28:04 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* tool/compile_prelude.rb: replaces "require" with in-place evaluation
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue