Module: AlfonsoX::Utils
- Defined in:
- lib/alfonsox/utils.rb
Overview
Utils for Alfonso X
Class Method Summary collapse
-
.repo_root ⇒ String
Returns an absolute path to the root of the repository.
Class Method Details
.repo_root ⇒ String
Returns an absolute path to the root of the repository.
Stolen from Overcommit::Utils#repo_root
We do this ourselves rather than call ‘git rev-parse –show-toplevel` to solve an issue where the .git directory might not actually be valid in tests.
20 21 22 23 24 |
# File 'lib/alfonsox/utils.rb', line 20 def repo_root result = `git rev-parse --show-toplevel` raise 'Not in git repository' unless $CHILD_STATUS.success? result.chomp("\n") end |