Class: Gem::Tasks::Push
- Defined in:
- lib/rubygems/tasks/push.rb
Overview
The push
task.
Constant Summary
Constants included from Printing
Gem::Tasks::Printing::ANSI_BRIGHT, Gem::Tasks::Printing::ANSI_CLEAR, Gem::Tasks::Printing::ANSI_GREEN, Gem::Tasks::Printing::ANSI_RED, Gem::Tasks::Printing::ANSI_YELLOW, Gem::Tasks::Printing::DEBUG_PREFIX, Gem::Tasks::Printing::ERROR_PREFIX, Gem::Tasks::Printing::STATUS_PREFIX
Instance Attribute Summary collapse
-
#host ⇒ Object
The rubygems host to push gems to.
Attributes inherited from Task
Instance Method Summary collapse
-
#define ⇒ Object
Defines the
push
task. -
#initialize(options = {}) {|_self| ... } ⇒ Push
constructor
Initializes the
push
task. -
#push(path) ⇒ Boolean
Pushes the gem by running
gem push
.
Methods inherited from Task
#bundle, #gem, #gemspec_tasks, #invoke, #namespaced_tasks, #run, #task?
Methods included from Printing
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Push
Initializes the push
task.
22 23 24 25 26 27 28 29 |
# File 'lib/rubygems/tasks/push.rb', line 22 def initialize(={}) super() @host = [:host] yield self if block_given? define end |
Instance Attribute Details
#host ⇒ Object
The rubygems host to push gems to.
11 12 13 |
# File 'lib/rubygems/tasks/push.rb', line 11 def host @host end |
Instance Method Details
#define ⇒ Object
Defines the push
task.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# 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) ⇒ Boolean
Pushes the gem by running gem push
.
70 71 72 73 74 75 |
# 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 |