Class: Gitmine::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/gitmine/cli.rb

Class Method Summary collapse

Class Method Details

.branchObject



53
54
55
# File 'lib/gitmine/cli.rb', line 53

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

.checkoutObject



57
58
59
# File 'lib/gitmine/cli.rb', line 57

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

.deleteObject



61
62
63
# File 'lib/gitmine/cli.rb', line 61

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

.listObject



49
50
51
# File 'lib/gitmine/cli.rb', line 49

def self.list
  Gitmine.list
end

.openObject



69
70
71
# File 'lib/gitmine/cli.rb', line 69

def self.open
  Gitmine.open
end

.reviewedObject



65
66
67
# File 'lib/gitmine/cli.rb', line 65

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

.runObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/gitmine/cli.rb', line 2

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

.statusObject



73
74
75
# File 'lib/gitmine/cli.rb', line 73

def self.status
  Gitmine.status
end