Ruby
Updated
The krypticdev gem injects your project's secrets into ENV during development
startup. Outside development it is a no-op, and it never raises.
Install
# Gemfile
gem "krypticdev", group: :development
Use
# config/application.rb (Rails) or the top of your entry point
Kryptic.inject! if Rails.env.development?
ENV["DATABASE_URL"]
Behavior
- No-op when
RAILS_ENV/RACK_ENV/APP_ENV/ENVIRONMENTis production or staging, or whenKRYPTIC_DISABLED=true. - Finds
kryptic.jsonby walking up from the working directory. - Never overwrites ENV entries that are already set.
- Returns a
Resultstruct withinjected,skipped,reason. - macOS/Linux via unix socket, Windows via named pipe.
Options
Kryptic.inject!(
environment: "staging", # default: kryptic.json defaultEnvironment
project_id: "proj_x", # default: kryptic.json projectId
timeout_ms: 2000,
)
Environment variables override everything: KRYPTIC_PROJECT_ID, KRYPTIC_ENV,
KRYPTIC_SOCKET_PATH, KRYPTIC_TIMEOUT_MS, KRYPTIC_DISABLED, KRYPTIC_SILENT.