class StoryPullRequest

Public Instance Methods

cmd() click to toggle source

Returns a command appropriate for executing at the command line

# File lib/pivotal-github/story_pull_request.rb, line 37
def cmd
  Dir.mkdir '.pull_requests' unless File.directory?('.pull_requests')
  c =  ["touch .pull_requests/`date '+%s'`"]
  c << "git add ."
  c << %(git commit -m "#{short_message}" -m "#{long_message}")
  c << "git pull-request"
  c.join("\n")
end
delivers_url(id) click to toggle source

Returns the (Markdown) link for a delivered story id.

# File lib/pivotal-github/story_pull_request.rb, line 21
def delivers_url(id)
  "[Delivers ##{id}](#{story_url(id)})"
end
long_message() click to toggle source

Returns a commit message with links to all the delivered stories.

# File lib/pivotal-github/story_pull_request.rb, line 31
def long_message
  ids = delivered_ids_since_last_pr(fast_log_delivered_text)
  ids.map { |id| delivers_url(id) }.join("\n")
end
parser() click to toggle source
# File lib/pivotal-github/story_pull_request.rb, line 8
def parser
  OptionParser.new do |opts|
    opts.banner = "Usage: git story-pull-request [options]"
    opts.on("-o", "--override", "override unfinished story warning") do |opt|
      self.options.override = opt
    end
    opts.on_tail("-h", "--help", "this usage guide") do
      puts opts.to_s; exit 0
    end
  end
end
short_message() click to toggle source

Returns a commit message with the branch being used for the pull request.

# File lib/pivotal-github/story_pull_request.rb, line 26
def short_message
  "Issue pull request for branch #{story_branch}"
end