Module: Ignorance::ProjectOrientedVCS

Included in:
GitIgnoreFile, HgIgnoreFile
Defined in:
lib/ignorance/project_oriented_vcs.rb

Instance Method Summary collapse

Instance Method Details

#its_a_repo?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
# File 'lib/ignorance/project_oriented_vcs.rb', line 4

def its_a_repo?
  path = Dir.getwd.scan(/\/[^\/]+/).map{|p| p[1..-1]}
  repo_found = false
  until (repo_found = Dir.exists?(File.join("/", path, @repo_dir))) || path.empty?
    path.pop
  end
  repo_found
end