
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Fast access to environment variables. Takes advantage of method_missing to easily return values of environment variable.
Why? Because TYPING_IN_ALL_CAPS isn't fun or readable.
Add this line to your application's Gemfile:
gem 'fastenv'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fastenv
Say you have an environment variable
WORDPRESS_USERNAME="La-de-da-de-da"
You can access it from your Ruby code as simply as
require 'fastenv'
Fastenv.wordpress_username
If the environment variable doesn't exist, a NameError
will be raise.
Fastenv is intended for querying credentials. Missing credentials is an exceptional event.
It can be helpful to specify default values though. You can give Fastenv a block, and, if the environment variable is not set, the block will be evaluated and its value returned.
require 'fastenv'
your_special_value = Fastenv.env_does_not_exist { 'but this is a default' }
=> "but this is a default"
Pair it with dotenv to easily set and retrieve your credentials from environment variables.
# .env
WORDPRESS_USERNAME="TweedleDee"
WORDPRESS_PASSWORD="password"
# your_app.rb
require 'dotenv'
Dotenv.load
require 'fastenv'
credentials = {
username: Fastenv.wordpress_username,
password: Fastenv.wordpress_password }
# => {:username=>"TweedleDee", :password=>"password"}
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that fastenv 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
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.