[libmoosex-lazyrequire-perl] 11/11: MooseX-LazyRequire-0.09

Intrigeri intrigeri at moszumanska.debian.org
Wed Aug 27 21:25:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to annotated tag v0.09
in repository libmoosex-lazyrequire-perl.

commit 4410307240422dbd68cbbda750ce0c325122773e
Author: Karen Etheridge <ether at cpan.org>
Date:   Sat Dec 1 14:16:37 2012 -0800

    MooseX-LazyRequire-0.09
    
      * Invalid tests that failed on perl 5.17.6 have been fixed (they were always
        invalid, but the changes to hash key ordering only now made the tests
        start failing in an obvious way) (RT#81419)
      * unnecessary dependency on MooseX::Types removed
---
 Changes   |  2 ++
 README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/Changes b/Changes
index 431ec46..0d81762 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 Change history for distribution {{$dist->name}}
 
 {{$NEXT}}
+
+0.09      2012-12-01 14:16:14 PST-0800  (Karen Etheridge)
   * Invalid tests that failed on perl 5.17.6 have been fixed (they were always
     invalid, but the changes to hash key ordering only now made the tests
     start failing in an obvious way) (RT#81419)
diff --git a/README.md b/README.md
index e69de29..36ad926 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,64 @@
+# NAME
+
+MooseX::LazyRequire - Required attributes which fail only when trying to use them
+
+# SYNOPSIS
+
+    package Foo;
+
+    use Moose;
+    use MooseX::LazyRequire;
+
+    has foo => (
+        is            => 'ro',
+        lazy_required => 1,
+    );
+
+    has bar => (
+        is      => 'ro',
+        builder => '_build_bar',
+    );
+
+    sub _build_bar { shift->foo }
+
+
+
+    Foo->new(foo => 42); # succeeds, foo and bar will be 42
+    Foo->new(bar => 42); # succeeds, bar will be 42
+    Foo->new;            # fails, neither foo nor bare were given
+
+# DESCRIPTION
+
+This module adds a `lazy_required` option to Moose attribute declarations.
+
+The reader methods for all attributes with that option will throw an exception
+unless a value for the attributes was provided earlier by a constructor
+parameter or through a writer method.
+
+# CAVEATS
+
+Prior to Moose 1.9900, roles didn't have an attribute metaclass, so this module can't
+easily apply its magic to attributes defined in roles. If you want to use
+`lazy_required` in role attributes, you'll have to apply the attribute trait
+yourself:
+
+    has foo => (
+        traits        => ['LazyRequire'],
+        is            => 'ro',
+        lazy_required => 1,
+    );
+
+With Moose 1.9900, you can use this module in roles just the same way you can
+in classes.
+
+# AUTHORS
+
+- Florian Ragwitz <rafl at debian.org>
+- Dave Rolsky <autarch at urth.org>
+
+# COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2012 by Florian Ragwitz.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoosex-lazyrequire-perl.git



More information about the Pkg-perl-cvs-commits mailing list