class Gem::Tasks::Push


The ‘push` task.

def define


Defines the `push` task.
def define
  task :validate
  namespace :push do
    @project.builds.each do |build,packages|
      path = packages[:gem]
      task build => [:validate, path] do
        if @host
          status "Pushing #{File.basename(path)} to #{@host} ..."
        else
          status "Pushing #{File.basename(path)} ..."
        end
        push(path)
      end
    end
  end
  gemspec_tasks :push
  # backwards compatibility for Hoe
  task :publish => :push
end

def initialize(options={})

Options Hash: (**options)
  • :host (String) --

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

def push(path)

Other tags:
    Api: - semipublic

Returns:
  • (Boolean) -

Parameters:
  • path (String) --
def push(path)
  arguments = ['gem', 'push', path]
  arguments.push('--host', @host) if @host
  return run(*arguments)
end