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

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

Instance Method Summary collapse

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

#init

Constructor Details

#initialize(argv) ⇒ Remove

Returns a new instance of Remove.



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

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

Instance Method Details

#runObject



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

def run
    raise Pod::Informative.exception "`#{@name}` 不存在" unless CPSH.check_cache_proxy_source_conf_exists(@name)
    
    UI.section("remove cache proxy repo `#{@name}`") do
        CPSH.remove_cache_proxy_source(@name)
    end
end

#validate!Object



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

def validate!
    super
    unless @name
        help! 'This command requires both a repo name.'
    end
end