class Pod::Command::Repo::Push

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/cocoapods-lint-onlyx64/command/onlyx64.rb, line 267
def initialize(argv)
  @allow_warnings = argv.flag?('allow-warnings')
  @local_only = argv.flag?('local-only')
  @repo = argv.shift_argument
  @source = source_for_repo
  @source_urls = argv.option('sources', config.sources_manager.all.map(&:url).join(',')).split(',')
  @podspec = argv.shift_argument
  @use_frameworks = !argv.flag?('use-libraries')
  @use_modular_headers = argv.flag?('use-modular-headers', false)
  @private = argv.flag?('private', true)
  @message = argv.option('commit-message')
  @commit_message = argv.flag?('commit-message', false)
  @use_json = argv.flag?('use-json')
  @swift_version = argv.option('swift-version', nil)
  @skip_import_validation = argv.flag?('skip-import-validation', false)
  @skip_tests = argv.flag?('skip-tests', false)
  @allow_overwrite = argv.flag?('overwrite', true)
  @only_x64 = argv.flag?('onlyx64', false)
  super
end
options() click to toggle source
Calls superclass method
# File lib/cocoapods-lint-onlyx64/command/onlyx64.rb, line 246
def self.options
  [
    ['--allow-warnings', 'Allows pushing even if there are warnings'],
    ['--use-libraries', 'Linter uses static libraries to install the spec'],
    ['--use-modular-headers', 'Lint uses modular headers during installation'],
    ["--sources=#{Pod::TrunkSource::TRUNK_REPO_URL}", 'The sources from which to pull dependent pods ' \
     '(defaults to all available repos). Multiple sources must be comma-delimited'],
    ['--local-only', 'Does not perform the step of pushing REPO to its remote'],
    ['--no-private', 'Lint includes checks that apply only to public repos'],
    ['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
    ['--skip-tests', 'Lint skips building and running tests during validation'],
    ['--commit-message="Fix bug in pod"', 'Add custom commit message. Opens default editor if no commit ' \
      'message is specified'],
    ['--use-json', 'Convert the podspec to JSON before pushing it to the repo'],
    ['--swift-version=VERSION', 'The `SWIFT_VERSION` that should be used when linting the spec. ' \
     'This takes precedence over the Swift versions specified by the spec or a `.swift-version` file'],
    ['--no-overwrite', 'Disallow pushing that would overwrite an existing spec'],
    ['--onlyx64', 'Lint uses only x86-64 iphonesimulator'],
  ].concat(super)
end

Public Instance Methods

validate_podspec_files() click to toggle source
# File lib/cocoapods-lint-onlyx64/command/onlyx64.rb, line 288
def validate_podspec_files
  UI.puts "\nValidating #{'spec'.pluralize(count)}".yellow
  podspec_files.each do |podspec|
    validator = Validator.new(podspec, @source_urls)
    validator.allow_warnings = @allow_warnings
    validator.use_frameworks = @use_frameworks
    validator.use_modular_headers = @use_modular_headers
    validator.ignore_public_only_results = @private
    validator.swift_version = @swift_version
    validator.skip_import_validation = @skip_import_validation
    validator.skip_tests = @skip_tests
    validator.only_x64 = @only_x64
    begin
      validator.validate
    rescue => e
      raise Informative, "The `#{podspec}` specification does not validate." \
                         "\n\n#{e.message}"
    end
    raise Informative, "The `#{podspec}` specification does not validate." unless validator.validated?
  end
end