summaryrefslogtreecommitdiff
path: root/lib/bundler/plugin.rb
diff options
context:
space:
mode:
authorAsutosh Palai <asupalai@gmail.com>2016-06-22 20:32:40 +0530
committerAsutosh Palai <asupalai@gmail.com>2016-07-03 09:41:58 +0530
commit8ebb03557ad50d76d45bd9d849d114c22067a437 (patch)
tree86f856cada240fa7b6bf12555c072fc33ad449ce /lib/bundler/plugin.rb
parent5fc02346aa552f09ed2bec75fedae58af77d18dd (diff)
downloadbundler-8ebb03557ad50d76d45bd9d849d114c22067a437.tar.gz
Added caching
Diffstat (limited to 'lib/bundler/plugin.rb')
-rw-r--r--lib/bundler/plugin.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
index 85ae33af17..de811505bb 100644
--- a/lib/bundler/plugin.rb
+++ b/lib/bundler/plugin.rb
@@ -49,10 +49,13 @@ module Bundler
return if definition.dependencies.empty?
- plugins = definition.dependencies.map(&:name)
+ plugins = definition.dependencies.map(&:name).reject {|p| index.installed? p }
install_paths = Installer.new.install_definition(definition)
save_plugins plugins, install_paths, builder.inferred_plugins
+ rescue => e
+ Bundler.ui.error "Failed to install plugin: #{e.message}\n #{e.backtrace[0]}"
+ raise
end
# The index object used to store the details about the plugin
@@ -133,8 +136,8 @@ module Bundler
plugins.each do |name|
path = Pathname.new paths[name]
validate_plugin! path
- register_plugin name, path, optional_plugins.include?(name)
- Bundler.ui.info "Installed plugin #{name}"
+ installed = register_plugin name, path, optional_plugins.include?(name)
+ Bundler.ui.info "Installed plugin #{name}" if installed
end
end
@@ -171,8 +174,10 @@ module Bundler
if optional_plugin && @sources.keys.any? {|s| source? s }
Bundler.rm_rf(path)
+ false
else
index.register_plugin name, path.to_s, @commands.keys, @sources.keys
+ true
end
ensure
@commands = commands