summaryrefslogtreecommitdiff
path: root/lib/bundler/plugin.rb
diff options
context:
space:
mode:
authorAsutosh Palai <asupalai@gmail.com>2016-06-07 11:13:46 +0530
committerAsutosh Palai <asupalai@gmail.com>2016-06-07 12:40:19 +0530
commitd4a9f2e7b0fc332d843ce6835c2b29bdae1e9184 (patch)
tree1480b1371c6f28022058e9284e1524032337a5ca /lib/bundler/plugin.rb
parent5a30dc76ba27fa12d6ffd56b18cd8e022e69d07e (diff)
downloadbundler-d4a9f2e7b0fc332d843ce6835c2b29bdae1e9184.tar.gz
Added unit test form plugin module
Diffstat (limited to 'lib/bundler/plugin.rb')
-rw-r--r--lib/bundler/plugin.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
index 8de8dab06f..7e1f616956 100644
--- a/lib/bundler/plugin.rb
+++ b/lib/bundler/plugin.rb
@@ -30,7 +30,7 @@ module Bundler
register_plugin name, plugin_path
Bundler.ui.info "Installed plugin #{name}"
- rescue StandardError => e
+ rescue PluginError => e
Bundler.rm_rf(plugin_path) if plugin_path
Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
end
@@ -111,7 +111,11 @@ module Bundler
@commands = {}
- load path.join(PLUGIN_FILE_NAME), true
+ begin
+ load path.join(PLUGIN_FILE_NAME), true
+ rescue StandardError => e
+ raise MalformattedPlugin, "#{e.class}: #{e.message}"
+ end
index.register_plugin name, path.to_s, @commands.keys
ensure