{"id":26474008,"url":"https://github.com/16/envv","last_synced_at":"2026-01-27T16:06:13.717Z","repository":{"id":195769509,"uuid":"685171475","full_name":"16/envv","owner":"16","description":"Ruby environment variables with schema validation and coercion.","archived":false,"fork":false,"pushed_at":"2025-10-16T07:31:47.000Z","size":46,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T07:14:45.080Z","etag":null,"topics":["coercion","dry-rb","env","environment-variables","ruby","ruby-gem","schema-validation"],"latest_commit_sha":null,"homepage":"","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/16.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-08-30T16:58:49.000Z","updated_at":"2025-05-03T08:45:56.000Z","dependencies_parsed_at":"2024-05-28T12:23:02.930Z","dependency_job_id":"7f54fb00-6674-4339-8fb9-6739664bb759","html_url":"https://github.com/16/envv","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"5719bdc351e03eeadf1545d2b5c0f84fa5d89ff7"},"previous_names":["16/envv"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/16/envv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/16%2Fenvv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/16%2Fenvv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/16%2Fenvv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/16%2Fenvv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/16","download_url":"https://codeload.github.com/16/envv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/16%2Fenvv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28816514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["coercion","dry-rb","env","environment-variables","ruby","ruby-gem","schema-validation"],"created_at":"2025-03-19T22:39:46.416Z","updated_at":"2026-01-27T16:06:13.699Z","avatar_url":"https://github.com/16.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/envv.svg)](https://badge.fury.io/rb/envv)\n\n![ENVV banner](doc/banner.svg)\n\n# ENVV\n\nENVV provides a ENV like accessor with schema validation and coerced values. \n\n* By providing an explicit schema of required environments variables, it will facilitate collaborative development and deployment.\n* It will inform you during the boot process of your application if you miss to provide some valid environment variables, avoiding bugs during execution.\n* Schema and coercition are handled by [dry-rb](https://dry-rb.org/) libraries, with the benefits of the powerful DSL of [Dry::Schema](https://dry-rb.org/gems/dry-schema), its built-in [predicates](https://dry-rb.org/gems/dry-schema/1.13/basics/built-in-predicates/) and [types](https://dry-rb.org/gems/dry-schema/1.13/basics/type-specs/).\n\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add envv\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install envv\n\n**Requirements**: this library officially supports the following Ruby versions\n\n* MRI `\u003e= 3.0.0`\n\n\n## Usage\n\nBuild your ENVV with [Dry::Schema.Params](https://dry-rb.org/gems/dry-schema/1.13/params/) rules to describe your env vars requirements.\n\n```ruby\nENVV.build! do\n  required(:MY_STRING_VAR).filled(:string)\n  required(:MY_INT_VAR).filled(:integer, gt?: 3000)\n  required(:MY_BOOLEAN_VAR).filled(:bool)\nend\n```\n\nIf requirements are not satisfied, it will **raise an exception**. So be sure this validation occurs as soon as possible in the boot process of your application.\nIn a Ruby On Rails application, you can place it in an initializer and ensure it will be executed first by naming it `config/initializers/01-envv.rb` for example, since initializers are run in alphabetical order.\n\nIf environment variables are validated, you can now access their coerced value with `ENVV#fetch` method:\n\n```ruby\n# With ENV\n#\n# MY_STRING_VAR=hello\n# MY_INT_VAR=4000\n# MY_BOOLEAN_VAR=True\n\nENVV.fetch(\"MY_STRING_VAR\") # ⇒ \"Hello\"\nENVV.fetch(\"MY_INT_VAR\") # ⇒ 4000\nENVV.fetch(\"MY_BOOLEAN_VAR\") # ⇒ true\n```\n\n### Adding extra features with your own ENVV wrapper\n\nYou can include [ENVV::Base](lib/envv/base.rb) in your own class or module and thus provide extra features.\n\nWith a module\n\n```ruby\nmodule MyAppEnv\n  extend ENVV::Base\n\n  def is_dark?\n    fetch(\"IS_DARK\")\n  end\nend\n\nMyAppEnv.build! do\n  required(:IS_DARK).filled(:bool)\nend\n\n# IS_DARK=True\n\nMyAppEnv.is_dark? # =\u003e true\n```\n\nWith a class\n\n```ruby\nclass MyAppEnv\n  include ENVV::Base\n\n  def [](key)\n    fetch(key)\n  end\nend\n\ne = MyAppEnv.new.build! do\n  required(:IS_DARK).filled(:bool)\nend\ne[\"IS_DARK\"] # =\u003e true\n```\n\nBe creative !\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/16/envv. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/16/envv/blob/master/CODE_OF_CONDUCT.md).\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). See the separate [LICENSE.txt](LICENSE.txt) file. © Copyright 2023 Fabrice Luraine aka asciilander with spacedotspace collective.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F16%2Fenvv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F16%2Fenvv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F16%2Fenvv/lists"}