Class: CiHelper::Utils
- Inherits:
-
Object
- Object
- CiHelper::Utils
- Defined in:
- lib/ci_helper/utils.rb
Class Method Summary collapse
Class Method Details
.repo_root ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ci_helper/utils.rb', line 3 def self.repo_root @repo_root ||= begin # TODO : understand the code here git_dir = Pathname.new(File.('.')).enum_for(:ascend).find do |path| File.exist?(File.join(path, '.git')) end unless git_dir raise CiHelper::Exceptions::InvalidGitRepo, 'no .git directory found' end git_dir.to_s end end |