Class: Pod::Command::Podgenerate

Inherits:
Pod::Command show all
Defined in:
lib/cocoapods-podgenerate/command.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Podgenerate

Returns a new instance of Podgenerate.



33
34
35
36
37
38
# File 'lib/cocoapods-podgenerate/command.rb', line 33

def initialize(argv)
  @debug = argv.flag?('debug', false)
  # v0.1.4: 保存原始参数,稍后传递给 pod install(修复 M7)
  @remaining_argv = argv
  super
end

Class Method Details

.optionsObject



27
28
29
30
31
# File 'lib/cocoapods-podgenerate/command.rb', line 27

def self.options
  [
    ['--debug', 'Enable verbose profiling output and detailed timing logs']
  ].concat(super)
end

Instance Method Details

#runObject



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/cocoapods-podgenerate/command.rb', line 40

def run
  if @debug
    Pod::PodGenerate::Benchmark::Profiler.enable!
    Pod::UI.puts '[cocoapods-podgenerate] Debug mode enabled — verbose profiling output will be shown.'
  end

  Pod::PodGenerate.activate

  # 委托给标准的 pod install 命令执行
  # v0.1.4: 传递用户原参数给 pod install(修复 M7)
  install_command = Pod::Command::Install.new(CLAide::ARGV.new(@remaining_argv.remainder!))
  install_command.run
end