class Gem::Tasks::SCM::Push


The ‘scm:push` task.

def define


Defines the `scm:push` task.
def define
  task :validate
  namespace :scm do
    task :push => :validate do
      status "Pushing commits ..."
      unless push!
        error "Could not push commits"
      end
    end
  end
end

def initialize(options={})

Parameters:
  • options (Hash) --
def initialize(options={})
  super()
  yield self if block_given?
  define
end

def push!

Other tags:
    Api: - semipublic

Returns:
  • (Boolean) -
def push!
  case @project.scm
  when :git
    run 'git', 'push'
    run 'git', 'push', '--tags'
  when :hg 
    run 'hg', 'push'
  else
    true
  end
end