[Catalyst-commits] r6308 - in trunk/Catalyst-Controller-BindLex: . lib/Catalyst/Controller t

bricas at dev.catalyst.perl.org bricas at dev.catalyst.perl.org
Thu Apr 26 16:36:11 GMT 2007


Author: bricas
Date: 2007-04-26 16:36:06 +0100 (Thu, 26 Apr 2007)
New Revision: 6308

Added:
   trunk/Catalyst-Controller-BindLex/Makefile.PL
   trunk/Catalyst-Controller-BindLex/README
   trunk/Catalyst-Controller-BindLex/t/02pod.t
   trunk/Catalyst-Controller-BindLex/t/03podcoverage.t
Removed:
   trunk/Catalyst-Controller-BindLex/Build.PL
Modified:
   trunk/Catalyst-Controller-BindLex/Changes
   trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm
Log:
switch to module::install. add pod/podcoverage tests -- update pod accordingly

Deleted: trunk/Catalyst-Controller-BindLex/Build.PL
===================================================================
--- trunk/Catalyst-Controller-BindLex/Build.PL	2007-04-26 15:28:17 UTC (rev 6307)
+++ trunk/Catalyst-Controller-BindLex/Build.PL	2007-04-26 15:36:06 UTC (rev 6308)
@@ -1,21 +0,0 @@
-use strict;
-use Module::Build;
-
-my $build = Module::Build->new(
-    create_makefile_pl => 'traditional',
-    license            => 'perl',
-    module_name        => 'Catalyst::Controller::BindLex',
-    requires           => {
-        'perl'            => '5.8.1',
-        'Catalyst'        => 0,
-        'PadWalker'       => 0,
-        'Devel::LexAlias' => 0,
-        'Devel::Caller'   => 0,
-        'Array::RefElem'  => 0,
-        'Test::use::ok'   => 0,
-    },
-    create_readme => 1,
-    sign          => 1,
-);
-$build->create_build_script;
-

Modified: trunk/Catalyst-Controller-BindLex/Changes
===================================================================
--- trunk/Catalyst-Controller-BindLex/Changes	2007-04-26 15:28:17 UTC (rev 6307)
+++ trunk/Catalyst-Controller-BindLex/Changes	2007-04-26 15:36:06 UTC (rev 6308)
@@ -1,3 +1,6 @@
+0.04 2007-04-026
+    - switch to Module::Install
+
 0.03
     - Handling of default config changed to be less wrong ;-)
 

Added: trunk/Catalyst-Controller-BindLex/Makefile.PL
===================================================================
--- trunk/Catalyst-Controller-BindLex/Makefile.PL	                        (rev 0)
+++ trunk/Catalyst-Controller-BindLex/Makefile.PL	2007-04-26 15:36:06 UTC (rev 6308)
@@ -0,0 +1,16 @@
+use inc::Module::Install 0.65;
+
+name 'Catalyst-Controller-BindLex';
+all_from 'lib/Catalyst/Controller/BindLex.pm';
+
+perl_version '5.8.1';
+
+requires 'Catalyst';
+requires 'PadWalker';
+requires 'Devel::LexAlias';
+requires 'Devel::Caller';
+requires 'Array::RefElem';
+requires 'Test::use::ok';
+
+auto_install;
+WriteAll;

