{"id":15685182,"url":"https://github.com/yujideveloper/settings_cabinet","last_synced_at":"2025-09-12T12:34:25.209Z","repository":{"id":36960276,"uuid":"484768019","full_name":"yujideveloper/settings_cabinet","owner":"yujideveloper","description":"A simple settings solution with ERB-enabled YAML file","archived":false,"fork":false,"pushed_at":"2024-07-23T02:38:18.000Z","size":25,"stargazers_count":15,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T10:54:07.876Z","etag":null,"topics":["configuration","configuration-management","gem","rails","ruby","ruby-gem","ruby-on-rails","settings-management","sinatra"],"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/yujideveloper.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":"2022-04-23T14:21:29.000Z","updated_at":"2025-03-27T00:26:23.000Z","dependencies_parsed_at":"2024-07-23T05:04:12.223Z","dependency_job_id":null,"html_url":"https://github.com/yujideveloper/settings_cabinet","commit_stats":{"total_commits":5,"total_committers":2,"mean_commits":2.5,"dds":"0.19999999999999996","last_synced_commit":"c7170fc5cc38433a293e23bf3ff05bf9497b0dd5"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Fsettings_cabinet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Fsettings_cabinet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Fsettings_cabinet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujideveloper%2Fsettings_cabinet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yujideveloper","download_url":"https://codeload.github.com/yujideveloper/settings_cabinet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975299,"owners_count":21192199,"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","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":["configuration","configuration-management","gem","rails","ruby","ruby-gem","ruby-on-rails","settings-management","sinatra"],"created_at":"2024-10-03T17:24:10.446Z","updated_at":"2025-09-12T12:34:25.195Z","avatar_url":"https://github.com/yujideveloper.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SettingsCabinet\n\n[![Gem Version](https://badge.fury.io/rb/settings_cabinet.svg)](https://badge.fury.io/rb/settings_cabinet)\n[![Build](https://github.com/yujideveloper/settings_cabinet/actions/workflows/main.yml/badge.svg)](https://github.com/yujideveloper/settings_cabinet/actions/workflows/main.yml)\n\nSettingsCabinet is a simple settings solution with ERB-enabled YAML file like [settingslogic](https://github.com/settingslogic/settingslogic).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"settings_cabinet\"\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install settings_cabinet\n\n## Usage\n\nDSL is very similar to settingslogic.\n\n```ruby\nclass Settings \u003c SettingsCabinet::Base\n  using SettingsCabinet::DSL\n\n  source Rails.root.join(\"config\", \"settings.yml\")\n  namespace Rails.env\nend\n```\n\n| Name | Type | Description | Default | Optional |\n|--|--|--|--|--|\n| `source` | String | Path of settings file. | - | No |\n| `namespace` | String | Using a namespace allows you to change your configuration depending on your environment. e.g. `Rails.env` | `nil` | Yes |\n| `permitted_classes` | Array of Class | Arbitrary classes can be allowed by adding those classes to the allowlist. e.g. `[Date, Time]` | `[]` | Yes |\n\n\n```yaml\n# config/settings.yml\ndefaults: \u0026defaults\n  foo:\n    bar: nested setting\n  baz: \u003c%= 3 * 3 %\u003e\n  quz: 24\n\ndevelopment:\n  \u003c\u003c: *defaults\n  quz: 48\n\ntest:\n  \u003c\u003c: *defaults\n\nproduction:\n  \u003c\u003c: *defaults\n```\n\nAccessors are defined in the same way as settingslogic, but writers do not.\n```ruby\nSettings.foo.bar #=\u003e \"nested setting\"\nSettings[:baz]   #=\u003e 9\n\n# Hash Keys Support - Get all available keys from Hash structures\nSettings.foo.keys  #=\u003e [:bar]\nSettings.keys      #=\u003e [:foo, :baz, :quz]\n```\n\nYou can explicitly load all your settings, if needed.\n```ruby\n# e.g. config/initializers/settings.rb\nusing SettingsCabinet::Control\nSettings.load!\n```\nor\n```ruby\nclass Settings \u003c SettingsCabinet::Base\n  using SettingsCabinet::DSL\n  using SettingsCabinet::Control\n\n  source Rails.root.join(\"config\", \"settings.yml\")\n  namespace Rails.env\n\n  load!\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. 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## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/yujideveloper/settings_cabinet. 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/yujideveloper/settings_cabinet/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the SettingsCabinet project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yujideveloper/settings_cabinet/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujideveloper%2Fsettings_cabinet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyujideveloper%2Fsettings_cabinet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujideveloper%2Fsettings_cabinet/lists"}