summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/config_file.rb2
-rw-r--r--lib/rubygems/dependency_installer.rb13
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb
index 5870e06370..1284bbd466 100644
--- a/lib/rubygems/config_file.rb
+++ b/lib/rubygems/config_file.rb
@@ -4,6 +4,8 @@
# See LICENSE.txt for permissions.
#++
+require 'rubygems/user_interaction'
+
##
# Gem::ConfigFile RubyGems options and gem command options from gemrc.
#
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