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



74
75
76
# File 'lib/autowow/commands/vcs.rb', line 74

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

#branchObject



70
71
72
# File 'lib/autowow/commands/vcs.rb', line 70

def branch
  ['git', 'branch']
end

#branch_force_delete(branch) ⇒ Object



46
47
48
# File 'lib/autowow/commands/vcs.rb', line 46

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

#branch_listObject



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

def branch_list
  ["git for-each-ref --format='%(refname)' refs/heads/"]
  # TODO: report error with following command
  # ['git', 'for-each-ref', "--format='%(refname)'", 'refs/heads/']
end

#changes_not_on_remote(branch) ⇒ Object



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

def changes_not_on_remote(branch)
  ['git', 'log', branch, '--not', '--remotes']
end

#checkout(existing_branch) ⇒ Object



38
39
40
# File 'lib/autowow/commands/vcs.rb', line 38

def checkout(existing_branch)
  ['git', 'checkout', existing_branch]
end

#create(branch) ⇒ Object



50
51
52
# File 'lib/autowow/commands/vcs.rb', line 50

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

#current_branchObject



34
35
36
# File 'lib/autowow/commands/vcs.rb', line 34

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

#fetch(remote) ⇒ Object



62
63
64
# File 'lib/autowow/commands/vcs.rb', line 62

def fetch(remote)
  ['git', 'fetch', remote]
end

#git_statusObject



22
23
24
# File 'lib/autowow/commands/vcs.rb', line 22

def git_status
  ['git', 'status']
end

#merge(compare) ⇒ Object



66
67
68
# File 'lib/autowow/commands/vcs.rb', line 66

def merge(compare)
  ['git', 'merge', compare]
end

#pullObject



42
43
44
# File 'lib/autowow/commands/vcs.rb', line 42

def pull
  ['git', 'pull']
end

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



14
15
16
# File 'lib/autowow/commands/vcs.rb', line 14

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

#rebase(branch) ⇒ Object



18
19
20
# File 'lib/autowow/commands/vcs.rb', line 18

def rebase(branch)
  ['git', 'rebase', branch]
end

#remotesObject



58
59
60
# File 'lib/autowow/commands/vcs.rb', line 58

def remotes
  ['git', 'remote', '-v']
end

#set_upstream(remote, branch) ⇒ Object



54
55
56
# File 'lib/autowow/commands/vcs.rb', line 54

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

#stashObject



26
27
28
# File 'lib/autowow/commands/vcs.rb', line 26

def stash
  ['git', 'stash']
end

#stash_popObject



30
31
32
# File 'lib/autowow/commands/vcs.rb', line 30

def stash_pop
  ['git', 'stash', 'pop']
end