Class: Pod::Command::Cache::Proxy::List

Inherits:
Pod::Command::Cache::Proxy show all
Defined in:
lib/cocoapods-cache-proxy/command/cache_proxy/list.rb

Instance Method Summary collapse

Methods inherited from Pod::Command::Cache::Proxy

#init

Constructor Details

#initialize(argv) ⇒ List

Returns a new instance of List.



15
16
17
18
19
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/list.rb', line 15

def initialize(argv)
    init
    @silent = argv.flag?('silent', false)
    super
end

Instance Method Details



30
31
32
33
34
35
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/list.rb', line 30

def print_source(source)
    if source.is_a?(Pod::CacheProxySource)
        UI.puts "- URL:  #{source.baseURL}"
        UI.puts "- Path: #{CPSH.get_source_root_dir(source.name)}"
    end
end


37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/list.rb', line 37

def print_sources(sources)
    sources.each do |source|
        if source.is_a?(Pod::CacheProxySource)
            UI.title source.name do
                UI.puts "- URL:  #{source.baseURL}"
                UI.puts "- Path: #{CPSH.get_source_root_dir(source.name)}"
            end
        end
    end
    UI.puts "\n"
end

#runObject



25
26
27
28
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/list.rb', line 25

def run
    sources = CPSH.get_all_sources
    print_sources(sources)
end

#validate!Object



21
22
23
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/list.rb', line 21

def validate!
    super
end