class Pod::Command::List

Public Class Methods

new(argv) click to toggle source
Calls superclass method Pod::Command::new
# File lib/cocoapods/command/list.rb, line 14
def initialize(argv)
  @update = argv.flag?('update')
  @stats  = argv.flag?('stats')
  super
end
options() click to toggle source
Calls superclass method Pod::Command::options
# File lib/cocoapods/command/list.rb, line 7
def self.options
  [
    ['--update', 'Run `pod repo update` before listing'],
    ['--stats',  'Show additional stats (like GitHub watchers and forks)'],
  ].concat(super)
end

Public Instance Methods

run() click to toggle source
# File lib/cocoapods/command/list.rb, line 20
def run
  update_if_necessary!

  sets = config.sources_manager.aggregate.all_sets
  sets.each { |set| UI.pod(set, :name_and_version) }
  UI.puts "\n#{sets.count} pods were found"
end
update_if_necessary!() click to toggle source
# File lib/cocoapods/command/list.rb, line 28
def update_if_necessary!
  UI.section("\nUpdating Spec Repositories\n".yellow) do
    Repo::Update.new(CLAide::ARGV.new([])).run
  end if @update
end