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

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

Instance Method Summary collapse

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

#init

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

#init

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



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


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

#runObject



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