Class: GithubPivotalFlow::Publish

Inherits:
Command show all
Defined in:
lib/github_pivotal_flow/publish.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

Publishes the branch and opens the pull request



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

def run!
  story = @configuration.story
  fail("Could not find story associated with branch") unless story
  Git.clean_working_tree?
  Git.push(story.branch_name, set_upstream: true)
  unless story.release?
    print "Creating pull-request on Github... "
    pull_request_params = story.params_for_pull_request.merge(project: @configuration.project)
    @configuration.github_client.create_pullrequest(pull_request_params)
    puts 'OK'
  end
  return 0
end