class Poncho::Loader
- Poncho::Loader
- Reference
- Object
Overview
Poncho::Loader
is a .env file loader
Poncho loads the environment file is easy to use. It accepts both single file (or path) and multiple files.
Orders
Poncho loads single file supports the following order with environment name (default is development
):
.env
- The Original®.env.development
- Environment-specific settings..env.local
- Local overrides. This file is loaded for all environments excepttest
..env.development.local
- Local overrides of environment-specific settings.
NO effect with multiple files, it only loads the given files.
Overrides
By default, Poncho won't overwrite existing environment variables as dotenv assumes the deployment environment has more knowledge about configuration than the application does.
Load single file
loader = Poncho::Loader.new env: "development"
loader.load ".env"
Load multiple files
loader = Poncho::Loader.new
loader.load ".env", ".env.local"
Defined in:
poncho/loader.crConstant Summary
-
DEFAULT_ENV_NAME =
"development"
Constructors
Instance Method Summary
-
#load(*paths, overwrite = false)
Load environment variables
-
#load!(*paths)
Load environment variables and overwrite existing ones.