module Mate::Git
Public Class Methods
excludesfile(workind_dir)
click to toggle source
# File lib/mate/git.rb, line 4 def excludesfile(workind_dir) expand_path IO.popen(%W[git -C #{workind_dir} config --get core.excludesfile], &:read) end
git_dir(workind_dir)
click to toggle source
# File lib/mate/git.rb, line 16 def git_dir(workind_dir) expand_path IO.popen(%W[git -C #{workind_dir} rev-parse --absolute-git-dir], err: '/dev/null', &:read) end
global_tmignore()
click to toggle source
# File lib/mate/git.rb, line 8 def global_tmignore expand_path '~/.tmignore' end
toplevel(workind_dir)
click to toggle source
# File lib/mate/git.rb, line 12 def toplevel(workind_dir) expand_path IO.popen(%W[git -C #{workind_dir} rev-parse --show-toplevel], err: '/dev/null', &:read) end
Private Class Methods
expand_path(path)
click to toggle source
# File lib/mate/git.rb, line 22 def expand_path(path) return unless path path = path.strip return if path == '' Pathname(path).expand_path end