{"id":13877941,"url":"https://github.com/gocardless/prius","last_synced_at":"2025-08-21T14:10:28.425Z","repository":{"id":26664650,"uuid":"30121111","full_name":"gocardless/prius","owner":"gocardless","description":"Environmentally-friendly application config","archived":false,"fork":false,"pushed_at":"2024-07-12T15:28:56.000Z","size":79,"stargazers_count":24,"open_issues_count":1,"forks_count":3,"subscribers_count":94,"default_branch":"master","last_synced_at":"2025-07-28T08:59:11.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gocardless.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-31T18:10:19.000Z","updated_at":"2024-07-12T12:04:58.000Z","dependencies_parsed_at":"2024-01-09T16:43:46.638Z","dependency_job_id":"fd76f74f-93d9-427e-a942-e0356ba62c16","html_url":"https://github.com/gocardless/prius","commit_stats":{"total_commits":56,"total_committers":11,"mean_commits":5.090909090909091,"dds":0.7678571428571428,"last_synced_commit":"35902055274facea3f2bcc130e0310edda5c1f8a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/gocardless/prius","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fprius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fprius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fprius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fprius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gocardless","download_url":"https://codeload.github.com/gocardless/prius/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocardless%2Fprius/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271493232,"owners_count":24769117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:01:35.489Z","updated_at":"2025-08-21T14:10:28.367Z","avatar_url":"https://github.com/gocardless.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Prius\nEnvironmentally-friendly application config for Ruby.\n\n[![Gem Version](https://badge.fury.io/rb/prius.svg)](http://badge.fury.io/rb/prius)\n[![Build Status](https://circleci.com/gh/gocardless/prius.svg?style=svg)](https://app.circleci.com/pipelines/github/gocardless/prius)\n\nPrius helps you guarantee that your environment variables are:\n\n- **Present** - an exception is raised if an environment variable is missing,\n  so you can hear about it as soon as your app boots.\n- **Valid** - an environment variable can be coerced to a desired type\n  (integer, boolean, string, or date), and an exception will be raised if the value\n  doesn't match the type.\n\n## Usage\n\n#### Installing\n\n```\n$ gem install prius\n```\n\n#### Quick Start\n\n```ruby\n# Load a required environment variable into the Prius registry:\nPrius.load(:github_token)\n\n# Use the environment variable:\nPrius.get(:github_token)\n\n# Load an optional environment variable:\nPrius.load(:might_be_here_or_not, required: false)\n\n# Load and alias an environment variable:\nPrius.load(:alias_name, env_var: \"HORRENDOUS_SYSTEM_VAR_NAME\")\n\n# Load and coerce an environment variable (or raise):\nPrius.load(:my_flag, type: :bool)\n```\n\nYou probably want to `load` all your environment variables as your app starts,\nso you catch config issues at boot time.\n\n#### Loading Environment Variables\n\nEnvironment variables need to be loaded into the Prius registry before being\nused. Typically this is done in an initialiser.\n\n```ruby\nPrius.load(name, **options)\n```\n\nIf an environment variable can't be loaded, Prius will raise one of:\n- `MissingValueError` if the environment variable was expected to be set but couldn't be found.\n- `TypeMismatchError` if the environment variable wasn't of the expected type (see below).\n\n`Prius.load` accepts the following options:\n\n| Param             | Default       | Description                                                                               |\n|-------------------|---------------|-------------------------------------------------------------------------------------------|\n| `required`        | `true`        | Flag to require the environment variable to have been set.                                |\n| `type`            | `:string`     | Type to coerce the environment variable to. Allowed values are `:string`, `:int`, `:bool`, and `:date`. |\n| `env_var`         | `name.upcase` | Name of the environment variable name (if different from the upcased `name`).             |\n\n#### Reading Environment Variables\n\nOnce a variable has been loaded into the registry it can be read using:\n\n```ruby\nPrius.get(name)\n```\n\nIf the environment variable hasn't been loaded, Prius will raise an `UndeclaredNameError`.\n\n#### Test and development environments\n\nTo make running your app in test and development environments easier we\nrecommend using [Dotenv](https://github.com/bkeepers/dotenv) to automatically\nload a file of dummy config values.\n\n---\n\nGoCardless ♥ open source. If you do too, come [join us](https://gocardless.com/about/jobs/software-engineer).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocardless%2Fprius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgocardless%2Fprius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocardless%2Fprius/lists"}