
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Load environment variables from .env
files.
Add this line to your application's Gemfile:
gem "envoker"
And then execute:
$ bundle
Or install it yourself as:
$ gem install envoker
Load your .env
file in the application bootstrap
process:
# .env
RACK_ENV=development
# boot.rb
require "envoker"
Envoker.load
ENV["RACK_ENV"]
# => "development"
You can use Envoker#overload
to override
existing values in ENV
:
# .env.test
RACK_ENV=test
# boot.rb
# ...
Envoker.overload(".env.test")
ENV["RACK_ENV"]
# => "test"
Envoker::Rack
adds support for multiple environments:
require "envoker/rack"
Envoker::Rack.load
You should store env vars that are general to
all environments in .env
, and store specific
env vars in .env.<environment>
.The default
environment is development
, but can be changed
through ENV["RACK_ENV"]
.
ENV["RACK_ENV"] = "test"
# This will load `.env` and `.env.test`
Envoker::Rack.load
This is a common pattern I use in my applications:
require "envoker/rack"
Envoker::Rack.load
module Settings
def self.fetch(key)
return ENV.fetch(key) do
raise(sprintf("ENV[%p] not found", key))
end
end
REDIS_URL = fetch("REDIS_URL")
SMTP_URL = fetch("SMTP_URL")
end
Settings::SMTP_URL
# => redis://localhost:6379
Fork the project with:
$ git clone https://github.com/frodsan/envoker.git
To install dependencies, use:
$ bundle install
To run the test suite, do:
$ rake test
For bug reports and pull requests use GitHub.
Envoker is released under the MIT License.
FAQs
Unknown package
We found that envoker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.