Class: Pod::Command::Repo::Push

Inherits:
Pod::Command::Repo show all
Extended by:
Executable
Defined in:
lib/cocoapods/command/repo/push.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Executable

executable, execute_command, which

Methods inherited from Pod::Command::Repo

#dir

Methods inherited from Pod::Command

#ensure_master_spec_repo_exists!, report_error, run

Methods included from Pod::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ Push

Returns a new instance of Push.



28
29
30
31
32
33
34
35
# File 'lib/cocoapods/command/repo/push.rb', line 28

def initialize(argv)
  @allow_warnings = argv.flag?('allow-warnings')
  @local_only = argv.flag?('local-only')
  @repo = argv.shift_argument
  @podspec = argv.shift_argument
  @use_frameworks = !argv.flag?('use-libraries')
  super
end

Class Method Details

.optionsObject



22
23
24
25
26
# File 'lib/cocoapods/command/repo/push.rb', line 22

def self.options
  [['--allow-warnings', 'Allows pushing even if there are warnings'],
   ['--use-libraries', 'Linter uses static libraries to install the spec'],
   ['--local-only', 'Does not perform the step of pushing REPO to its remote']].concat(super)
end

Instance Method Details

#runObject



42
43
44
45
46
47
48
49
# File 'lib/cocoapods/command/repo/push.rb', line 42

def run
  check_if_master_repo
  validate_podspec_files
  check_repo_status
  update_repo
  add_specs_to_repo
  push_repo unless @local_only
end

#validate!Object



37
38
39
40
# File 'lib/cocoapods/command/repo/push.rb', line 37

def validate!
  super
  help! 'A spec-repo name is required.' unless @repo
end