Index index by Group index by Distribution index by Vendor index by creation date index by Name Mirrors Help Search

perl-MooseX-Attribute-ENV-0.02-lp152.3.2 RPM for noarch

From OpenSuSE Leap 15.2 for noarch

Name: perl-MooseX-Attribute-ENV Distribution: openSUSE Leap 15.2
Version: 0.02 Vendor: openSUSE
Release: lp152.3.2 Build date: Fri Sep 20 20:12:01 2019
Group: Development/Libraries/Perl Build host: lamb17
Size: 10848 Source RPM: perl-MooseX-Attribute-ENV-0.02-lp152.3.2.src.rpm
Packager: https://bugs.opensuse.org
Url: http://search.cpan.org/dist/MooseX-Attribute-ENV/
Summary: Set default of an attribute to a value from %ENV
This is a Moose attribute trait that you use when you want the default
value for an attribute to be populated from the %ENV hash. So, for example
if you have set the environment variable USERNAME = 'John' you can do:

	package MyApp::MyClass;

	use Moose;
	use MooseX::Attribute::ENV;

	has 'username' => (is=>'ro', traits=>['ENV']);

	package main;

	my $myclass = MyApp::MyClass->new();

	print $myclass->username; # STDOUT => 'John';

This is basically similar functionality to something like:

	has 'attr' => (
		is=>'ro',
		default=> sub {
			$ENV{uc 'attr'};
		},
	);

but this module has a few other features that offer merit, as well as being
a simple enough attribute trait that I hope it can serve as a learning
tool.

If the named key isn't found in %ENV, then defaults will execute as normal.

Provides

Requires

License

Artistic-1.0 or GPL-1.0+

Changelog

* Tue Oct 03 2017 coolo@suse.com
  - patch the Makefile to build with perl 5.26
* Tue Dec 02 2014 coolo@suse.com
  - initial package 0.02
    * created by cpanspec 1.78.08

Files

/usr/lib/perl5/vendor_perl/5.26.1/MooseX
/usr/lib/perl5/vendor_perl/5.26.1/MooseX/Attribute
/usr/lib/perl5/vendor_perl/5.26.1/MooseX/Attribute/ENV.pm
/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
/usr/share/doc/packages/perl-MooseX-Attribute-ENV
/usr/share/doc/packages/perl-MooseX-Attribute-ENV/Changes
/usr/share/doc/packages/perl-MooseX-Attribute-ENV/README
/usr/share/man/man3/MooseX::Attribute::ENV.3pm.gz


Generated by rpm2html 1.8.1

Fabrice Bellet, Tue Apr 9 11:50:38 2024