Class: Gem::Tasks::SCM::Push
- Defined in:
- lib/rubygems/tasks/scm/push.rb
Overview
The scm:push
task.
Constant Summary
Constants included from Printing
Printing::ANSI_BRIGHT, Printing::ANSI_CLEAR, Printing::ANSI_GREEN, Printing::ANSI_RED, Printing::ANSI_YELLOW, Printing::DEBUG_PREFIX, Printing::ERROR_PREFIX, Printing::STATUS_PREFIX
Instance Attribute Summary
Attributes inherited from Task
Instance Method Summary collapse
-
#define ⇒ Object
Defines the
scm:push
task. -
#initialize(options = {}) {|_self| ... } ⇒ Push
constructor
Initializes the
scm:push
task. -
#push! ⇒ Boolean
Pushes commits.
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 scm:push
task.
17 18 19 20 21 22 |
# File 'lib/rubygems/tasks/scm/push.rb', line 17 def initialize(={}) super() yield self if block_given? define end |
Instance Method Details
#define ⇒ Object
Defines the scm:push
task.
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rubygems/tasks/scm/push.rb', line 27 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 |
#push! ⇒ Boolean
Pushes commits.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/rubygems/tasks/scm/push.rb', line 49 def push! case @project.scm when :git run 'git', 'push' run 'git', 'push', '--tags' when :hg run 'hg', 'push' else true end end |