Top Level Namespace

Defined Under Namespace

Modules: ActiveRecord, ActsAsFerret, Ferret

Instance Method Summary collapse

Instance Method Details

#determine_rails_rootObject



41
42
43
44
45
46
47
48
49
50
# File 'lib/server_manager.rb', line 41

def determine_rails_root
  possible_rails_roots = [
    $ferret_server_options['root'],
    (defined?(FERRET_SERVER) ? File.join(File.dirname(FERRET_SERVER), '..') : nil),
    File.join(File.dirname(__FILE__), *(['..']*4)),
    '.'
  ].compact
  # take the first dir where environment.rb can be found
  possible_rails_roots.find{ |dir| File.readable?(File.join(dir, 'config', 'environment.rb')) }
end