Class: StoryMerge
- Inherits:
-
FinishedCommand
- Object
- Command
- FinishedCommand
- StoryMerge
- Defined in:
- lib/pivotal-github/story_merge.rb
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 For example: git checkout master git merge –no-ff <story branch>.
- #parser ⇒ Object
Methods inherited from FinishedCommand
Methods inherited from Command
#initialize, #message, #message_ids, #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 For example:
git checkout master
git merge --no-ff <story branch>
30 31 32 33 34 35 36 37 38 |
# File 'lib/pivotal-github/story_merge.rb', line 30 def cmd lines = ["git checkout #{target_branch}"] c = ["git merge --no-ff --log"] c << %(-m "#{}") unless story_ids.empty? c << argument_string() unless .empty? c << story_branch lines << c.join(' ') lines.join("\n") end |
#parser ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pivotal-github/story_merge.rb', line 6 def parser OptionParser.new do |opts| opts. = "Usage: git story-merge [branch] [options]" opts.on("-o", "--override", "override unfinished story warning") do |opt| self..override = opt end opts.on("-f", "--finish", "mark story as finished") do |opt| self..finish = opt self..override = opt end opts.on("-d", "--deliver", "mark story as delivered") do |opt| self..deliver = opt self..override = opt end opts.on_tail("-h", "--help", "this usage guide") do puts opts.to_s; exit 0 end end end |