summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/list.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/cli/list.rb')
-rw-r--r--lib/bundler/cli/list.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/bundler/cli/list.rb b/lib/bundler/cli/list.rb
new file mode 100644
index 0000000000..623e2bc076
--- /dev/null
+++ b/lib/bundler/cli/list.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Bundler
+ class CLI::List
+ def run
+ specs = Bundler.load.specs.reject {|s| s.name == "bundler" }
+
+ return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
+ Bundler.ui.info "Gems included by the bundle:"
+ specs.sort_by(&:name).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