Class: Pod::Command::Binary::Init
- Inherits:
-
Pod::Command::Binary
- Object
- Pod::Command
- Pod::Command::Binary
- Pod::Command::Binary::Init
- Defined in:
- lib/cocoapods-tdfire-binary/command/init.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Init
constructor
A new instance of Init.
- #run ⇒ Object
Methods inherited from Pod::Command::Binary
#binary_config, #first_podspec, #private_sources
Constructor Details
#initialize(argv) ⇒ Init
Returns a new instance of Init.
21 22 23 24 25 |
# File 'lib/cocoapods-tdfire-binary/command/init.rb', line 21 def initialize(argv) @without_ask = argv.flag?('without-ask') @asker = Pod::Tdfire::InitAsker.new super end |
Class Method Details
.options ⇒ Object
15 16 17 18 19 |
# File 'lib/cocoapods-tdfire-binary/command/init.rb', line 15 def self. [ ['--without-ask', '直接下载配置'], ].concat(super) end |
Instance Method Details
#run ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cocoapods-tdfire-binary/command/init.rb', line 27 def run @asker. if @without_ask binary_config.clone_default_config else hash = binary_config.setting_hash Pod::Tdfire::InitAsker::QUESTIONS.each do |k, v| default = hash[k] if hash hash[k] = @asker.ask_with_answer(v, default) end binary_config.config_with_setting(hash) end @asker. end |