Module: Autowow::Commands::Vcs

Includes:
ReflectionUtils::CreateModuleFunctions
Included in:
Features::Gem, Features::Vcs
Defined in:
lib/autowow/commands/vcs.rb

Instance Method Summary collapse

Instance Method Details

#add(patterns) ⇒ Object



88
89
90
# File 'lib/autowow/commands/vcs.rb', line 88

def add(patterns)
  cmd + ["add"] + patterns
end

#add_remote(name, url) ⇒ Object



84
85
86
# File 'lib/autowow/commands/vcs.rb', line 84

def add_remote(name, url)
  cmd + ["remote", "add", name, url]
end

#branchObject



80
81
82
# File 'lib/autowow/commands/vcs.rb', line 80

def branch
  cmd + terminal_options + ["branch"]
end

#branch_force_delete(branch) ⇒ Object



56
57
58
# File 'lib/autowow/commands/vcs.rb', line 56

def branch_force_delete(branch)
  cmd + ["branch", "-D", branch]
end

#branch_listObject



20
21
22
# File 'lib/autowow/commands/vcs.rb', line 20

def branch_list
  cmd + ["for-each-ref", "--format='%(refname:short)'", "refs/heads/"]
end

#changes_not_on_remote(branch) ⇒ Object



16
17
18
# File 'lib/autowow/commands/vcs.rb', line 16

def changes_not_on_remote(branch)
  cmd + terminal_options + ["log", "--not", "--remotes", branch]
end

#checkout(existing_branch) ⇒ Object



48
49
50
# File 'lib/autowow/commands/vcs.rb', line 48

def checkout(existing_branch)
  cmd + ["checkout", existing_branch]
end

#cmdObject



4
5
6
# File 'lib/autowow/commands/vcs.rb', line 4

def cmd
  ["git"]
end

#commit(msg) ⇒ Object



12
13
14
# File 'lib/autowow/commands/vcs.rb', line 12

def commit (msg)
  cmd + ["commit", "-m", msg]
end

#create(branch) ⇒ Object



60
61
62
# File 'lib/autowow/commands/vcs.rb', line 60

def create(branch)
  cmd + ["checkout", "-b", branch]
end

#current_branchObject



44
45
46
# File 'lib/autowow/commands/vcs.rb', line 44

def current_branch
  cmd + ["symbolic-ref", "--short", "HEAD"]
end

#current_refObject



100
101
102
# File 'lib/autowow/commands/vcs.rb', line 100

def current_ref
  cmd + ["symbolic-ref", "--quiet", "HEAD"]
end

#fetch(remote) ⇒ Object



72
73
74
# File 'lib/autowow/commands/vcs.rb', line 72

def fetch(remote)
  cmd + ["fetch", remote]
end

#git_statusObject



32
33
34
# File 'lib/autowow/commands/vcs.rb', line 32

def git_status
  cmd + ["status"]
end

#hard_reset(branch) ⇒ Object



92
93
94
# File 'lib/autowow/commands/vcs.rb', line 92

def hard_reset(branch)
  cmd + ["reset", "--hard", branch]
end

#merge(compare) ⇒ Object



76
77
78
# File 'lib/autowow/commands/vcs.rb', line 76

def merge(compare)
  cmd + ["merge", compare]
end

#pullObject



52
53
54
# File 'lib/autowow/commands/vcs.rb', line 52

def pull
  cmd + ["pull"]
end

#push(branch = nil, remote = nil) ⇒ Object



24
25
26
# File 'lib/autowow/commands/vcs.rb', line 24

def push(branch = nil, remote = nil)
  cmd + ["push"] + [branch, remote].compact
end

#rebase(branch) ⇒ Object



28
29
30
# File 'lib/autowow/commands/vcs.rb', line 28

def rebase(branch)
  cmd + ["rebase", branch]
end

#remotesObject



68
69
70
# File 'lib/autowow/commands/vcs.rb', line 68

def remotes
  cmd + ["remote", "-v"]
end

#set_upstream(remote, branch) ⇒ Object



64
65
66
# File 'lib/autowow/commands/vcs.rb', line 64

def set_upstream(remote, branch)
  cmd + ["push", "--set-upstream", remote, branch]
end

#show_ref(branch) ⇒ Object



104
105
106
# File 'lib/autowow/commands/vcs.rb', line 104

def show_ref(branch)
  cmd + ["show-ref", branch]
end

#stashObject



36
37
38
# File 'lib/autowow/commands/vcs.rb', line 36

def stash
  cmd + ["stash"]
end

#stash_popObject



40
41
42
# File 'lib/autowow/commands/vcs.rb', line 40

def stash_pop
  cmd + ["stash", "pop"]
end

#terminal_optionsObject



8
9
10
# File 'lib/autowow/commands/vcs.rb', line 8

def terminal_options
  ["--no-pager"]
end

#upstream_tracking(branch) ⇒ Object



96
97
98
# File 'lib/autowow/commands/vcs.rb', line 96

def upstream_tracking(branch)
  cmd + ["for-each-ref", "--format=%'(upstream:short)'", "refs/heads/#{branch}"]
end