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/ENVIRONMENT is production or staging, or when KRYPTIC_DISABLED=true.
  • Finds kryptic.json by walking up from the working directory.
  • Never overwrites ENV entries that are already set.
  • Returns a Result struct with injected, 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,
)