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



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

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

#validate!Object



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

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