diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-08 14:19:04 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-13 07:54:37 +0900 |
commit | 0e60b59d5884edb8f9aea023efd9b24f1ff02049 (patch) | |
tree | e52935ce510440872ca5ce6b0e092cbc94f18bc9 /lib/bundler/installer | |
parent | 68224651a4d4dc3ce0cea666f5423dd8b6ba6cfc (diff) |
Update the bundler version with master branch
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3086
Diffstat (limited to 'lib/bundler/installer')
-rw-r--r-- | lib/bundler/installer/gem_installer.rb | 4 | ||||
-rw-r--r-- | lib/bundler/installer/parallel_installer.rb | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb index 9689911d6c..b41b3fdf28 100644 --- a/lib/bundler/installer/gem_installer.rb +++ b/lib/bundler/installer/gem_installer.rb @@ -19,11 +19,11 @@ module Bundler 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, APIResponseMismatchError + rescue Bundler::InstallHookError, Bundler::SecurityError, Bundler::APIResponseMismatchError raise rescue Errno::ENOSPC return false, out_of_space_message - rescue StandardError => e + rescue Bundler::BundlerError, Gem::InstallError, Bundler::APIResponseInvalidDependenciesError => e return false, specific_failure_message(e) end diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb index 391540af0b..3dee9f4664 100644 --- a/lib/bundler/installer/parallel_installer.rb +++ b/lib/bundler/installer/parallel_installer.rb @@ -99,7 +99,7 @@ module Bundler install_serially end - handle_error if @specs.any?(&:failed?) + handle_error if failed_specs.any? @specs ensure worker_pool && worker_pool.stop @@ -132,6 +132,10 @@ module Bundler private + def failed_specs + @specs.select(&:failed?) + end + def install_with_worker enqueue_specs process_specs until finished_installing? @@ -156,11 +160,7 @@ module Bundler gem_installer = Bundler::GemInstaller.new( spec_install.spec, @installer, @standalone, worker_num, @force ) - success, message = begin - gem_installer.install_from_spec - rescue RuntimeError => e - raise e, "#{e}\n\n#{require_tree_for_spec(spec_install.spec)}" - end + success, message = gem_installer.install_from_spec if success spec_install.state = :installed spec_install.post_install_message = message unless message.nil? @@ -190,11 +190,11 @@ module Bundler end def handle_error - errors = @specs.select(&:failed?).map(&:error) + errors = failed_specs.map(&:error) if exception = errors.find {|e| e.is_a?(Bundler::BundlerError) } raise exception end - raise Bundler::InstallError, errors.map(&:to_s).join("\n\n") + raise Bundler::InstallError, errors.join("\n\n") end def require_tree_for_spec(spec) |