Class: Pod::Command::Bin::Init
- Inherits:
-
Pod::Command::Bin
- Object
- Pod::Command
- Pod::Command::Bin
- Pod::Command::Bin::Init
- Defined in:
- lib/cocoapods-mtxx-bin/command/bin/init.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Init
constructor
A new instance of Init.
- #run ⇒ Object
Methods included from CBin::SpecFilesHelper
#binary_spec, #binary_spec_files, #binary_template_spec, #binary_template_spec_file, #binary_template_spec_files, #clear_binary_spec_file_if_needed, #code_spec, #code_spec_files, #create_binary_spec_file, #find_spec_file, #spec_files
Methods included from CBin::SourcesHelper
#binary_source, #code_source_list, #sources_manager, #sources_option, #valid_sources
Constructor Details
#initialize(argv) ⇒ Init
Returns a new instance of Init.
18 19 20 21 |
# File 'lib/cocoapods-mtxx-bin/command/bin/init.rb', line 18 def initialize(argv) @bin_url = argv.option('bin-url') super end |
Class Method Details
.options ⇒ Object
12 13 14 15 16 |
# File 'lib/cocoapods-mtxx-bin/command/bin/init.rb', line 12 def self. [ %w[--bin-url=URL 配置文件地址,直接从此地址下载配置文件] ].concat(super) end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/cocoapods-mtxx-bin/command/bin/init.rb', line 23 def run raise Informative, "当前目录下没有`Podfile`文件" unless File.exist?(File.join(Dir.pwd, "Podfile")) raise Informative, "当前目录下已经存在配置文件" if File.exist?(CBin.config.config_file) if @bin_url.nil? config_with_asker else config_with_url(@bin_url) end end |