diff options
author | fotanus <fotanus@gmail.com> | 2017-05-24 16:31:30 -0300 |
---|---|---|
committer | fotanus <fotanus@gmail.com> | 2017-05-30 14:27:29 -0300 |
commit | a08d08eb9854435ba6d5ef513d95e295ab19e8a6 (patch) | |
tree | 97911883bb2772c270f0057d3a287188e0a541e7 /lib/bundler/plugin.rb | |
parent | bf26b5515926c51008f2fe9e9d0054260d482e74 (diff) | |
download | bundler-a08d08eb9854435ba6d5ef513d95e295ab19e8a6.tar.gz |
implement command `bundle 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 66f485ef8e..1e9c40fe49 100644 --- a/lib/bundler/plugin.rb +++ b/lib/bundler/plugin.rb @@ -45,6 +45,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 # |