Added: trunk/Catalyst-Controller-BindLex/README
===================================================================
--- trunk/Catalyst-Controller-BindLex/README	                        (rev 0)
+++ trunk/Catalyst-Controller-BindLex/README	2007-04-26 15:36:06 UTC (rev 6308)
@@ -0,0 +1,97 @@
+NAME
+    Catalyst::Controller::BindLex - Stash your lexical goodness.
+
+SYNOPSIS
+        package MyApp::Controller::Moose;
+        use base qw/Catalyst::Controller::BindLex/;
+
+        sub bar : Local {
+            my ( $self, $c ) = @_;
+
+            my $x : Stashed;
+            my %y : Stashed;
+
+            $x = 100;
+        
+            do_something( $c->stash->{x} ); # 100
+    
+            $c->forward( "gorch" );
+        }
+
+        sub gorch : Private {
+            my ( $self, $c ) = @_;
+            my $x : Stashed;
+
+            do_something( $x ); # still 100
+        }
+
+        sub counter : Local {
+            my ( $self, $c ) = @_;
+            my $count : Session;
+            $c->res->body( "request number " . ++$count );
+        }
+
+DESCRIPTION
+    This plugin lets you put your lexicals on the stash and elsewhere very
+    easily.
+
+    It uses some funky modules to get its job done: PadWalker,
+    Array::RefElem, Devel::Caller, Devel::LexAlias, and attributes. In some
+    people's opinion this hurts this plugin's reputation ;-).
+
+    If you use the same name for two variables with the same storage binding
+    attribute they will be aliased to each other, so you can use this for
+    reading as well as writing values across controller subs. This is almost
+    like sharing your lexical scope.
+
+WHY ISN'T THIS A PLUGIN?
+    The way attributes are handled this can't be a plugin - the
+    MODIFY_SCALAR_ATTRIBUTES methods and friends need to be in the class
+    where the lexical is attributed, and this is typically a controller.
+
+CONFIGURATION
+    You can add attributes to the configaration by mapping attributes to
+    handlers.
+
+    Handlers are either strings of methods to be called on $c with no
+    arguments, which are expected to return a hash reference (like "stash",
+    "session", etc), or code references invoked with $c, a reference to the
+    variable we're binding, and the name of the variable we're binding, also
+    expected to return a hash reference.
+
+DEFAULT ATTRIBUTES
+    Some default attributes are pre-configured:
+
+    Stash, Stashed
+    Session, Sessioned
+    Flash, Flashed
+        Bind the variable to a key in "stash", "session", or "flash"
+        respectively.
+
+        The latter two require the use of a session; see
+        Catalyst::Plugin::Session.
+
+RECIPES
+    Param
+        To get
+
+            my $username : Param;
+
+        add
+
+            __PACKAGE__->config->{bindlex}{Param} => sub { $_[0]->req->params };
+
+AUTHORS
+    Matt S. Trout
+
+    Yuval Kogman
+
+SEE ALSO
+    PadWalker, Array::RefElem, Devel::Caller, Devel::LexAlias,
+    Sub::Parameters
+
+COPYRIGHT & LICENSE
+            Copyright (c) 2005 the aforementioned authors. All rights
+            reserved. This program is free software; you can redistribute
+            it and/or modify it under the same terms as Perl itself.
+

Modified: trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm
===================================================================
--- trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm	2007-04-26 15:28:17 UTC (rev 6307)
+++ trunk/Catalyst-Controller-BindLex/lib/Catalyst/Controller/BindLex.pm	2007-04-26 15:36:06 UTC (rev 6308)
@@ -16,7 +16,7 @@
 use Scalar::Util    ();
 use Carp            ();
 
-our $VERSION = '0.03';
+our $VERSION = '0.04';
 
 sub bindlex_default_config {
     map { ucfirst() . 'ed' => $_, ucfirst() => $_} qw/stash session flash/;
@@ -241,6 +241,16 @@
 
 =back
 
+=head1 METHODS
+
+=head2 bindlex_default_config( )
+
+=head2 MODIFY_ARRAY_ATTRIBUTES( )
+
+=head2 MODIFY_HASH_ATTRIBUTES( )
+
+=head2 MODIFY_SCALAR_ATTRIBUTES( )
+
 =head1 RECIPES
 
 =over 4

Added: trunk/Catalyst-Controller-BindLex/t/02pod.t
===================================================================
--- trunk/Catalyst-Controller-BindLex/t/02pod.t	                        (rev 0)
+++ trunk/Catalyst-Controller-BindLex/t/02pod.t	2007-04-26 15:36:06 UTC (rev 6308)
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod 1.14";
+plan skip_all => 'Test::Pod 1.14 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_files_ok();

Added: trunk/Catalyst-Controller-BindLex/t/03podcoverage.t
===================================================================
--- trunk/Catalyst-Controller-BindLex/t/03podcoverage.t	                        (rev 0)
+++ trunk/Catalyst-Controller-BindLex/t/03podcoverage.t	2007-04-26 15:36:06 UTC (rev 6308)
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_coverage_ok();




More information about the Catalyst-commits mailing list