Class: Denv::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/denv/rails.rb

Constant Summary collapse

DEFAULT_ENV_FILES =
%W[.env .env.#{Rails.env} .env.local]

Instance Method Summary collapse

Instance Method Details

#load_envObject



20
21
22
23
24
# File 'lib/denv/rails.rb', line 20

def load_env
  DEFAULT_ENV_FILES.map {|name| root.join(name) }.select(&:exist?).each do |path|
    Denv.load(path)
  end
end

#rootObject



26
27
28
# File 'lib/denv/rails.rb', line 26

def root
  Rails.root || Pathname.new(ENV['RAILS_ROOT'] || Dir.pwd)
end