Sha256: 2fae48a7e2cd0f1220d3e682b58c20146a26d9173f87f8ca8bc8e07095455bf2

Contents?: true

Size: 531 Bytes

Versions: 4

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

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

4 entries across 4 versions & 2 rubygems

Version Path
aid-0.2.2 examples/pr.rb
abtion-aid-0.3.2 examples/pr.rb
abtion-aid-0.3.1 examples/pr.rb
abtion-aid-0.2.0 examples/pr.rb