From: Matt S Trout Date: Tue, 16 Nov 2010 00:26:51 +0000 (+0000) Subject: clean up and add NAME sections X-Git-Tag: 0.009001~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b6e5fff98deff2029a3da87cc075ab67b3eab3a;p=gitmo%2FRole-Tiny.git clean up and add NAME sections --- diff --git a/lib/Moo/Role.pm b/lib/Moo/Role.pm index 6710384..a38677a 100644 --- a/lib/Moo/Role.pm +++ b/lib/Moo/Role.pm @@ -73,7 +73,9 @@ sub _handle_constructor { 1; -=pod +=head1 NAME + +Moo::Role - Minimal Object Orientation support for Roles =head1 SYNOPSIS diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 009814b..57028ed 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -222,7 +222,9 @@ sub does_role { 1; -=pod +=head1 NAME + +Role::Tiny - Roles. Like a nouvelle cusine portion size slice of Moose. =head1 SYNOPSIS diff --git a/lib/Sub/Defer.pm b/lib/Sub/Defer.pm index c3e4089..7a41e8f 100644 --- a/lib/Sub/Defer.pm +++ b/lib/Sub/Defer.pm @@ -38,6 +38,10 @@ sub defer_sub { =pod +=head1 NAME + +Sub::Defer - defer generation of subroutines until they are first called + =head1 SYNOPSIS use Sub::Defer; @@ -47,13 +51,12 @@ sub defer_sub { sub { time - $t }; }; -What the above does is set the Logger::time_since_first_log subroutine to be -the codref that was passed to it, but then after it gets run once, it becomes -the returned coderef. + Logger->time_since_first_log; # returns 0 and replaces itself + Logger->time_since_first_log; # returns time - $t =head1 DESCRIPTION -These subroutines provide the user with a convenient way to defer create of +These subroutines provide the user with a convenient way to defer creation of subroutines and methods until they are first called. =head1 SUBROUTINES @@ -62,11 +65,12 @@ subroutines and methods until they are first called. my $coderef = defer_sub $name => sub { ... }; -RIBASUSHI FIX ME PLEASE!!!! +This subroutine returns a coderef that encapsulates the provided sub - when +it is first called, the provided sub is called and is -itself- expected to +return a subroutine which will be goto'ed to on subsequent calls. -Given name to install a subroutine into and a coderef that returns a coderef, -this function will set up the subroutine such that when it is first called it -will be replaced with the returned coderef. +If a name is provided, this also installs the sub as that name - and when +the subroutine is undeferred will re-install the final version for speed. =head2 undefer_sub diff --git a/lib/Sub/Quote.pm b/lib/Sub/Quote.pm index 215657d..f58652a 100644 --- a/lib/Sub/Quote.pm +++ b/lib/Sub/Quote.pm @@ -133,7 +133,9 @@ sub unquote_sub { 1; -=pod +=head1 NAME + +Sub::Quote - efficient generation of subroutines via string eval =head1 SYNOPSIS