{"id":28413848,"url":"https://github.com/moltar/project-environment","last_synced_at":"2026-07-13T03:31:30.742Z","repository":{"id":12748660,"uuid":"15421825","full_name":"moltar/Project-Environment","owner":"moltar","description":"Set and detect project environment via .environment file.","archived":false,"fork":false,"pushed_at":"2013-12-24T18:06:18.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T16:23:59.271Z","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":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moltar.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":"2013-12-24T16:36:45.000Z","updated_at":"2014-09-09T14:50:58.000Z","dependencies_parsed_at":"2022-09-12T11:51:26.809Z","dependency_job_id":null,"html_url":"https://github.com/moltar/Project-Environment","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/moltar/Project-Environment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltar%2FProject-Environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltar%2FProject-Environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltar%2FProject-Environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltar%2FProject-Environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moltar","download_url":"https://codeload.github.com/moltar/Project-Environment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moltar%2FProject-Environment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261129762,"owners_count":23113890,"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":"2025-06-03T06:09:35.288Z","updated_at":"2025-10-25T02:08:05.683Z","avatar_url":"https://github.com/moltar.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nProject::Environment - Set and detect project environment via .environment file.\n\n# VERSION\n\nversion v1.2.0\n\n# SYNOPSIS\n\nAdd a .environment file into the root of your project:\n\n    .\n    |-- .environment (\u003c-- add this)\n    |-- .git\n    |-- lib\n        |-- MyApp\n        |  |-- Environment.pm\n        |-- MyApp.pm\n\nDefine a subclass for your application:\n\n    package MyApp::Environment;\n\n    use Moose;\n    extends 'Project::Environment';\n\n    1;\n\nNow, somewhere inside your application code:\n\n    my $env = MyApp::Environment-\u003einstance-\u003eproject_environment; ## or -\u003eenv\n\n# DESCRIPTION\n\nThis module provides a way to determine the environment an application is\nrunning in (e.g. development, production, testing, etc.).\n\nMainly the environment is detected from `.environment` file in the project\nroot.\n\nYou can also set the environment via `%ENV`.\n\nMost of the functionality defined and documented in\n[Project::Environment::Role](http://search.cpan.org/perldoc?Project::Environment::Role).\n\nThis consumer class provides 2 things:\n\n## singularity\n\nThis isn't exactly a singleton. And all of the magic is provided by\n[MooseX::Role::Flyweight](http://search.cpan.org/perldoc?MooseX::Role::Flyweight).\n\nIn short, all you have to do is call `instance` constructor instead of `new`\nand you get only one instance of the object and the result of the figuring out\nthe environment is cached.\n\n## stringification\n\nAn instance of [Project::Environment](http://search.cpan.org/perldoc?Project::Environment) will stringify into the\nenvironment name properly. This is useful if you were to store the instance\nof the [Project::Environment](http://search.cpan.org/perldoc?Project::Environment) object in an attribute, rather than\nthe string name of the environment.\n\n    has environment =\u003e (\n        is      =\u003e 'ro',\n        default =\u003e sub { MyApp::Environment-\u003einstance },\n    );\n\nSomewhere else in the application code:\n\n    if ($self-\u003eenvironment eq 'production') {\n        ## do not break\n    } else {\n        ## break everything\n    }\n\n# AUTHOR\n\nRoman F. \u003cromanf@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2013 by Roman F..\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%2Fmoltar%2Fproject-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoltar%2Fproject-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoltar%2Fproject-environment/lists"}