Module: Grails

Defined in:
lib/grails.rb,
lib/version.rb,
lib/commands.rb

Defined Under Namespace

Classes: CLI, DB, Generate

Constant Summary collapse

VERSION =
"0.1.91"

Class Method Summary collapse

Class Method Details

.project_rootObject



7
8
9
10
11
12
13
14
15
# 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