Class: AwsEc2::Dotenv

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_ec2/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/aws_ec2/dotenv.rb', line 17

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

.load!Object



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

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

.rootObject



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

def root
  AwsEc2.root || Pathname.new(ENV["AWS_EC2_ROOT"] || Dir.pwd)
end