From: Marcus Ramberg Date: Sat, 16 Apr 2005 22:45:10 +0000 (+0000) Subject: Added: Automagic AUTHOR in helpers. X-Git-Tag: 5.7099_04~1490 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=ddb46924d609e98c91cbefa351b0de4f5433c97c;hp=e8bf1b2d56f1855a8392c67c164f5eb06e28d2f1 Added: Automagic AUTHOR in helpers. --- diff --git a/Changes b/Changes index a59aabf..2868dd7 100644 --- 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 diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index ee6f6f9..6f0feb2 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -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, L, L, @@ -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