class Gem::Tasks::Push
The `push` task.
Attributes
host[RW]
The rubygems host to push gems to.
Public Class Methods
new(options={}) { |self| ... }
click to toggle source
Initializes the `push` task.
@param [Hash] options
Additional options.
@option options [String] :host
The rubygems host to push gems to.
Calls superclass method
# File lib/rubygems/tasks/push.rb, line 22 def initialize(options={}) super() @host = options[:host] yield self if block_given? define end
Public Instance Methods
define()
click to toggle source
Defines the `push` task.
# File lib/rubygems/tasks/push.rb, line 34 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
push(path)
click to toggle source
Pushes the gem by running `gem push`.
@param [String] path
The path to the `.gem` file.
@return [Boolean]
Specifies whether `gem push` was successful or not.
@api semipublic
# File lib/rubygems/tasks/push.rb, line 70 def push(path) arguments = ['gem', 'push', path] arguments.push('--host', @host) if @host return run(*arguments) end