Sha256: b6a26f274bd7d7b8713f86de3b6c95b7f173566118c2d307d590cbb8b813ae20

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

require_relative './shared/repo_name'

class Pr < Aid::Script
  def self.description
    "Opens up a pull request for your current branch"
  end

  def self.help
    <<~HELP
    Usage: $ aid pr
    HELP
  end

  def run
    url = "https://github.com/#{repo_name}/compare/master...#{current_branch}"

    puts "Opening #{url}"
    system("open #{url}")
  end

  private

  def current_branch
    `git symbolic-ref HEAD 2>/dev/null | cut -d'/' -f3`
  end

  def repo_name
    RepoName.name
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aid-0.1.3 examples/pr.rb