{"id":28640774,"url":"https://github.com/pd/figgy","last_synced_at":"2025-10-10T09:08:53.132Z","repository":{"id":54918735,"uuid":"2621653","full_name":"pd/figgy","owner":"pd","description":"YAML/JSON/... configuration file library","archived":false,"fork":false,"pushed_at":"2021-01-21T04:40:51.000Z","size":67,"stargazers_count":18,"open_issues_count":1,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-07T17:30:24.838Z","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/pd.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2011-10-21T16:49:09.000Z","updated_at":"2019-07-16T19:06:16.000Z","dependencies_parsed_at":"2022-08-14T06:40:17.348Z","dependency_job_id":null,"html_url":"https://github.com/pd/figgy","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pd/figgy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Ffiggy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Ffiggy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Ffiggy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Ffiggy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pd","download_url":"https://codeload.github.com/pd/figgy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pd%2Ffiggy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001296,"owners_count":26083058,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-06-12T20:08:22.789Z","updated_at":"2025-10-10T09:08:53.114Z","avatar_url":"https://github.com/pd.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# figgy\n\n[![Gem Version](https://badge.fury.io/rb/figgy.svg)](http://badge.fury.io/rb/figgy)\n[![Build Status](https://secure.travis-ci.org/pd/figgy.svg)](http://travis-ci.org/pd/figgy)\n[![Dependency Status](https://gemnasium.com/pd/figgy.svg)](https://gemnasium.com/pd/figgy)\n[![Code Climate](https://codeclimate.com/github/pd/figgy.png)](https://codeclimate.com/github/pd/figgy)\n[![Coverage Status](https://img.shields.io/coveralls/pd/figgy.svg)](https://coveralls.io/r/pd/figgy?branch=master)\n\nProvides convenient access to configuration files in various formats, with\nsupport for overriding the values based on environment, hostname, locale, or\nany other arbitrary thing you happen to come up with.\n\n## Documentation\n[yardocs](http://rdoc.info/github/pd/figgy/master/frames)\n\n## Installation\n\nJust like everything else these days. In your Gemfile:\n\n~~~ruby\ngem 'figgy'\n~~~\n\n## Overview\n\nSet it up (say, in a Rails initializer):\n\n~~~ruby\nAppConfig = Figgy.build do |config|\n  config.root = Rails.root.join('etc')\n\n  # config.foo is read from etc/foo.yml\n  config.define_overlay :default, nil\n\n  # config.foo is then updated with values from etc/production/foo.yml\n  config.define_overlay(:environment) { Rails.env }\n\n  # Maybe you need to load XML files?\n  config.define_handler 'xml' do |contents|\n    Hash.from_xml(contents)\n  end\nend\n~~~\n\nAccess it as a dottable, indifferent-access hash:\n\n~~~ruby\nAppConfig.foo.some_key\nAppConfig[\"foo\"][\"some_key\"]\nAppConfig[:foo].some_key\n~~~\n\nMultiple root directories may be specified, so that configuration files live in\nmore than one place (say, in gems):\n\n~~~ruby\nAppConfig = Figgy.build do |config|\n  config.root = Rails.root.join('etc')\n  config.add_root Rails.root.join('vendor/etc')\nend\n~~~\n\nPrecedence of root directories is in reverse order of definition, such that the\nroot directory added first (typically the one immediately within the application)\nhas highest precedence. In this way, defaults can be inherited from libraries,\nbut then overridden when necessary within the application.\n\n## Caveats\n\nBecause the objects exposed by figgy are often hashes, all of the instance methods\nof Hash (and, of course, Enumerable) are available along the chain. But note that\nthis means you can not use key names such as `size` or `each` with the dottable\naccess style:\n\n~~~ruby\nAppConfig.price.bulk   #=\u003e 100.00\nAppConfig.price.each   #=\u003e attempts to invoke Hash#each\nAppConfig.price[:each] #=\u003e 50.00\n~~~\n\n## Thanks\n\nThis was written on [Enova's](http://www.enova.com) dime/time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpd%2Ffiggy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpd%2Ffiggy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpd%2Ffiggy/lists"}