{"id":17635917,"url":"https://github.com/mohawk2/moox-attribute-env","last_synced_at":"2025-08-23T02:04:48.475Z","repository":{"id":46620205,"uuid":"175708731","full_name":"mohawk2/moox-attribute-env","owner":"mohawk2","description":"Moo equivalent of https://metacpan.org/pod/MooseX::Attribute::ENV","archived":false,"fork":false,"pushed_at":"2022-10-19T15:28:48.000Z","size":19,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T03:43:02.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/MooX::Attribute::ENV","language":"Perl","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/mohawk2.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-14T22:21:30.000Z","updated_at":"2023-04-24T13:18:43.000Z","dependencies_parsed_at":"2022-08-26T08:50:45.632Z","dependency_job_id":null,"html_url":"https://github.com/mohawk2/moox-attribute-env","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mohawk2/moox-attribute-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fmoox-attribute-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fmoox-attribute-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fmoox-attribute-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fmoox-attribute-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohawk2","download_url":"https://codeload.github.com/mohawk2/moox-attribute-env/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohawk2%2Fmoox-attribute-env/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268876790,"owners_count":24322106,"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-08-05T02:00:12.334Z","response_time":2576,"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-10-23T02:24:38.204Z","updated_at":"2025-08-05T10:18:30.115Z","avatar_url":"https://github.com/mohawk2.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nMooX::Attribute::ENV - Allow Moo attributes to get their values from %ENV\n\n# PROJECT STATUS\n\n| OS      |  Build status |\n|:-------:|--------------:|\n| Linux   | [![Build Status](https://travis-ci.org/mohawk2/moox-attribute-env.svg?branch=master)](https://travis-ci.org/mohawk2/moox-attribute-env) |\n\n[![CPAN version](https://badge.fury.io/pl/MooX-Attribute-ENV.svg)](https://metacpan.org/pod/MooX::Attribute::ENV) [![Coverage Status](https://coveralls.io/repos/github/mohawk2/moox-attribute-env/badge.svg?branch=master)](https://coveralls.io/github/mohawk2/moox-attribute-env?branch=master)\n\n# SYNOPSIS\n\n    package MyMod;\n    use Moo;\n    use MooX::Attribute::ENV;\n    # look for $ENV{attr_val} and $ENV{ATTR_VAL}\n    has attr =\u003e (\n      is =\u003e 'ro',\n      env_key =\u003e 'attr_val',\n    );\n    # look for $ENV{attr_val} and $ENV{next_val}, in that order\n    has some =\u003e (\n      is =\u003e 'ro',\n      env_key =\u003e [ 'attr_val', 'next_val' ],\n    );\n    # looks for $ENV{otherattr} and $ENV{OTHERATTR}, then any default\n    has otherattr =\u003e (\n      is =\u003e 'ro',\n      env =\u003e 1,\n      default =\u003e 7,\n    );\n    # looks for $ENV{xxx_prefixattr} and $ENV{XXX_PREFIXATTR}\n    has prefixattr =\u003e (\n      is =\u003e 'ro',\n      env_prefix =\u003e 'xxx',\n    );\n    # looks for $ENV{MyMod_packageattr} and $ENV{MYMOD_PACKAGEATTR}\n    has packageattr =\u003e (\n      is =\u003e 'ro',\n      env_package_prefix =\u003e 1,\n    );\n\n    $ perl -MMyMod -E 'say MyMod-\u003enew(attr =\u003e 2)-\u003eattr'\n    # 2\n    $ ATTR_VAL=3 perl -MMyMod -E 'say MyMod-\u003enew-\u003eattr'\n    # 3\n    $ OTHERATTR=4 perl -MMyMod -E 'say MyMod-\u003enew-\u003eotherattr'\n    # 4\n\n# DESCRIPTION\n\nThis is a [Moo](https://metacpan.org/pod/Moo) extension. It allows other attributes for [\"has\" in Moo](https://metacpan.org/pod/Moo#has). If\nany of these are given, then [\"BUILDARGS\" in Moo](https://metacpan.org/pod/Moo#BUILDARGS) is wrapped so that values\nfor object attributes can, if not supplied in the normal construction\nprocess, come from the environment.\n\nThe environment will be searched for either the given case, or upper case,\nversion of the names discussed below.\n\nWhen a prefix is mentioned, it will be prepended to the mentioned name,\nwith a `_` in between.\n\n# ADDITIONAL ATTRIBUTES\n\n## env\n\nBoolean. If true, the name is the attribute, no prefix.\n\n## env\\_key\n\nString. If true, the name is the given value, no prefix.\n\nor\n\nArrayRef. A list of names that will be checked in given order.\n\n## env\\_prefix\n\nString. The prefix is the given value.\n\n## env\\_package\\_prefix\n\nBoolean. If true, use as the prefix the current package-name, with `::`\nreplaced with `_`.\n\n# AUTHOR\n\nEd J, porting John Napiorkowski's excellent [MooseX::Attribute::ENV](https://metacpan.org/pod/MooseX%3A%3AAttribute%3A%3AENV).\n\n# LICENCE\n\nThe same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohawk2%2Fmoox-attribute-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohawk2%2Fmoox-attribute-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohawk2%2Fmoox-attribute-env/lists"}