Class: Pod::Command::Binary::Package

Inherits:
Pod::Command::Binary show all
Defined in:
lib/cocoapods-tdfire-binary/command/package.rb

Constant Summary

Constants inherited from Pod::Command::Binary

FIRE_FLAG

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Binary

#fire_sources, #first_podspec

Constructor Details

#initialize(argv) ⇒ Package

Returns a new instance of Package.



23
24
25
26
27
28
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 23

def initialize(argv)
  @clean = argv.flag?('clean')
  @spec_sources = argv.option('spec-sources')
  @spec_file = first_podspec
  super
end

Class Method Details

.optionsObject



16
17
18
19
20
21
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 16

def self.options
  [
    ['--clean', '执行成功后,删除 zip 文件外的所有生成文件'],
    ['--spec-sources', '私有源地址'],
  ].concat(super)
end

Instance Method Details

#runObject



35
36
37
38
39
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 35

def run
  spec = Specification.from_file(@spec_file)
  package(spec)
  zip(spec)
end

#validate!Object



30
31
32
33
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 30

def validate!
  super
  help! '当前目录下没有podspec文件.' if @spec_file.nil?
end