Module: Kscript::Config
- Defined in:
- lib/kscript/config.rb
Constant Summary collapse
- CONFIG_PATH =
File.('~/.kscript/.env')
Class Method Summary collapse
-
.get(key, default = nil) ⇒ Object
Get config value from ENV, with optional default.
-
.load! ⇒ Object
Load ~/.kscript/.env using dotenv.
Class Method Details
.get(key, default = nil) ⇒ Object
Get config value from ENV, with optional default
25 26 27 |
# File 'lib/kscript/config.rb', line 25 def self.get(key, default = nil) ENV[key] || default end |
.load! ⇒ Object
Load ~/.kscript/.env using dotenv
15 16 17 18 19 20 |
# File 'lib/kscript/config.rb', line 15 def self.load! return if @loaded Dotenv.load(CONFIG_PATH) @loaded = true end |