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_remote(name, url) ⇒ Object



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

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

#branchObject



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

def branch
  cmd + ['branch']
end

#branch_force_delete(branch) ⇒ Object



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

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

#branch_listObject



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

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

#changes_not_on_remote(branch) ⇒ Object



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

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

#checkout(existing_branch) ⇒ Object



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

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

#create(branch) ⇒ Object



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

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

#current_branchObject



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

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

#fetch(remote) ⇒ Object



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

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

#git_statusObject



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

def git_status
  cmd + ['status']
end

#merge(compare) ⇒ Object



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

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

#pullObject



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

def pull
  cmd + ['pull']
end

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



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

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

#rebase(branch) ⇒ Object



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

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

#remotesObject



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

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

#set_upstream(remote, branch) ⇒ Object



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

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

#stashObject



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

def stash
  cmd + ['stash']
end

#stash_popObject



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

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