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

Methods inherited from Pod::Command::Repo

#branch_name, #branch_remote_name, #dir, #url_of_git_repo

Methods inherited from Pod::Command

parse, report_error, run, verify_git_version!

Methods included from Pod::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ Push

Returns a new instance of Push.



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

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

Class Method Details

.optionsObject



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

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

Instance Method Details

#runObject



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

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



35
36
37
38
# File 'lib/cocoapods/command/repo/push.rb', line 35

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