Class: StoryPush
Instance Attribute Summary
Attributes inherited from Command
#args, #known_options, #options, #unknown_options
Instance Method Summary collapse
-
#cmd ⇒ Object
Returns a command appropriate for executing at the command line.
- #parser ⇒ Object
- #run! ⇒ Object
Methods inherited from Command
#initialize, #parse, run!, #story_branch, #story_id, #story_ids
Constructor Details
This class inherits a constructor from Command
Instance Method Details
#cmd ⇒ Object
Returns a command appropriate for executing at the command line
19 20 21 22 23 24 25 |
# File 'lib/pivotal-github/story_push.rb', line 19 def cmd c = ['git push'] c << argument_string() unless .empty? c << target c << story_branch c.join(' ') end |
#parser ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/pivotal-github/story_push.rb', line 5 def parser OptionParser.new do |opts| opts. = "Usage: git story-push [options]" opts.on("-t", "--target TARGET", "push to a given target (defaults to origin)") do |t| self..target = t end opts.on_tail("-h", "--help", "this usage guide") do puts opts.to_s; exit 0 end end end |
#run! ⇒ Object
27 28 29 |
# File 'lib/pivotal-github/story_push.rb', line 27 def run! system cmd end |