lib/rubygems/dependency_installer.rb in rubygems-update-2.0.0.rc.1 vs lib/rubygems/dependency_installer.rb in rubygems-update-2.0.0.rc.2
- old
+ new
@@ -55,17 +55,17 @@
# :user_install:: See Gem::Installer.new
# :wrappers:: See Gem::Installer::new
# :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
@bin_dir = options[:bin_dir]
@@ -89,11 +89,10 @@
@minimal_deps = options[:minimal_deps]
@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
# gemspecs for a dep
@errors = nil
@@ -258,10 +257,10 @@
prerelease = false)
set = Gem::AvailableSet.new
if consider_local?
- if File.file? gem_name then
+ if gem_name =~ /\.gem$/ and File.file? gem_name then
src = Gem::Source::SpecificFile.new(gem_name)
set.add src.spec, src
else
local = Gem::Source::Local.new