{"id":16895747,"url":"https://github.com/ytti/asetus","last_synced_at":"2025-04-30T04:50:30.605Z","repository":{"id":15507696,"uuid":"18241837","full_name":"ytti/asetus","owner":"ytti","description":"silly little configuration library for ruby","archived":false,"fork":false,"pushed_at":"2024-05-31T16:48:20.000Z","size":31,"stargazers_count":6,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T12:58:01.213Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ytti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-03-29T13:31:13.000Z","updated_at":"2023-04-24T17:36:33.000Z","dependencies_parsed_at":"2023-11-21T06:24:04.515Z","dependency_job_id":"a319d59d-dd63-4228-8295-974ba9df35c6","html_url":"https://github.com/ytti/asetus","commit_stats":{"total_commits":25,"total_committers":4,"mean_commits":6.25,"dds":"0.16000000000000003","last_synced_commit":"b231ca707add137805c209c5883360861e132ae9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fasetus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fasetus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fasetus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fasetus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ytti","download_url":"https://codeload.github.com/ytti/asetus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644827,"owners_count":21620630,"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-10-13T17:25:51.810Z","updated_at":"2025-04-30T04:50:30.583Z","avatar_url":"https://github.com/ytti.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Asetus\nConfiguration library for ruby with YAML/JSON/TOML backends with unified object\naccess\n\n## Install\n```\n % gem install asetus\n```\n\n## Use\n### Simple\n```\nrequire 'asetus'\ncfg  = Asetus.cfg\nport = cfg.server.port\nuser = cfg.auth.user\npw   = cfg.auth.password\n```\nIt tried to detect your software name via caller_locations if no ':name'\nargument was given.\nIt automatically loads /etc/name/config and ~/.config/name/config and merges\nthem together.\n\n### Advanced\n```\nrequire 'asetus'\nasetus = Asetus.new name:    'mykewlapp',\n                    default: {'poop'=\u003e'xyzzy'},\n                    adapter: 'yaml',\n                    usrdir:  '/home/app/config/',\n                    sysdir:  '/System/config/',\n                    load:    false\nasetus.default.poop2 = [1, 2, 3, 4]\nasetus.default.starship.poopers = 42\nasetus.load :user\nif asetus.user.empty?\n  asetus.user = asetus.default\n  asetus.save :user\nend\nasetus.load    # load+merges cfg, takes argument :default, :system, :user\nasetus.cfg     # merged default + system + user  (merged on load)\nasetus.default # default only\nasetus.system  # system only\nasetus.user    # user only\n```\n\n## Reserved methods\n\n* each           - iterate all config keys in current level\n* has_key?(arg)  - check if current level has key arg\n* [arg]          - fetch arg (useful for non-literal retrieval, instead of using #send)\n* key?           - all keys have question mark version reserved, checks if key exists+true (true), exists+false (false), not-exists (nil)\n+ all object class methods\n\n## TODO\n\n  * should I add feature to raise on unconfigured/unset?\n  * should I always merge to 'cfg' when default/system/config is set?\n\n## License and Copyright\n\nCopyright 2014-2016 Saku Ytti \u003csaku@ytti.fi\u003e\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytti%2Fasetus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytti%2Fasetus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytti%2Fasetus/lists"}