aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/cli/list.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 23:29:38 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 23:29:38 +0000
commitbe7b5929126cb3e696ef222339237faba9b8fe5a (patch)
tree51eae376f93c09bc82dde5a657a91df2c89062e4 /lib/bundler/cli/list.rb
parentae49dbd392083f69026f2a0fff4a1d5f42d172a7 (diff)
downloadruby-be7b5929126cb3e696ef222339237faba9b8fe5a.tar.gz
Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0. * common.mk: rspec examples of bundler-1.16.0 needs require option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/bundler/cli/list.rb')
-rw-r--r--lib/bundler/cli/list.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/bundler/cli/list.rb b/lib/bundler/cli/list.rb
new file mode 100644
index 0000000000..b5e7c1e650
--- /dev/null
+++ b/lib/bundler/cli/list.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+module Bundler
+ class CLI::List
+ def initialize(options)
+ @options = options
+ end
+
+ def run
+ specs = Bundler.load.specs.reject {|s| s.name == "bundler" }.sort_by(&:name)
+ return specs.each {|s| Bundler.ui.info s.name } if @options["name-only"]
+
+ return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
+ Bundler.ui.info "Gems included by the bundle:"
+ specs.each do |s|
+ Bundler.ui.info " * #{s.name} (#{s.version}#{s.git_version})"
+ end
+
+ Bundler.ui.info "Use `bundle info` to print more detailed information about a gem"
+ end
+ end
+end