Class: Pod::Command::Cache::Proxy::Auth::Remove

Inherits:
Pod::Command::Cache::Proxy::Auth show all
Defined in:
lib/cocoapods-cache-proxy/command/cache_proxy/auth/remove.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) ⇒ Remove

Returns a new instance of Remove.



19
20
21
22
23
24
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/remove.rb', line 19

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

Instance Method Details

#runObject



31
32
33
34
35
36
37
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/remove.rb', line 31

def run
  raise Pod::Informative.exception "`#{@host}` 不存在" unless CPSH.check_auth_conf_exists(@host)

  UI.section("remove cache proxy auth `#{@host}`".green) do
    CPSH.remove_cache_proxy_auth(@host)
  end
end

#validate!Object



26
27
28
29
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/remove.rb', line 26

def validate!
  super
  help! 'This command requires both a auth host.' unless @host
end