Class: Pod::Command::Cache::Proxy::Auth::Add
- Inherits:
-
Pod::Command::Cache::Proxy::Auth
- Object
- Pod::Command
- Pod::Command::Cache
- Pod::Command::Cache::Proxy
- Pod::Command::Cache::Proxy::Auth
- Pod::Command::Cache::Proxy::Auth::Add
- Defined in:
- lib/cocoapods-cache-proxy/command/cache_proxy/auth/add.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ Add
constructor
A new instance of Add.
- #run ⇒ Object
- #validate! ⇒ Object
Methods inherited from Pod::Command::Cache::Proxy::Auth
Methods inherited from Pod::Command::Cache::Proxy
Constructor Details
#initialize(argv) ⇒ Add
Returns a new instance of Add.
20 21 22 23 24 25 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/add.rb', line 20 def initialize(argv) init @host, @token = argv.shift_argument, argv.shift_argument @silent = argv.flag?('silent', false) super end |
Instance Method Details
#run ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/add.rb', line 33 def run raise Pod::Informative.exception "`#{@host}` 已经存在" if CPSH.check_auth_conf_exists(@host) UI.section("Add proxy auth config `#{@host}`".green) do CPSH.init_cache_proxy_auth(@host, @token) end end |
#validate! ⇒ Object
27 28 29 30 31 |
# File 'lib/cocoapods-cache-proxy/command/cache_proxy/auth/add.rb', line 27 def validate! super help! 'This command requires both a auth host.' unless @host help! 'This command requires both a auth token.' unless @token end |