Tis file documents the revision history for Perl extension Catalyst.
5.50
+ - Added -scripts option to catalyst.pl for script updating
- Changed helpers to default to long types, Controller instead of C
- Added Catalyst::Controller, Catalyst::Model and Catalyst::View
base classes
$self->{name} = $name;
$self->{dir} = $name;
$self->{dir} =~ s/\:\:/-/g;
+ $self->{script} = File::Spec->catdir( $self->{dir}, 'script' );
$self->{appprefix} = Catalyst::Utils::appprefix($name);
$self->{startperl} = $Config{startperl};
$self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
$self->{author} = $self->{author} = $ENV{'AUTHOR'}
|| eval { @{ [ getpwuid($<) ] }[6] }
|| 'Catalyst developer';
- $self->_mk_dirs;
- $self->_mk_appclass;
- $self->_mk_build;
- $self->_mk_makefile;
- $self->_mk_readme;
- $self->_mk_changes;
- $self->_mk_apptest;
+
+ unless ( $self->{scripts} ) {
+ $self->_mk_dirs;
+ $self->_mk_appclass;
+ $self->_mk_build;
+ $self->_mk_makefile;
+ $self->_mk_readme;
+ $self->_mk_changes;
+ $self->_mk_apptest;
+ $self->_mk_images;
+ $self->_mk_favicon;
+ }
$self->_mk_cgi;
$self->_mk_fastcgi;
$self->_mk_server;
$self->_mk_test;
$self->_mk_create;
- $self->_mk_images;
- $self->_mk_favicon;
return 1;
}
my ( $self, $file, $content ) = @_;
if ( -e $file ) {
print qq/ exists "$file"\n/;
- return 0 unless $self->{'.newfiles'};
- if ( my $f = IO::File->new("< $file") ) {
- my $oldcontent = join( '', (<$f>) );
- return 0 if $content eq $oldcontent;
+ return 0 unless ( $self->{'.newfiles'} || $self->{scripts} );
+ if ( $self->{'.newfiles'} ) {
+ if ( my $f = IO::File->new("< $file") ) {
+ my $oldcontent = join( '', (<$f>) );
+ return 0 if $content eq $oldcontent;
+ }
+ $file .= '.new';
}
- $file .= '.new';
}
if ( my $f = IO::File->new("> $file") ) {
binmode $f;
sub _mk_dirs {
my $self = shift;
$self->mk_dir( $self->{dir} );
- $self->{script} = File::Spec->catdir( $self->{dir}, 'script' );
$self->mk_dir( $self->{script} );
$self->{lib} = File::Spec->catdir( $self->{dir}, 'lib' );
$self->mk_dir( $self->{lib} );
use Pod::Usage;
use Catalyst::Helper;
-my $help = 0;
-my $nonew = 0;
-my $short = 0;
+my $help = 0;
+my $nonew = 0;
+my $scripts = 0;
+my $short = 0;
GetOptions(
- 'help|?' => \$help,
- 'nonew' => \$nonew,
- 'short' => \$short
+ 'help|?' => \$help,
+ 'nonew' => \$nonew,
+ 'scripts' => \$scripts,
+ 'short' => \$short
);
pod2usage(1) if ( $help || !$ARGV[0] );
my $helper =
- Catalyst::Helper->new( { '.newfiles' => !$nonew, 'short' => $short } );
+ Catalyst::Helper->new(
+ { '.newfiles' => !$nonew, 'scripts' => $scripts, 'short' => $short } );
pod2usage(1) unless $helper->mk_app( $ARGV[0] );
1;
catalyst.pl [options] application-name
Options:
- -help display this help and exits
- -nonew don't create a .new file where a file to be created exists
- -short use short types, like C instead of Controller...
+ -help display this help and exits
+ -nonew don't create a .new file where a file to be created exists
+ -scripts update helper scripts only
+ -short use short types, like C instead of Controller...
application-name must be a valid Perl module name and can include "::"