Class: Pod::Command::Bin::Spec::Lint

Inherits:
Pod::Command::Bin::Spec show all
Defined in:
lib/cocoapods-pahealth-bin/command/bin/spec/lint.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Bin

#validate!

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

#code_source, #sources_manager, #sources_option, #valid_sources

Constructor Details

#initialize(argv) ⇒ Lint

Returns a new instance of Lint.



24
25
26
27
28
29
30
31
32
# File 'lib/cocoapods-pahealth-bin/command/bin/spec/lint.rb', line 24

def initialize(argv)
  @podspec = argv.shift_argument
  @release = argv.flag?('release',false )
  @sources = argv.option('sources')
  @allow_prerelease = argv.flag?('allow-prerelease')
  super

  @additional_args = argv.remainder!
end

Class Method Details

.optionsObject



18
19
20
21
22
# File 'lib/cocoapods-pahealth-bin/command/bin/spec/lint.rb', line 18

def self.options
  [
      ['--release', '在 release 环境下进行 lint']
  ].concat(Pod::Command::Spec::Lint.options).concat(super).uniq
end

Instance Method Details

#runObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cocoapods-pahealth-bin/command/bin/spec/lint.rb', line 34

def run
  Podfile.execute_with_bin_plugin do
    Podfile.execute_with_allow_prerelease(@allow_prerelease) do
      argvs = [
          "--sources=#{sources_option(@release, @sources)+','+Pod::TrunkSource::TRUNK_REPO_URL}",
          *@additional_args
      ]
      argvs << spec_file if spec_file
      lint = Pod::Command::Spec::Lint.new(CLAide::ARGV.new(argvs))
      lint.validate!
      lint.run
    end
  end
end