Class: Pod::Command::Cache::Proxy::Auth::List
- Inherits:
-
Pod::Command::Cache::Proxy::Auth
- Object
- Pod::Command
- Pod::Command::Cache
- Pod::Command::Cache::Proxy
- Pod::Command::Cache::Proxy::Auth
- Pod::Command::Cache::Proxy::Auth::List
- Defined in:
- lib/cocoapods-cache-proxy/command/cache_proxy/auth/list.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ List
constructor
A new instance of List.
- #print_auth(auth) ⇒ Object
- #print_auths(auths) ⇒ Object
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command::Cache::Proxy::Auth
Methods inherited from Pod::Command::Cache::Proxy
Constructor Details
#initialize(argv) ⇒ List
Returns a new instance of List.
16 17 18 19 20 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/list.rb', line 16 def initialize(argv) init @silent = argv.flag?('silent', false) super end |
Instance Method Details
#print_auth(auth) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/list.rb', line 31 def print_auth(auth) if auth.is_a?(Pod::CacheProxyAuth) UI.puts "- Host: #{auth.host}" UI.puts "- Token: #{auth.token}" end end |
#print_auths(auths) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/list.rb', line 38 def print_auths(auths) auths.each_with_index do |auth, index| if auth.is_a?(Pod::CacheProxyAuth) UI.title "auth config: #{index + 1}" do UI.puts "- Host: #{auth.host}" UI.puts "- Token: #{auth.token}" end end end UI.puts "\n" end |
#run ⇒ Object
26 27 28 29 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/list.rb', line 26 def run auths = CPSH.get_all_auths print_auths(auths) end |
#validate! ⇒ Object
22 23 24 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/list.rb', line 22 def validate! super end |