Permalink
Browse files

Merge pull request #99 from chriseidhof/master

List command
  • Loading branch information...
2 parents bfac255 + a8c7f08 commit b85b9bdfb08e798aa6b48c74b8b3ac22e39182d2 @alloy alloy committed Feb 1, 2012
Showing with 29 additions and 0 deletions.
  1. +3 −0 lib/cocoapods/command.rb
  2. +26 −0 lib/cocoapods/command/list.rb
View
@@ -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
@@ -0,0 +1,26 @@
+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.all.each do |source|
+ source.pod_sets.each do |set|
+ puts "==> #{set.name} (#{set.versions.reverse.join(", ")})"
+ puts " #{set.specification.summary.strip}"
+ puts
+ end
+ end
+ end
+ end
+ end
+end

0 comments on commit b85b9bd

Please sign in to comment.