Class: Pod::Command::Cache::Proxy::Update

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

Instance Method Summary collapse

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

#init

Constructor Details

#initialize(argv) ⇒ Update

Returns a new instance of Update.



21
22
23
24
25
26
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/update.rb', line 21

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

Instance Method Details

#runObject



36
37
38
39
40
41
42
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/update.rb', line 36

def run
    raise Pod::Informative.exception "`#{@name}` 不存在" unless CPSH.check_cache_proxy_source_conf_exists(@name)
    
    UI.section("update cache proxy repo `#{@name}`") do
        CPSH.init_cache_proxy_source(@name, @url, @user, @password)
    end
end

#validate!Object



28
29
30
31
32
33
34
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/update.rb', line 28

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