Module: Kamal::Git

Extended by:
Git
Included in:
Git
Defined in:
lib/kamal/git.rb

Instance Method Summary collapse

Instance Method Details

#emailObject



12
13
14
# File 'lib/kamal/git.rb', line 12

def email
  `git config user.email`.strip
end

#revisionObject



16
17
18
# File 'lib/kamal/git.rb', line 16

def revision
  `git rev-parse HEAD`.strip
end

#rootObject



24
25
26
# File 'lib/kamal/git.rb', line 24

def root
  `git rev-parse --show-toplevel`.strip
end

#uncommitted_changesObject



20
21
22
# File 'lib/kamal/git.rb', line 20

def uncommitted_changes
  `git status --porcelain`.strip
end

#uncommitted_filesObject

returns an array of relative path names of files with uncommitted changes



29
30
31
# File 'lib/kamal/git.rb', line 29

def uncommitted_files
  `git ls-files --modified`.lines.map(&:strip)
end

#untracked_filesObject

returns an array of relative path names of untracked files, including gitignored files



34
35
36
# File 'lib/kamal/git.rb', line 34

def untracked_files
  `git ls-files --others`.lines.map(&:strip)
end

#used?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/kamal/git.rb', line 4

def used?
  system("git rev-parse")
end

#user_nameObject



8
9
10
# File 'lib/kamal/git.rb', line 8

def user_name
  `git config user.name`.strip
end