class Ivar::ProjectRoot

def find_project_root(start_dir)

Returns:
  • (String) - The project root directory

Parameters:
  • start_dir (String) -- Directory to start the search from
def find_project_root(start_dir)
  path = Pathname.new(start_dir)
  path.ascend do |dir|
    INDICATORS.each do |indicator|
      return dir.to_s if dir.join(indicator).exist?
    end
  end
  start_dir
end