private actions now have default signature of (@)
Robert 'phaylon' Sedlacek [Sun, 11 Oct 2009 18:08:02 +0000 (20:08 +0200)]
Changes
lib/CatalystX/Declare/Keyword/Action.pm
t/lib/RenderViewTestApp/Controller/Root.pm

diff --git a/Changes b/Changes
index 9b616d4..30a747a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -8,6 +8,7 @@
       sanely (Tomas Doran).
     - fixed M:I requirement handling for authors.
     - controller roles are now applied all at once (Tomas Doran).
+    - private actions now have a default signature of (@).
 
 [0.010] Sun Sep 13 15:52:01 CEST 2009
     - Fix Compat with MooseX::Method::Signatures >=0.22 ( KENTNL )
index 7d3193f..b514666 100644 (file)
@@ -80,6 +80,10 @@ class CatalystX::Declare::Keyword::Action {
 
         my $name   = $attributes{Subname};
 
+        if ($attributes{Private}) {
+            $attributes{Signature} ||= '@';
+        }
+
         my $method = Method->wrap(
             signature       => qq{($attributes{Signature})},
             package_name    => $ctx->get_curstash_name,
@@ -306,6 +310,9 @@ class CatalystX::Declare::Keyword::Action {
 
     method _build_flag_populator (Object $ctx, HashRef $attrs, Str $what) {
 
+        $attrs->{Private} = []
+            if $what eq 'private';
+
         return sub {
             my $method = shift;
 
index 6cf8b87..b8951d9 100644 (file)
@@ -11,5 +11,5 @@ controller RenderViewTestApp::Controller::Root {
         $ctx->stash(current_view => 'Test');
     }
 
-    action end isa RenderView;
+    action end is private isa RenderView;
 }