Module: EacGit::Executables::GitCommandExtensions

Defined in:
lib/eac_git/executables.rb

Instance Method Summary collapse

Instance Method Details

#command(*args) ⇒ Object



27
28
29
# File 'lib/eac_git/executables.rb', line 27

def command(*args)
  super.envvar('PATH', path_with_git_subrepo)
end

#gem_rootObject



31
32
33
# File 'lib/eac_git/executables.rb', line 31

def gem_root
  '../..'.to_pathname.expand_path(__dir__)
end

#git_subrepo_rootObject



35
36
37
# File 'lib/eac_git/executables.rb', line 35

def git_subrepo_root
  gem_root.join('vendor', 'git-subrepo')
end

#path_with_git_subrepoObject



39
40
41
42
43
# File 'lib/eac_git/executables.rb', line 39

def path_with_git_subrepo
  ([git_subrepo_root.join('lib').to_path] +
      ENV['PATH'].if_present('').split(::File::PATH_SEPARATOR))
    .join(::File::PATH_SEPARATOR)
end