module Grails

Constants

VERSION

Public Class Methods

project_root() click to toggle source
# File lib/grails.rb, line 7
def self.project_root
  current_dir = Pathname.new(Dir.pwd)
  current_dir.ascend do |dir|
    gemfile = File.exist?(File.join(dir, 'Gemfile'))
    app_folder = Dir.exist?(File.join(dir, 'app'))
    return dir if gemfile && app_folder
  end
  nil
end