class Gem::Tasks::Push
The ‘push` task.
def define
Defines the `push` task.
def define namespace :push do @project.builds.each do |build,packages| path = packages[:gem] task build => 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)
-
:host
(String
) --
Parameters:
-
options
(Hash
) --
def initialize(options={}) super() @host = options[:host] yield self if block_given? define end
def push(path)
-
(Boolean)
-
Parameters:
-
path
(String
) --
def push(path) arguments = ['gem', 'push', path] arguments.push('--host', @host) if @host return run(*arguments) end