Sha256: f5af68c6d468eca230a7594a618aaa354b179035f84675890ac3ab2c74429000
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
require 'pivotal-github/command' require 'pivotal-github/finished_command' class StoryPullRequest < FinishedCommand def parser OptionParser.new do |opts| opts.banner = "Usage: git story-pull-request [options]" opts.on("-f", "--force", "override unfinished story warning") do |opt| self.options.force = opt end opts.on_tail("-h", "--help", "this usage guide") do puts opts.to_s; exit 0 end end end # Returns a command appropriate for executing at the command line # I.e., 'open https://www.pivotaltracker.com/story/show/6283185' def cmd "git pull-request" end def uri "#{origin_uri}/pull/new/#{story_branch}" end private # Returns the raw remote location for the repository. # E.g., http://github.com/mhartl/pivotal-github or # git@github.com:mhartl/pivotal-github def remote_location `git config --get remote.origin.url`.strip.chomp('.git') end # Returns the remote URI for the repository. # Both https://... and git@... remote formats are supported. def origin_uri remote_location.sub(/^git@(.+?):(.+)$/, 'https://\1/\2') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pivotal-github-0.8.0 | lib/pivotal-github/story_pull_request.rb |