Module: LokaliseRails::Utils

Defined in:
lib/lokalise_rails/utils.rb

Class Method Summary collapse

Class Method Details

.rails_rootObject



12
13
14
15
16
17
# File 'lib/lokalise_rails/utils.rb', line 12

def rails_root
  return ::Rails.root.to_s if defined?(::Rails.root) && ::Rails.root
  return RAILS_ROOT.to_s if defined?(RAILS_ROOT)

  nil
end

.rootObject



8
9
10
# File 'lib/lokalise_rails/utils.rb', line 8

def root
  Pathname.new(rails_root || Dir.getwd)
end