Class: Forger::Dotenv

Inherits:
Object
  • Object
show all
Defined in:
lib/forger/dotenv.rb

Class Method Summary collapse

Class Method Details

.dotenv_filesObject

  • .env - The Original®
  • .env.development, .env.test, .env.production - Environment-specific settings.
  • .env.local - Local overrides. This file is loaded for all environments except test.
  • .env.development.local, .env.test.local, .env.production.local - Local overrides of environment-specific settings.


17
18
19
20
21
22
23
24
# File 'lib/forger/dotenv.rb', line 17

def dotenv_files
  [
    root.join(".env.#{Forger.env}.local"),
    (root.join(".env.local") unless Forger.env == "test"),
    root.join(".env.#{Forger.env}"),
    root.join(".env")
  ].compact
end

.load!Object



6
7
8
# File 'lib/forger/dotenv.rb', line 6

def load!
  ::Dotenv.load(*dotenv_files)
end

.rootObject



26
27
28
# File 'lib/forger/dotenv.rb', line 26

def root
  Forger.root || Pathname.new(ENV["FORGER_ROOT"] || Dir.pwd)
end