diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-10-15 13:20:25 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-10-15 17:19:02 +0900 |
commit | d386a58f6f1865aaa35eda5af55cff3ff3cca4ca (patch) | |
tree | 0665fe806540deae7f8e52095af6dba70f940aa3 /lib/bundler/plugin.rb | |
parent | 7ffd14a18c341565afaf80d259f9fe5df8a13d29 (diff) |
Merge bundler-2.2.0.rc.2
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3659
Diffstat (limited to 'lib/bundler/plugin.rb')
-rw-r--r-- | lib/bundler/plugin.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb index 2025e09b3d..da3f468da5 100644 --- a/lib/bundler/plugin.rb +++ b/lib/bundler/plugin.rb @@ -16,7 +16,7 @@ module Bundler PLUGIN_FILE_NAME = "plugins.rb".freeze - module_function + module_function def reset! instance_variables.each {|i| remove_instance_variable(i) } @@ -39,12 +39,11 @@ module Bundler save_plugins names, specs rescue PluginError => e - if specs - specs_to_delete = Hash[specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) }] - specs_to_delete.values.each {|spec| Bundler.rm_rf(spec.full_gem_path) } - end + specs_to_delete = specs.select {|k, _v| names.include?(k) && !index.commands.values.include?(k) } + specs_to_delete.each_value {|spec| Bundler.rm_rf(spec.full_gem_path) } - Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}" + names_list = names.map {|name| "`#{name}`" }.join(", ") + Bundler.ui.error "Failed to install the following plugins: #{names_list}. The underlying error was: #{e.message}.\n #{e.backtrace.join("\n ")}" end # Uninstalls plugins by the given names |