Class: Jets::Dotenv
- Inherits:
-
Object
- Object
- Jets::Dotenv
- Defined in:
- lib/jets/dotenv.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#dotenv_files ⇒ Object
-
‘.env` - The Original® - `.env.development`, `.env.test`, `.env.production` - Environment-specific settings.
-
-
#initialize(deploy = false) ⇒ Dotenv
constructor
A new instance of Dotenv.
- #load! ⇒ Object
- #root ⇒ Object
Constructor Details
#initialize(deploy = false) ⇒ Dotenv
Returns a new instance of Dotenv.
8 9 10 |
# File 'lib/jets/dotenv.rb', line 8 def initialize(deploy=false) @deploy = deploy end |
Class Method Details
.load!(deploy = false) ⇒ Object
4 5 6 |
# File 'lib/jets/dotenv.rb', line 4 def self.load!(deploy=false) new(deploy).load! end |
Instance Method Details
#dotenv_files ⇒ Object
-
‘.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.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/jets/dotenv.rb', line 23 def dotenv_files files = [ root.join(".env"), (root.join(".env.local") unless Jets.env.test?), root.join(".env.#{Jets.env}"), root.join(".env.#{Jets.env}.local"), ] files << root.join(".env.#{Jets.env}.remote") if @deploy files.compact end |
#load! ⇒ Object
12 13 14 |
# File 'lib/jets/dotenv.rb', line 12 def load! ::Dotenv.load(*dotenv_files) end |