summaryrefslogtreecommitdiff
path: root/lib/bundler/plugin.rb
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-10-22 21:44:15 +0000
committerThe Bundler Bot <bot@bundler.io>2017-10-22 21:44:15 +0000
commit8aea2144ad919d4a9507a767ee043f4eba14e4ff (patch)
tree742eeebb552953af87aa3a3a6fc433eeab480e3f /lib/bundler/plugin.rb
parentf093e405a8e10bafa0b5d4621069a0b7ad86c37f (diff)
parente1dfa07f7b3c09fe34119bb876dfb22801c69bb3 (diff)
downloadbundler-8aea2144ad919d4a9507a767ee043f4eba14e4ff.tar.gz
Auto merge of #6120 - jumbosushi:plugin_list, r=indirect
Add plugin list command This is a continuation of PR #5672 which was originally created to fix Issue #5467 Fixes a typo from the last PR, and add additional test files to check Bundler::Plugin#list
Diffstat (limited to 'lib/bundler/plugin.rb')
-rw-r--r--lib/bundler/plugin.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb
index 7db159c593..f7e6093fa5 100644
--- a/lib/bundler/plugin.rb
+++ b/lib/bundler/plugin.rb
@@ -46,6 +46,26 @@ module Bundler
Bundler.ui.error "Failed to install plugin #{name}: #{e.message}\n #{e.backtrace.join("\n ")}"
end
+ # List installed plugins and commands
+ #
+ def list
+ installed_plugins = index.installed_plugins
+ if installed_plugins.any?
+ output = String.new
+ installed_plugins.each do |plugin|
+ output << "#{plugin}\n"
+ output << "-----\n"
+ index.plugin_commands(plugin).each do |command|
+ output << " #{command}\n"
+ end
+ output << "\n"
+ end
+ else
+ output = "No plugins installed"
+ end
+ Bundler.ui.info output
+ end
+
# Evaluates the Gemfile with a limited DSL and installs the plugins
# specified by plugin method
#