summaryrefslogtreecommitdiff
path: root/lib/rubygems/dependency_installer.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-08 01:15:54 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-08 01:15:54 +0000
commit8bb45796c87603fe2a70885dfea3a3622f4104a5 (patch)
tree3daf5120954023f54fdaf326164e3382f5635555 /lib/rubygems/dependency_installer.rb
parent978c0f0f0408dbdb5f0d3707157a304187161236 (diff)
* lib/rubygems/config_file.rb: Add missing require for
user_interaction.rb * lib/rubygems/dependency_installer.rb: Minor refactor for clarity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/dependency_installer.rb')
-rw-r--r--lib/rubygems/dependency_installer.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
index 0158a7164f..d811f62875 100644
--- a/lib/rubygems/dependency_installer.rb
+++ b/lib/rubygems/dependency_installer.rb
@@ -57,13 +57,13 @@ class Gem::DependencyInstaller
# :build_args:: See Gem::Installer::new
def initialize(options = {})
- if options[:install_dir] then
- @gem_home = options[:install_dir]
+ @install_dir = options[:install_dir] || Gem.dir
- # HACK shouldn't change the global settings
- Gem::Specification.dirs = @gem_home
- Gem.ensure_gem_subdirectories @gem_home
- options[:install_dir] = @gem_home # FIX: because we suck and reuse below
+ if options[:install_dir] then
+ # HACK shouldn't change the global settings, needed for -i behavior
+ # maybe move to the install command? See also github #442
+ Gem::Specification.dirs = @install_dir
+ Gem.ensure_gem_subdirectories @install_dir
end
options = DEFAULT_OPTIONS.merge options
@@ -91,7 +91,6 @@ class Gem::DependencyInstaller
@installed_gems = []
@toplevel_specs = nil
- @install_dir = options[:install_dir] || Gem.dir
@cache_dir = options[:cache_dir] || @install_dir
# Set with any errors that SpecFetcher finds while search through