diff options
Diffstat (limited to 'lib/bundler/self_manager.rb')
-rw-r--r-- | lib/bundler/self_manager.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bundler/self_manager.rb b/lib/bundler/self_manager.rb index bfd000b1a0..3cef0197c0 100644 --- a/lib/bundler/self_manager.rb +++ b/lib/bundler/self_manager.rb @@ -92,6 +92,7 @@ module Bundler def autoswitching_applies? ENV["BUNDLER_VERSION"].nil? && Bundler.rubygems.supports_bundler_trampolining? && + ruby_can_restart_with_same_arguments? && SharedHelpers.in_bundle? && lockfile_version end @@ -113,7 +114,7 @@ module Bundler end def local_specs - @local_specs ||= Bundler::Source::Rubygems.new("allow_local" => true, "allow_cached" => true).specs.select {|spec| spec.name == "bundler" } + @local_specs ||= Bundler::Source::Rubygems.new("allow_local" => true).specs.select {|spec| spec.name == "bundler" } end def remote_specs @@ -151,6 +152,10 @@ module Bundler !version.to_s.end_with?(".dev") end + def ruby_can_restart_with_same_arguments? + $PROGRAM_NAME != "-e" + end + def updating? "update".start_with?(ARGV.first || " ") && ARGV[1..-1].any? {|a| a.start_with?("--bundler") } end |