{"id":19640535,"url":"https://github.com/kentnl/chi-config","last_synced_at":"2026-06-23T04:31:24.891Z","repository":{"id":22934799,"uuid":"26284002","full_name":"kentnl/CHI-Config","owner":"kentnl","description":"Define CHI configuration outside your code","archived":false,"fork":false,"pushed_at":"2014-11-08T02:39:40.000Z","size":256,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-26T03:42:27.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"edx/edx-val","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kentnl.png","metadata":{"files":{"readme":"README.mkdn","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-06T18:36:36.000Z","updated_at":"2014-11-06T18:37:16.000Z","dependencies_parsed_at":"2022-08-21T16:50:51.574Z","dependency_job_id":null,"html_url":"https://github.com/kentnl/CHI-Config","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/kentnl/CHI-Config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FCHI-Config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FCHI-Config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FCHI-Config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FCHI-Config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentnl","download_url":"https://codeload.github.com/kentnl/CHI-Config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FCHI-Config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34675970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"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":"2024-11-11T14:06:04.543Z","updated_at":"2026-06-23T04:31:24.870Z","avatar_url":"https://github.com/kentnl.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nCHI::Config - Define CHI configuration outside your code\n\n# VERSION\n\nversion 0.001002\n\n# SYNOPSIS\n\n    use CHI::Config;\n\n    my $config = CHI::Config-\u003enew(\n      defaults =\u003e [\n        # Defaults indeed has to mimic the source file for future purposes\n        # ie: I plan to make some objects ( such as serializers )\n        # be configurable as well and they can't really be defined as-is in JSON\n        {\n            type =\u003e 'driver',\n            name =\u003e 'myproject.roflmayo',\n            config =\u003e {\n                # Arguments to CHI-\u003enew()\n            },\n        },\n      ],\n    );\n\n    my $cache = $config-\u003eget_cache('myproject.roflmayo');\n\n    # Do stuff with $cache and get default behaviour\n\n    # User creates ~/.chi/config.json\n    [\n      {\n        'type' : 'driver',\n        'name' : 'myproject.roflmayo',\n        'config': {\n           # CHI CONFIG HERE\n        },\n      }\n    ]\n\n    my $cache = $config-\u003eget_cache('myproject.roflmayo');  # Now gets user defined copy\n\n# CONSTRUCTOR ARGUMENTS\n\n## `config_paths`\n\n_Optional_: An ArrayRef of path prefixes to scan and load.\n\nFor instance:\n\n    ( config_paths =\u003e ['./foo'] )\n\nWould automatically attempt to load any files called\n\n    foo.yml\n    foo.json\n    foo.ini\n\nAnd load them with the relevant helpers.\n\nSee [`Config::Any`](https://metacpan.org/pod/Config::Any) for details on this mechanism.\n\nPaths will be interpreted in the order specified, with the first one\ntaking precedence over the latter ones for any given driver name,\nwith `defaults` being taken only if they're needed.\n\nDefault paths loaded are as follows:\n\n    $ENV{CHI_CONFIG_DIR}/config.*\n    ./chi_config.*\n    ~/.chi/config.*\n    /etc/chi/config.*\n\n## `config_files`\n\n_Optional_: An ArrayRef of files to scan and load.\n\nIf specified, this list entirely overrules that provided by\n[`config_paths`](#config_paths)\n\n## `defaults`\n\n_Recommended_: An ArrayRef of defaults in the same notation as the configuration spec.\n\n    defaults =\u003e [\n         $entry,\n         $entry,\n         $entry,\n    ],\n\nSee [\"ENTRIES\"](#entries)\n\n# METHODS\n\n## `get_cache`\n\nRetrieve an instance of a cache object for consumption.\n\n    my $cache = $config-\u003eget_cache('myproject.myname');\n\n    $cache-\u003e# things with CHI\n\n# ENTRIES\n\nBoth the internal array based interface and the configuration file\nare a list of `Entries`. Design somewhat inspired by `Config::MVP`'s\nsequence model, but much more lightweight.\n\n## `driver` entry\n\nThese make up the core of a configuration.\n\n    {\n      type =\u003e 'driver',\n\n      # The following are all passed through to\n      # CHI::Config::Driver\n\n      # STRONGLY recommended\n      name =\u003e 'mynamespace.mycachename',\n\n      # RAW CHI arguments\n      config =\u003e {\n        %CONFIG    #\n      },\n\n      # return singleton or new caches?\n      memoize =\u003e 0,\n    }\n\nSee [`CHI::Config::Driver`](https://metacpan.org/pod/CHI::Config::Driver) for details.\n\n## `version` entry\n\nThis is a mostly unnecessary element simply designed to give\nsome kind of informal API in the event there are changes in\nhow the configuration is parsed.\n\nCurrently, Spec version is == `0.1.0`\n\n    {\n      type =\u003e 'version',\n\n      # Declare a minimum version of CHI::Config\n      min =\u003e 0.001000,\n\n      # Declare a maximum version of CHI::Config\n      max =\u003e 1.000000,\n\n      # Require exactly specification 0.1.0\n      spec =\u003e '0.1.0',\n    }\n\n`max` and `min` give range controls on the version of `CHI::Config` itself.\n\n`spec` gives an exact match on the _interface_ provided by `CHI::Config`, and is processed as an exact string match.\n\nAny of the criteria not being satisfied will result in a `croak`\n\n# AUTHOR\n\nKent Fredric \u003ckentnl@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2014 by Kent Fredric \u003ckentfredric@gmail.com\u003e.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentnl%2Fchi-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentnl%2Fchi-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentnl%2Fchi-config/lists"}