module Poncho::LoaderHelper

Overview

Poncho load helper

require "poncho/loader"

Defined in:

poncho/loader.cr

Instance Method Summary

Instance Method Detail

def load(*files, env : String | Nil = nil, overwrite = false) #

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"

[View source]
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"

[View source]