diff options
author | Steve Frank <lardcanoe@gmail.com> | 2014-02-08 14:15:42 -0500 |
---|---|---|
committer | Steve Frank <lardcanoe@gmail.com> | 2014-02-20 23:02:18 -0500 |
commit | 5d7473d2e72a7d53015490e70e77b59c2f483eed (patch) | |
tree | f1d2424bbed9c40c81b13cb900222beb5545bd58 | |
parent | bb8f694147cb07cd820297978b0378ffa4c6d54b (diff) | |
download | bundler-5d7473d2e72a7d53015490e70e77b59c2f483eed.tar.gz |
Add summary option to 'show' cli command
Add summary option to 'show' cli command
Add summary option to 'show' cli command
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | lib/bundler/cli/show.rb | 8 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 7 |
3 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 063a017c..d7d90f36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Features: - highlight installed or updated gems (#2722, #2741, @yaotti, @simi) - display the `post_install_message` for gems installed via :git (@phallstrom) - `bundle outdated --strict` now only reports allowed updates (@davidblondeau) + - `bundle show --verbose` Add gem ummary to the output (@lardcanoe) ## 1.5.3 (2014-02-06) diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb index a2269a6c..07ff63dc 100644 --- a/lib/bundler/cli/show.rb +++ b/lib/bundler/cli/show.rb @@ -35,10 +35,14 @@ module Bundler else Bundler.ui.info "Gems included by the bundle:" Bundler.load.specs.sort_by { |s| s.name }.each do |s| - Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})" + desc = " * #{s.name} (#{s.version}#{s.git_version})" + if @options[:verbose] + Bundler.ui.info "#{desc} - #{s.summary || 'No description available.'}" + else + Bundler.ui.info desc + end end end end - end end diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 2e825f5a..01a2c2a5 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -59,6 +59,13 @@ describe "bundle show" do gem_list = out.split.map { |p| p.split('/').last } expect(gem_list).to eq(gem_list.sort) end + + it "prints summary of gems" do + bundle "show --verbose" + + expect(out).to include(' - This is just a fake gem for testing') + expect(out).to include(' - Ruby based make-like utility.') + end end context "with a git repo in the Gemfile" do |