3 @post_install_hooks ||= []
4 @post_uninstall_hooks ||= []
5 @pre_uninstall_hooks ||= []
6 @pre_install_hooks ||= []
9 # An Array of the default sources that come with RubyGems
11 def self.default_sources
12 %w[http://gems.rubyforge.org/]
16 # Default home directory path to be used if an alternate value is not
17 # specified in the environment
20 if defined? RUBY_FRAMEWORK_VERSION then
21 File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
22 ConfigMap[:ruby_version]
23 elsif RUBY_VERSION > '1.9' then
24 File.join(ConfigMap[:libdir], ConfigMap[:ruby_install_name], 'gems',
25 ConfigMap[:ruby_version])
27 File.join(ConfigMap[:libdir], ruby_engine, 'gems',
28 ConfigMap[:ruby_version])
33 # Path for gems in the user's home directory
36 File.join(Gem.user_home, '.gem', ruby_engine,
37 ConfigMap[:ruby_version])
41 # Default gem load path
44 [user_dir, default_dir]
48 # Deduce Ruby's --program-prefix and --program-suffix from its install name
50 def self.default_exec_format
51 baseruby = ConfigMap[:BASERUBY] || 'ruby'
52 ConfigMap[:RUBY_INSTALL_NAME].sub(baseruby, '%s') rescue '%s'
56 # The default directory for binaries
58 def self.default_bindir
59 if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
61 else # generic install
67 # The default system-wide source info cache directory
69 def self.default_system_source_cache_dir
70 File.join Gem.dir, 'source_cache'
74 # The default user-specific source info cache directory
76 def self.default_user_source_cache_dir
77 File.join Gem.user_home, '.gem', 'source_cache'
81 # A wrapper around RUBY_ENGINE const that may not be defined
84 if defined? RUBY_ENGINE then