{"id":19640344,"url":"https://github.com/kentnl/dist-zilla-util-expandini","last_synced_at":"2026-06-09T02:35:34.277Z","repository":{"id":17598078,"uuid":"20401782","full_name":"kentnl/Dist-Zilla-Util-ExpandINI","owner":"kentnl","description":"Read an INI file and expand bundles as you go.\n","archived":false,"fork":false,"pushed_at":"2017-03-04T05:53:41.000Z","size":254,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T18:56:54.080Z","etag":null,"topics":["dist-zilla","perl"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"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":"CONTRIBUTING.pod","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-02T11:31:54.000Z","updated_at":"2017-03-04T05:28:19.000Z","dependencies_parsed_at":"2022-09-11T16:11:40.713Z","dependency_job_id":null,"html_url":"https://github.com/kentnl/Dist-Zilla-Util-ExpandINI","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FDist-Zilla-Util-ExpandINI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FDist-Zilla-Util-ExpandINI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FDist-Zilla-Util-ExpandINI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FDist-Zilla-Util-ExpandINI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentnl","download_url":"https://codeload.github.com/kentnl/Dist-Zilla-Util-ExpandINI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240947648,"owners_count":19883030,"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":["dist-zilla","perl"],"created_at":"2024-11-11T14:05:30.969Z","updated_at":"2026-06-09T02:35:34.201Z","avatar_url":"https://github.com/kentnl.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nDist::Zilla::Util::ExpandINI - Read an INI file and expand bundles as you go.\n\n# VERSION\n\nversion 0.003004\n\n# SYNOPSIS\n\n    # Write a dist.ini with a bundle anywhere you like\n    my $string = \u003c\u003c\"EOF\";\n    name = Foo\n    version = 1.000\n\n    [@Some::Author]\n    EOF\n\n    path('dist.ini.meta')-\u003espew($string);\n\n    # Generate a copy with bundles inlined.\n    use Dist::Zilla::Util::ExpandINI;\n    Dist::Zilla::Util::ExpandINI-\u003efilter_file( 'dist.ini.meta' =\u003e 'dist.ini' );\n\n    # Hurrah, dist.ini has all the things!\n\n    # Advanced Usage:\n    my $filter = Dist::Zilla::Util::ExpandINI-\u003enew(\n      include_does =\u003e [ 'Dist::Zilla::Role::FileGatherer', ],\n      exclude_does =\u003e [ 'Dist::Zilla::Role::Releaser', ],\n    );\n    $filter-\u003efilter_file( 'dist.ini.meta' =\u003e 'dist.ini' );\n\n# DESCRIPTION\n\nThis module builds upon the previous work [`:Util::BundleInfo`](https://metacpan.org/pod/Dist::Zilla::Util::BundleInfo) ( Which can extract\nconfiguration from a bundle in a manner similar to how `dzil` does it ) and integrates it with some _very_ minimal `INI`\nhandling to provide a tool capable of generating bundle-free `dist.ini` files from bundle-using `dist.ini` files!\n\nAt present its very naïve and only keeps semantic ordering, and I've probably gotten something wrong due to cutting the\ncomplexity of Config::MVP out of the loop.\n\nBut at this stage, bundles are the _only_ thing modified in transit.\n\nEvery thing else is practically a token-level copy-paste.\n\n# METHODS\n\n## `filter_file`\n\n                                             #  $source   , $dest\n    Dist::Zilla::Util::ExpandINI-\u003efilter_file('source.ini','target.ini');\n\nReads `$source`, performs expansions, and emits `$dest`\n\n## `filter_handle`\n\n    Dist::Zilla::Util::ExpandINI-\u003efilter_handle($reader,$writer);\n\nReads `$reader`, performs expansions, and emits to `$writer`\n\n## `filter_string`\n\n    my $return = Dist::Zilla::Util::ExpandINI-\u003efilter_string($source);\n\nDecodes `$source`, performs expansions, and returns expanded source.\n\n# ATTRIBUTES\n\n## `include_does`\n\nAn `ArrayRef` of `Role`s to include in the emitted `INI` from the source `INI`.\n\nIf this `ArrayRef` is empty, all `Plugin`s will be included.\n\nThis is the default behavior.\n\n    -\u003enew( include_does =\u003e [ 'Dist::Zilla::Role::VersionProvider', ] );\n\n( `API` Since `0.002000` )\n\n## `exclude_does`\n\nAn `ArrayRef` of `Role`s to _exclude_ from the emitted `INI`.\n\nIf this `ArrayRef` is empty, _no_ `Plugin`s will be _excluded_\n\nThis is the default behavior.\n\n    -\u003enew( exclude_does =\u003e [ 'Dist::Zilla::Role::Releaser', ] );\n\n( `API` Since `0.002000` )\n\n## `comments`\n\nThis attribute controls how comments are handled.\n\n- `all` - All comments are copied ( **Default** )\n- `authordeps` - Only comments that look like `Dist::Zilla` `AuthorDeps` are copied.\n- `none` - No comments are copied.\n\n( `API` Since `0.003000` )\n\n# COMMENT PRESERVATION\n\nComments are ( since `v0.002000` ) arbitrarily supported in a very basic way.\nBut the behavior may be surprising.\n\n    [SectionHeader]\n    BODY\n    [SectionHeader]\n    BODY\n\nIs how `Config::INI` understands its content. So comment parsing is implemented as\n\n    BODY:\n      comments: [ \"A\", \"B\", \"C\" ],\n      params:   [ \"x=y\",\"foo=bar\" ]\n\nSo:\n\n    [Header]\n    ;A\n    x = y ; Trailing Note\n    ;B\n    foo = bar ; Trailing Note\n\n    ;Remark About Header2\n    [Header2]\n\nIs re-serialized as:\n\n    [Header]\n    ;A\n    ;B\n    ;Remark About Header2\n    x = y\n    foo = bar\n\n    [Header2]\n\nThis behavior may seem surprising, but its surprising only if you\nhave assumptions about how `INI` parsing works.\n\nThis also applies and has strange effects with bundles:\n\n    [Header]\n    x = y\n\n    ; CommentAboutBundle\n    [@Bundle]\n    ; More Comments About Bundle\n\n    [Header2]\n\nThis expands as:\n\n    [Header]\n    ; CommentAboutBundle\n    x = y\n\n    [BundleHeader1]\n    arg = value\n\n    [BundleHeader2]\n    arg = value\n\n    [BundleHeader3]\n    ; More Comments About Bundle\n    arg = value\n\n    [Header2]\n\nAnd also note, at this time, only whole-line comments are preserved. Suffix comments are stripped.\n\n# AUTHOR\n\nKent Fredric \u003ckentnl@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2017 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%2Fdist-zilla-util-expandini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentnl%2Fdist-zilla-util-expandini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentnl%2Fdist-zilla-util-expandini/lists"}