Class: Pod::Command::Cache::Proxy::List
- Inherits:
-
Pod::Command::Cache::Proxy
- Object
- Pod::Command
- Pod::Command::Cache
- Pod::Command::Cache::Proxy
- Pod::Command::Cache::Proxy::List
- Defined in:
- lib/cocoapods-cache-proxy/command/cache_proxy/list.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ List
constructor
A new instance of List.
- #print_source(source) ⇒ Object
- #print_sources(sources) ⇒ Object
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command::Cache::Proxy
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
#print_source(source) ⇒ Object
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 |
#print_sources(sources) ⇒ Object
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 |
#run ⇒ Object
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 |