Class: GithubPivotalFlow::Finish

Inherits:
Command show all
Defined in:
lib/github_pivotal_flow/finish.rb

Instance Attribute Summary

Attributes inherited from Command

#configuration, #options

Instance Method Summary collapse

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from GithubPivotalFlow::Command

Instance Method Details

#run!Object

Finishes a Pivotal Tracker story



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/github_pivotal_flow/finish.rb', line 6

def run!
  raise_error_if_development_or_master
  story = @configuration.story
  fail("Could not find story associated with branch") unless story
  story.can_merge?
  commit_message = options[:commit_message]
  if story.release?
    story.merge_release!(commit_message, @options)
  else
    story.merge_to_root!(commit_message, @options)
  end
  return 0
end