Sha256: 5a2742da33947d303147241d0efeb4fd9ef1547fdad7f9e43758c6832b879e29

Contents?: true

Size: 1.38 KB

Versions: 2

Compression:

Stored size: 1.38 KB

Contents

class Gitmine::CLI
  def self.run
    case ARGV[0]
    when "log"
      list
    when "branch", "br"
      branch
    when "checkout", "co"
      checkout
    when "delete", "del"
      delete
    when "for_deploy", "reviewed"
      reviewed
    when "open"
      open
    when "status"
      status
    else
      puts <<-EOS
Usage:
gitmine branch BRANCH_NAME
  Create a new branch, push to origin, add github links to gitmine ticket
  Example: gitmine branch 1234-my-branch

gitmine checkout ISSUE_ID
  Checkout remote/local branch starting with ISSUE_ID
  Example: gitmine checkout 1234

gitmine reviewed ISSUE_ID
  Merge the branch to master, delete remote branch, update redmine issue status
  Example: gitmine reviewed 1234

gitmine delete ISSUE_ID
  Delete remote branch starting with ISSUE_ID
  Example: gitmine delete 1234

gitmine status
  Show status of the current branch's issue

gitmine open
  Open current branch's issue in web browser

gitmine log
  Displays latest 10 commits and the status of their associated Redmine tickets
EOS
    end
  end

  def self.list
    Gitmine.list
  end

  def self.branch
    Gitmine.branch(ARGV[1])
  end

  def self.checkout
    Gitmine.checkout(ARGV[1])
  end

  def self.delete
    Gitmine.delete(ARGV[1])
  end

  def self.reviewed
    Gitmine.reviewed(ARGV[1])
  end

  def self.open
    Gitmine.open
  end

  def self.status
    Gitmine.status
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gitmine-0.2.1 lib/gitmine/cli.rb
gitmine-0.2.0 lib/gitmine/cli.rb