diff options
Diffstat (limited to 'lib/bundler/installer/gem_installer.rb')
-rw-r--r-- | lib/bundler/installer/gem_installer.rb | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb index 13a1356f56..d3bbcc90f5 100644 --- a/lib/bundler/installer/gem_installer.rb +++ b/lib/bundler/installer/gem_installer.rb @@ -16,13 +16,13 @@ module Bundler post_install_message = install Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}" generate_executable_stubs - return true, post_install_message - rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError + [true, post_install_message] + rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError, Bundler::InsecureInstallPathError raise rescue Errno::ENOSPC - return false, out_of_space_message - rescue Bundler::BundlerError, Gem::InstallError, Bundler::APIResponseInvalidDependenciesError => e - return false, specific_failure_message(e) + [false, out_of_space_message] + rescue Bundler::BundlerError, Gem::InstallError => e + [false, specific_failure_message(e)] end private @@ -51,7 +51,20 @@ module Bundler end def install - spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone, :build_args => Array(spec_settings)) + spec.source.install( + spec, + force: force, + ensure_builtin_gems_cached: standalone, + build_args: Array(spec_settings), + previous_spec: previous_spec, + ) + end + + def previous_spec + locked_gems = installer.definition.locked_gems + return unless locked_gems + + locked_gems.specs.find {|s| s.name == spec.name } end def out_of_space_message @@ -64,7 +77,7 @@ module Bundler if Bundler.settings[:bin] && standalone installer.generate_standalone_bundler_executable_stubs(spec) elsif Bundler.settings[:bin] - installer.generate_bundler_executable_stubs(spec, :force => true) + installer.generate_bundler_executable_stubs(spec, force: true) end end end |