diff options
author | The Bundler Bot <bot@bundler.io> | 2017-10-22 21:44:15 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2017-10-22 21:44:15 +0000 |
commit | 8aea2144ad919d4a9507a767ee043f4eba14e4ff (patch) | |
tree | 742eeebb552953af87aa3a3a6fc433eeab480e3f /lib/bundler/plugin.rb | |
parent | f093e405a8e10bafa0b5d4621069a0b7ad86c37f (diff) | |
parent | e1dfa07f7b3c09fe34119bb876dfb22801c69bb3 (diff) | |
download | bundler-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.rb | 20 |
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 # |