Actually starting to work
Tomas Doran [Tue, 27 Sep 2011 14:58:58 +0000 (15:58 +0100)]
.gitignore
README
lib/CatalystX/HelpText/ViewRole.pm
t/lib/TestApp/Controller/Root.pm
t/lib/TestApp/root/main [new file with mode: 0644]

index 78344b4..bac73bf 100644 (file)
@@ -1,3 +1,4 @@
+MYMETA.*
 cover_db
 META.yml
 Makefile
diff --git a/README b/README
index e69de29..9af6fc3 100644 (file)
--- a/README
+++ b/README
@@ -0,0 +1,16 @@
+NAME
+    CatalystX::HelpText -
+
+DESCRIPTION
+METHODS
+BUGS
+AUTHOR
+    Cinxgler Mariaca Minda,"cinxgler at ci-info.com"
+
+COPYRIGHT
+    Copyright state51.
+
+LICENSE
+    This sofware is free software, and is licensed under the same terms as
+    perl itself.
+
index d56182d..f06b81b 100644 (file)
@@ -1,13 +1,15 @@
 package CatalystX::HelpText::ViewRole;
 use Moose::Role;
 use Try::Tiny;
+use Moose::Autobox;
+use namespace::autoclean;
 
 requires 'expose_methods';
 
 around expose_methods => sub {
     my ($orig, $self, @args) = @_;
-    my @m = $self->$orig(@args)->flatten;
-    [ @m, 'help_text' ];
+    my $m = $self->$orig(@args) || [];
+    [ $m->flatten, 'help_text' ];
 };
 
 sub help_text {
index 6bbaa52..35e7b14 100644 (file)
@@ -10,8 +10,8 @@ sub base : Chained('/') PathPart('') CaptureArgs(0) {}
 
 # your actions replace this one
 sub main : Chained('base') PathPart('') Args(0) {
-    my ($self, $ctx) = @_;
-    $ctx->res->body('<h1>It works</h1>');
 }
 
+sub end : ActionClass('RenderView') {}
+
 __PACKAGE__->meta->make_immutable;
diff --git a/t/lib/TestApp/root/main b/t/lib/TestApp/root/main
new file mode 100644 (file)
index 0000000..c578551
--- /dev/null
@@ -0,0 +1 @@
+fnar[% helptext('fnoo') %]fnee