class PullRequestOptions

Public Instance Methods

description() click to toggle source
# File bin/git-pull-req, line 16
  def description
    <<DESC
DESCRIPTION


DESC
  end
extend_opts(parser) click to toggle source
# File bin/git-pull-req, line 30
def extend_opts(parser)
  parser.opt :base_branch, "The branch on the server that you want this \"pulled\" into. "+
      "Defaults to the integration branch.", :type => :string
  parser.opt :head_branch, "The branch that you want reviewed before being \"pulled\" "+
      "into the base branch. Defaults to the current branch.", :type => :string
  parser.opt :repo_name, "The name of the repository to \"pull\" into. Defaults to "+
      "the current repository.", :type => :string
  parser.opt :description, "The description of the Pull Request. Usually includes a "+
      "nice description of what was changed to make things easier "+
      "for the reviewer.", :short => :d, :type => :string
  parser.opt :user, "Your GitHub username. Only needed the first time you connect, "+
      "and you will be prompted for it if needed.", :type => :string
  parser.opt :password, "Your GitHub password. Only needed the first time you connect, "+
      "and you will be prompted for it if needed.", :type => :string
end
post_parse(opts, argv) click to toggle source
# File bin/git-pull-req, line 47
def post_parse(opts, argv)
  arg = argv.shift
  if /^\d+$/ =~ arg
    opts[:prNumber] = arg
  elsif /^(.*)\/(\d+)$/ =~ arg
    m = /^(.*)\/(\d+)$/.match(arg)
    opts[:server] = m[1]
    opts[:prNumber] = m[2]
  else
    opts[:title] = arg
  end
end
usage(filename) click to toggle source
# File bin/git-pull-req, line 25
def usage(filename)
  "Usage: #{filename} [ options ] [pull_request_title | server/pull_request_number | pull_request_number]"
end