summaryrefslogtreecommitdiff
path: root/gem_prelude.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-25 22:58:43 (GMT)
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-25 22:58:43 (GMT)
commitb61d8b6045497a5b2185bf8cb61a381f179d3ecd (patch)
tree0b7980dd65f71136db50a788d5e5a052efdf66ed /gem_prelude.rb
parent17358af75b80343f7861907b9288607e67a08f61 (diff)
Update to RubyGems 1.3.1 r1909.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gem_prelude.rb')
-rw-r--r--gem_prelude.rb42
1 files changed, 33 insertions, 9 deletions
diff --git a/gem_prelude.rb b/gem_prelude.rb
index 28bbd83..b483a65 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -24,14 +24,6 @@ if defined?(Gem) then
:ruby_install_name => RbConfig::CONFIG["ruby_install_name"]
}
- def self.default_dir
- if defined? RUBY_FRAMEWORK_VERSION
- return File.join(File.dirname(ConfigMap[:sitedir]), "Gems")
- else
- File.join(ConfigMap[:libdir], 'ruby', 'gems', ConfigMap[:ruby_version])
- end
- end
-
def self.dir
@gem_home ||= nil
set_home(ENV['GEM_HOME'] || default_dir) unless @gem_home
@@ -48,7 +40,22 @@ if defined?(Gem) then
@gem_path
end
- # Set the Gem home directory (as reported by +dir+).
+ def self.post_install(&hook)
+ @post_install_hooks << hook
+ end
+
+ def self.post_uninstall(&hook)
+ @post_uninstall_hooks << hook
+ end
+
+ def self.pre_install(&hook)
+ @pre_install_hooks << hook
+ end
+
+ def self.pre_uninstall(&hook)
+ @pre_uninstall_hooks << hook
+ end
+
def self.set_home(home)
@gem_home = home
ensure_gem_subdirectories(@gem_home)
@@ -68,8 +75,25 @@ if defined?(Gem) then
def self.ensure_gem_subdirectories(path)
end
+ # Methods before this line will be removed when QuickLoader is replaced
+ # with the real RubyGems
+
GEM_PRELUDE_METHODS = Gem.methods(false)
+ require 'rubygems/defaults'
+
+ begin
+ require 'rubygems/defaults/operating_system'
+ rescue LoadError
+ end
+
+ if defined?(RUBY_ENGINE) then
+ begin
+ require 'rubygems/defaults/#{RUBY_ENGINE}'
+ rescue LoadError
+ end
+ end
+
module QuickLoader
def self.load_full_rubygems_library