Added: Automagic AUTHOR in helpers.
Marcus Ramberg [Sat, 16 Apr 2005 22:45:10 +0000 (22:45 +0000)]
Changes
lib/Catalyst/Helper.pm

diff --git a/Changes b/Changes
index a59aabf..2868dd7 100644 (file)
--- a/Changes
+++ b/Changes
@@ -7,6 +7,8 @@ This file documents the revision history for Perl extension Catalyst.
         - fixed upload bug with MP19
         - added $c->req->body
         - aliased $c->res->output to $c->res->body
+        - Read AUTHOR from passwd or $ENV{AUTHOR} when 
+          generating code.
 
 5.00  Fri Apr 15 18:00:00 2005
         - new core to support inheritance trees
index ee6f6f9..6f0feb2 100644 (file)
@@ -62,6 +62,8 @@ sub mk_app {
     $self->{dir} =~ s/\:\:/-/g;
     $self->{startperl} = $Config{startperl};
     $self->{scriptgen}=$CATALYST_SCRIPT_GEN;
+    $self->{author}=$self->{author} = $ENV{'AUTHOR'} ||
+                    @{[getpwuid($<)]}[6];
     $self->_mk_dirs;
     $self->_mk_appclass;
     $self->_mk_makefile;
@@ -87,6 +89,8 @@ sub mk_component {
     my $self = shift;
     my $app  = shift;
     $self->{app} = $app;
+    $self->{author}=$self->{author} = $ENV{'AUTHOR'} ||
+                    @{[getpwuid($<)]}[6];
     $self->{base} = File::Spec->catdir( $FindBin::Bin, '..' );
     unless ( $_[0] =~ /^model|m|view|v|controller|c\$/i ) {
         my $helper = shift;
@@ -360,6 +364,11 @@ All helper classes should be under one of the following namespaces.
     Catalyst::Helper::View::
     Catalyst::Helper::Controller::
 
+=head1 NOTE
+
+The helpers will read author name from /etc/passwd by default.
+To override, please export the AUTHOR variable.
+
 =head1 SEE ALSO
 
 L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
@@ -413,7 +422,7 @@ Very nice application.
 
 =head1 AUTHOR
 
-Clever guy
+[%author%]
 
 =head1 LICENSE
 
@@ -749,7 +758,7 @@ Very nice component.
 
 =head1 AUTHOR
 
-Clever guy
+[%author%]
 
 =head1 LICENSE