{"id":20586051,"url":"https://github.com/charlotte-ruby/yettings","last_synced_at":"2025-04-24T00:22:54.605Z","repository":{"id":56899099,"uuid":"1448297","full_name":"charlotte-ruby/yettings","owner":"charlotte-ruby","description":"Create settings/constants for your Rails 3 app using a YAML file","archived":false,"fork":false,"pushed_at":"2024-04-25T11:41:01.000Z","size":112,"stargazers_count":48,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T18:37:11.963Z","etag":null,"topics":[],"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/charlotte-ruby.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2011-03-07T01:18:30.000Z","updated_at":"2024-07-05T05:21:18.000Z","dependencies_parsed_at":"2024-06-19T06:18:22.391Z","dependency_job_id":"d750fc5f-770f-4b77-b15f-bc76d79eafe0","html_url":"https://github.com/charlotte-ruby/yettings","commit_stats":{"total_commits":32,"total_committers":8,"mean_commits":4.0,"dds":0.59375,"last_synced_commit":"7038b2ddc350717a0421542e7f8e556220488922"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlotte-ruby%2Fyettings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlotte-ruby%2Fyettings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlotte-ruby%2Fyettings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlotte-ruby%2Fyettings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlotte-ruby","download_url":"https://codeload.github.com/charlotte-ruby/yettings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250536251,"owners_count":21446701,"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":[],"created_at":"2024-11-16T07:10:05.107Z","updated_at":"2025-04-24T00:22:54.569Z","avatar_url":"https://github.com/charlotte-ruby.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= yettings\n\n{\u003cimg src=\"https://circleci.com/gh/charlotte-ruby/yettings.svg?style=svg\u0026circle-token=e8a60b2909ea85f91f0cfef9a27b512989109ca3\" alt=\"CircleCI\" /\u003e}[https://circleci.com/gh/charlotte-ruby/yettings]\n\nYAML settings for your Rails 3 app.\n\n== What does it do?\n\nYettings allows you to add a yml file to your \"config\" directory and you can access the values defined in the YAML in your Rails app.  You can\nuse this to store API keys, constants, and other key/value pairs.  This plugin was heavily inspired by settingslogic, with a few differences... You don't\nhave to add a class and point to the YML file.  The Yetting class will be created dynamically and will be available to your Rails app.  This plugin is also\nmore basic than settingslogic.  It does not have support for dynamic setting creation... only the values in the yetting.yml will be available.\n\n== This project only supports Rails 3 and Ruby 1.9.2\n\nThere is a branch for 1.8.7, but it has not been merged into master. If you want to use it, you can reference the github location and branch in your Gemfile. See the issue tracker for more details\n\n== Known bug in YAML psych parser\nThis bug can cause issues loading the YAML keys when using Yettings.  The workaround is to set your YAML parser to sych if your environment is currently using psych:\n\n    YAML::ENGINE.yamler = \"syck\"\n\nMore info here:  http://pivotallabs.com/users/mkocher/blog/articles/1692-yaml-psych-and-ruby-1-9-2-p180-here-there-be-dragons\n\nThis issue is fixed in ruby-1.9.2-p271.\n\n== Usage\n\n===Install the gem\n\nAdd this to your Gemfile\n  gem \"yettings\"\n\nInstall with Bundler\n  bundle install\n\n===Adding the YAML file with your key/value pairs\n\n1. Create a YAML file inside /your_rails_app/config called yetting.yml\n2. If you want to namespace your Yettings, create a YAML file inside /your_rails_app/config/yettings/ and call it whatever you want.\n\n===YAML file content\nYou can define key/value pairs in the YAML file and these will be available in your app.  You can set the defaults and any environment specific values.\nThe file must contain each environment that you will use in your Rails app.  Here is a sample:\n\n  defaults: \u0026defaults\n    api_key: asdf12345lkj\n    some_number: 999\n    an_erb_yetting: \u003c%= \"erb stuff works\" %\u003e\n    some_array:\n      - element1\n      - element2\n\n  development:\n    \u003c\u003c: *defaults\n    api_key: api key for dev\n\n  test:\n    \u003c\u003c: *defaults\n\n  production:\n    \u003c\u003c: *defaults\n\nIn the above example, you can define the key/value pair using strings, numbers, erb code, or arrays.  Notice that the \"api_key\" in the development\nenvironment will override the \"api_key\" from defaults.\n\n===Accessing the values in your Rails app\n\nYou simply call the Yetting class or the namespaced class and the key as a class method.  For namespaced yml files, Yettings will convert the filename in\n/your_rails_app/config/yettings/ to a class name and append Yetting.  So if you have main.yml, then it will use MainYetting as the class name.\nThen you can call the key that you put in the YAML as a class method.  Here are 2 examples:\n\n  #/your_rails_app/config/yetting.yml in production\n  Yetting.some_number #=\u003e 999\n  Yetting.api_key #=\u003e \"asdf12345lkj\"\n\n  #/your_rails_app/config/yettings/main.yml\n  MainYetting.some_number #=\u003e 999\n  MainYetting.some_array #=\u003e [\"element1\",\"element2\"]\n\n\n== Contributing to yettings\n\n* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet\n* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it\n* Fork the project\n* Start a feature/bugfix branch\n* Commit and push until you are happy with your contribution\n* Make sure to add tests for it. I will not even look at patches without a test included.\n* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.\n\n== Copyright\n\nCopyright (c) 2011 cowboycoded. See LICENSE.txt for\nfurther details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlotte-ruby%2Fyettings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlotte-ruby%2Fyettings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlotte-ruby%2Fyettings/lists"}