module Poncho::LoaderHelper
Overview
Poncho load helper
require "poncho/loader"
Defined in:
poncho/loader.crInstance Method Summary
-
#load(*files, env : String | Nil = nil, overwrite = false)
Load environment variables
-
#load!(*files, env : String | Nil = nil)
Load environment variables and overwrite existing ones.
Instance Method Detail
Load environment variables
# Searching order: .env.development, .env.local, .env.development.local
Poncho.load ".env"
# Load from path
Poncho.load "config/"
# Load multiple files, ignore enviroment name.
Poncho.load ".env", ".env.local", env: "test"
def load!(*files, env : String | Nil = nil)
#
Load environment variables and overwrite existing ones.
Same as #load
(*files, overwrite: true)
# Searching order: .env.development, .env.local, .env.development.local
Poncho.load! ".env"
# Load from path
Poncho.load! "config/"
# Load multiple files, ignore enviroment name.
Poncho.load! ".env", ".env.local", env: "test"