[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7820":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":18,"lastSyncTime":28,"discoverSource":29},7820,"figaro","laserlemon\u002Ffigaro","laserlemon","Simple Rails app configuration","",null,"Ruby",3749,280,40,39,0,1,2,3,29.35,"MIT License",false,"main",[],"2026-06-12 02:01:45","> [!IMPORTANT]\n> Figaro [v2](https:\u002F\u002Fgithub.com\u002Flaserlemon\u002Ffigaro\u002Ftree\u002Fv2) development is underway but _stalled_. I need your help! Please consider [sponsoring Figaro's development](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Flaserlemon).\n>\n> With the constraints of a family and a full-time job, even the _emotional_ support that sponsorship provides is extremely valuable in re-energizing Figaro development. Thank you! 💛\n\n\u003Ch1>\n  \u003Cpicture>\n    \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F5fc9ba97-8288-4228-ba4d-03b2bdcdf0f4\">\n    \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F1cd8ae2e-afd4-4930-bdc9-147b787ea3fe\">\n    \u003Cimg alt=\"Figaro\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F5fc9ba97-8288-4228-ba4d-03b2bdcdf0f4\" style=\"height:2em\">\n  \u003C\u002Fpicture>\n\u003C\u002Fh1>\n\nSimple, Heroku-friendly Rails app configuration using `ENV` and a single YAML file\n\n[![Made by laserlemon](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flaser-lemon-fc0?style=flat-square)](https:\u002F\u002Fgithub.com\u002Flaserlemon)\n[![Gem version](https:\u002F\u002Fimg.shields.io\u002Fgem\u002Fv\u002Ffigaro?style=flat-square)](https:\u002F\u002Frubygems.org\u002Fgems\u002Ffigaro)\n[![Build status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Flaserlemon\u002Ffigaro\u002Ftest.yml?style=flat-square)](https:\u002F\u002Fgithub.com\u002Flaserlemon\u002Ffigaro\u002Factions\u002Fworkflows\u002Ftest.yml)\n\n**NOTE:** If you're using Figaro 0.7 or prior, please refer to the\n[appropriate documentation](https:\u002F\u002Fgithub.com\u002Flaserlemon\u002Ffigaro\u002Ftree\u002F0-stable#readme)\nor [upgrade](#how-do-i-upgrade-to-figaro-10) to Figaro 1.0.\n\n## Why does Figaro exist?\n\nFigaro was written to make it easy to securely configure Rails applications.\n\nConfiguration values often include sensitive information. Figaro strives to be\nsecure by default by encouraging a convention that keeps configuration out of\nGit.\n\n## How does Figaro work?\n\nFigaro is inspired by the [Twelve-Factor App](http:\u002F\u002F12factor.net) methodology,\nwhich states:\n\n> The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard.\n\nThis is straightforward in production environments but local development\nenvironments are often shared between multiple applications, requiring multiple\nconfigurations.\n\nFigaro parses a Git-ignored YAML file in your application and loads its values\ninto `ENV`.\n\n### Getting Started\n\nAdd Figaro to your Gemfile and `bundle install`:\n\n```ruby\ngem \"figaro\"\n```\n\nFigaro installation is easy:\n\n\n```bash\n$ bundle exec figaro install\n```\n\nThis creates a commented `config\u002Fapplication.yml` file and adds it to your\n`.gitignore`. Add your own configuration to this file and you're done!\n\n### Example\n\nGiven the following configuration file:\n\n```yaml\n# config\u002Fapplication.yml\n\npusher_app_id: \"2954\"\npusher_key: \"7381a978f7dd7f9a1117\"\npusher_secret: \"abdc3b896a0ffb85d373\"\n```\n\nYou can configure [Pusher](http:\u002F\u002Fpusher.com) in an initializer:\n\n```ruby\n# config\u002Finitializers\u002Fpusher.rb\n\nPusher.app_id = ENV[\"pusher_app_id\"]\nPusher.key    = ENV[\"pusher_key\"]\nPusher.secret = ENV[\"pusher_secret\"]\n```\n\n**Please note:** `ENV` is a simple key\u002Fvalue store. All values will be converted\nto strings. Deeply nested configuration structures are not possible.\n\n### Environment-Specific Configuration\n\nOftentimes, local configuration values change depending on Rails environment. In\nsuch cases, you can add environment-specific values to your configuration file:\n\n```yaml\n# config\u002Fapplication.yml\n\npusher_app_id: \"2954\"\npusher_key: \"7381a978f7dd7f9a1117\"\npusher_secret: \"abdc3b896a0ffb85d373\"\n\ntest:\n  pusher_app_id: \"5112\"\n  pusher_key: \"ad69caf9a44dcac1fb28\"\n  pusher_secret: \"83ca7aa160fedaf3b350\"\n```\n\nYou can also nullify configuration values for a specific environment:\n\n```yaml\n# config\u002Fapplication.yml\n\ngoogle_analytics_key: \"UA-35722661-5\"\n\ntest:\n  google_analytics_key: ~\n```\n\n### Using `Figaro.env`\n\n`Figaro.env` is a convenience that acts as a proxy to `ENV`.\n\nIn testing, it is sometimes more convenient to stub and unstub `Figaro.env` than\nto set and reset `ENV`. Whether your application uses `ENV` or `Figaro.env` is\nentirely a matter of personal preference.\n\n```yaml\n# config\u002Fapplication.yml\n\nstripe_api_key: \"sk_live_dSqzdUq80sw9GWmuoI0qJ9rL\"\n```\n\n```ruby\nENV[\"stripe_api_key\"] # => \"sk_live_dSqzdUq80sw9GWmuoI0qJ9rL\"\nENV.key?(\"stripe_api_key\") # => true\nENV[\"google_analytics_key\"] # => nil\nENV.key?(\"google_analytics_key\") # => false\n\nFigaro.env.stripe_api_key # => \"sk_live_dSqzdUq80sw9GWmuoI0qJ9rL\"\nFigaro.env.stripe_api_key? # => true\nFigaro.env.google_analytics_key # => nil\nFigaro.env.google_analytics_key? # => false\n```\n\n### Required Keys\n\nIf a particular configuration value is required but not set, it's appropriate to\nraise an error. With Figaro, you can either raise these errors proactively or\nlazily.\n\nTo proactively require configuration keys:\n\n```ruby\n# config\u002Finitializers\u002Ffigaro.rb\n\nFigaro.require_keys(\"pusher_app_id\", \"pusher_key\", \"pusher_secret\")\n```\n\nIf any of the configuration keys above are not set, your application will raise\nan error during initialization. This method is preferred because it prevents\nruntime errors in a production application due to improper configuration.\n\nTo require configuration keys lazily, reference the variables via \"bang\" methods\non `Figaro.env`:\n\n```ruby\n# config\u002Finitializers\u002Fpusher.rb\n\nPusher.app_id = Figaro.env.pusher_app_id!\nPusher.key    = Figaro.env.pusher_key!\nPusher.secret = Figaro.env.pusher_secret!\n```\n\n### Deployment\n\nFigaro is written with deployment in mind. In fact, [Heroku](https:\u002F\u002Fwww.heroku.com)'s\nuse of `ENV` for application configuration was the original inspiration for\nFigaro.\n\n#### Heroku\n\nHeroku already makes setting application configuration easy:\n\n```bash\n$ heroku config:set google_analytics_key=UA-35722661-5\n```\n\nUsing the `figaro` command, you can set values from your configuration file all\nat once:\n\n```bash\n$ figaro heroku:set -e production\n```\n\nFor more information:\n\n```bash\n$ figaro help heroku:set\n```\n\n#### Other Hosts\n\nIf you're not deploying to Heroku, you have two options:\n\n* Generate a remote configuration file\n* Set `ENV` variables directly\n\nGenerating a remote configuration file is preferred because of:\n\n* familiarity – Management of `config\u002Fapplication.yml` is like that of `config\u002Fdatabase.yml`.\n* isolation – Multiple applications on the same server will not produce configuration key collisions.\n\n## Is Figaro like [dotenv](https:\u002F\u002Fgithub.com\u002Fbkeepers\u002Fdotenv)?\n\nYes. Kind of.\n\nFigaro and dotenv were written around the same time to solve similar problems.\n\n### Similarities\n\n* Both libraries are useful for Ruby application configuration.\n* Both are popular and well maintained.\n* Both are inspired by Twelve-Factor App's concept of proper [configuration](http:\u002F\u002F12factor.net\u002Fconfig).\n* Both store configuration values in `ENV`.\n\n### Differences\n\n* Configuration File\n  * Figaro expects a single file.\n  * Dotenv supports separate files for each environment.\n* Configuration File Format\n  * Figaro expects YAML containing key\u002Fvalue pairs.\n  * Dotenv convention is a collection of `KEY=VALUE` pairs.\n* Security vs. Convenience\n  * Figaro convention is to never commit configuration files.\n  * Dotenv encourages committing configuration files containing development values.\n* Framework Focus\n  * Figaro was written with a focus on Rails development and conventions.\n  * Dotenv was written to accommodate any type of Ruby application.\n\nEither library may suit your configuration needs. It often boils down to\npersonal preference.\n\n## Is application.yml like [secrets.yml](https:\u002F\u002Fgithub.com\u002Frails\u002Frails\u002Fblob\u002Fv4.1.0\u002Frailties\u002Flib\u002Frails\u002Fgenerators\u002Frails\u002Fapp\u002Ftemplates\u002Fconfig\u002Fsecrets.yml)?\n\nYes. Kind of.\n\nRails 4.1 introduced the `secrets.yml` convention for Rails application\nconfiguration. Figaro predated the Rails 4.1 release by two years.\n\n### Similarities\n\n* Both are useful for Rails application configuration.\n* Both are popular and well maintained.\n* Both expect a single YAML file.\n\n### Differences\n\n* Configuration Access\n  * Figaro stores configuration values in `ENV`.\n  * Rails stores configuration values in `Rails.application.secrets`.\n* Configuration File Structure\n  * Figaro expects YAML containing key\u002Fvalue string pairs.\n  * Secrets may contain nested structures with rich objects.\n* Security vs. Convenience\n  * Figaro convention is to never commit configuration files.\n  * Secrets are committed by default.\n* Consistency\n  * Figaro uses `ENV` for configuration in every environment.\n  * Secrets encourage using `ENV` for production only.\n* Approach\n  * Figaro is inspired by Twelve-Factor App's concept of proper [configuration](http:\u002F\u002F12factor.net\u002Fconfig).\n  * Secrets are… not.\n\nThe emergence of a configuration convention for Rails is an important step, but\nas long as the last three differences above exist, Figaro will continue to be\ndeveloped as a more secure, more consistent, and more standards-compliant\nalternative to `secrets.yml`.\n\nFor more information, read the original [The Marriage of Figaro… and Rails](http:\u002F\u002Fwww.collectiveidea.com\u002Fblog\u002Farchives\u002F2013\u002F12\u002F18\u002Fthe-marriage-of-figaro-and-rails\u002F) blog post.\n\n## How do I upgrade to Figaro 1.0?\n\nIn most cases, upgrading from Figaro 0.7 to 1.0 is painless. The format\nexpectations for `application.yml` are the same in 1.0 and values from\n`application.yml` are loaded into `ENV` as they were in 0.7.\n\nHowever, there are breaking changes:\n\n### `Figaro.env`\n\nIn Figaro 0.7, calling a method on the `Figaro.env` proxy would raise an error\nif a corresponding key were not set in `ENV`.\n\nIn Figaro 1.0, calling a method on `Figaro.env` corresponding to an unset key\nwill return `nil`. To emulate the behavior of Figaro 0.7, use \"bang\" methods as\ndescribed in the [Required Keys](#required-keys) section.\n\n**NOTE:** In Figaro 0.7, `Figaro.env` inherited from `Hash` but in Figaro 1.0,\nhash access has been removed.\n\n### Heroku Configuration\n\nIn Figaro 0.7, a Rake task existed to set remote Heroku configuration according\nto values in `application.yml`.\n\nIn Figaro 1.0, the Rake task was replaced by a command for the `figaro`\nexecutable:\n\n```bash\n$ figaro heroku:set -e production\n```\n\nFor more information:\n\n```bash\n$ figaro help heroku:set\n```\n\n**NOTE:** The environment option is required for the `heroku:set` command. The\nRake task in Figaro 0.7 used the default of \"development\" if unspecified.\n\n### Spring Configuration\n\nIf you're using Spring, either [stop](http:\u002F\u002Fcollectiveidea.com\u002Fblog\u002Farchives\u002F2015\u002F02\u002F04\u002Fspring-is-dead-to-me)\nor add `config\u002Fapplication.yml` to the watch list:\n\n```rb\n# config\u002Fspring.rb\n\n%w(\n  ...\n  config\u002Fapplication.yml\n).each { |path| Spring.watch(path) }\n```\n\n## Who wrote Figaro?\n\nMy name is Steve Richert and I wrote Figaro in March, 2012 with overwhelming\nencouragement from my employer, [Collective Idea](http:\u002F\u002Fwww.collectiveidea.com).\nFigaro has improved very much since then, thanks entirely to [inspiration](https:\u002F\u002Fgithub.com\u002Flaserlemon\u002Ffigaro\u002Fissues)\nand [contribution](https:\u002F\u002Fgithub.com\u002Flaserlemon\u002Ffigaro\u002Fgraphs\u002Fcontributors)\nfrom developers everywhere.\n\n**Thank you!**\n\n## How can I help?\n\nFigaro is open source and contributions from the community are encouraged! No\ncontribution is too small.\n\nSee Figaro's [contribution guidelines](CONTRIBUTING.md) for more information.\n","Figaro 是一个用于简化 Rails 应用程序配置的工具。它通过使用环境变量（`ENV`）和单个 YAML 文件来实现配置管理，确保敏感信息不会被意外提交到版本控制系统中，从而提高了安全性。遵循十二要素应用方法论，Figaro 使得在不同部署环境中切换配置变得简单而安全。特别适合于需要频繁更改配置且希望保持代码库清洁的开发团队使用，尤其是那些正在Heroku上部署项目的团队。此外，Figaro 的安装过程非常简便，只需几行命令即可完成设置。","2026-06-11 03:14:34","top_language"]