Skip to content
Browse files

Command to list all available pods

  • Loading branch information...
1 parent aa4549f commit 8c8c6de95a9b60367b39acf6bf1ad3d0ae153496 @chriseidhof chriseidhof committed Dec 18, 2011
Showing with 27 additions and 0 deletions.
  1. +3 −0 lib/cocoapods/command.rb
  2. +24 −0 lib/cocoapods/command/list.rb
View
3 lib/cocoapods/command.rb
@@ -3,6 +3,7 @@ class Command
autoload :Install, 'cocoapods/command/install'
autoload :Repo, 'cocoapods/command/repo'
autoload :Search, 'cocoapods/command/search'
+ autoload :List, 'cocoapods/command/list'
autoload :Setup, 'cocoapods/command/setup'
autoload :Spec, 'cocoapods/command/spec'
@@ -35,6 +36,7 @@ def self.banner
"\n" \
" * $ pod setup --help\n" \
" * $ pod search --help\n" \
+ " * $ pod list --help\n" \
" * $ pod install --help\n" \
" * $ pod repo --help\n" \
" * $ pod spec --help"
@@ -72,6 +74,7 @@ def self.parse(*argv)
when 'install' then Install
when 'repo' then Repo
when 'search' then Search
+ when 'list' then List
when 'setup' then Setup
when 'spec' then Spec
end
View
24 lib/cocoapods/command/list.rb
@@ -0,0 +1,24 @@
+module Pod
+ class Command
+ class List < Command
+ def self.banner
+%{List all pods:
+
+ $ pod list
+
+ Lists all available pods.}
+ end
+
+ def initialize(argv)
+ end
+
+ def run
+ Source.search_by_name('', false).each do |set|
+ puts "==> #{set.name} (#{set.versions.reverse.join(", ")})"
+ puts " #{set.specification.summary.strip}"
+ puts
+ end
+ end
+ end
+ end
+end

0 comments on commit 8c8c6de

Please sign in to comment.
Something went wrong with that request. Please try again.