From: Sebastian Riedel Date: Sat, 5 Mar 2005 04:23:40 +0000 (+0000) Subject: moved bin to script X-Git-Tag: 5.7099_04~1779 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=91864987dc0e2256fe00b94853ba5b3a18f01ea2 moved bin to script --- diff --git a/Changes b/Changes index 9e43045..6d90849 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ This file documents the revision history for Perl extension Catalyst. +4.20 Thu Mar 04 22:00:00 2005 + - moved bin to script + 4.13 Thu Mar 03 11:00:00 2005 - improved documentation - pod coverage test for helper generated apps diff --git a/Makefile.PL b/Makefile.PL index 2dda1b6..1425cf1 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,7 +3,7 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Catalyst', VERSION_FROM => 'lib/Catalyst.pm', - EXE_FILES => ['bin/catalyst'], + EXE_FILES => ['script/catalyst.pl'], PREREQ_PM => { UNIVERSAL::require => 0, CGI::Simple => 0, diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index c6c3d05..0be104f 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -7,7 +7,7 @@ use Catalyst::Log; __PACKAGE__->mk_classdata($_) for qw/_config log/; -our $VERSION = '4.13'; +our $VERSION = '4.20'; our @ISA; =head1 NAME @@ -17,19 +17,19 @@ Catalyst - The Elegant MVC Web Application Framework =head1 SYNOPSIS # use the helper to start a new application - catalyst MyApp + catalyst.pl MyApp cd MyApp # add models, views, controllers - perl bin/create model Something - perl bin/create view Stuff - perl bin/create controller Yada + bin/create.pl model Something + bin/create.pl view Stuff + bin/create.pl controller Yada # built in testserver - perl bin/server + bin/server.pl # command line interface - perl bin/test /yada + bin/test.pl /yada See also L diff --git a/lib/Catalyst/Helper.pm b/lib/Catalyst/Helper.pm index e86d6d5..203238f 100644 --- a/lib/Catalyst/Helper.pm +++ b/lib/Catalyst/Helper.pm @@ -34,6 +34,8 @@ sub mk_app { $self->_mk_dirs; $self->_mk_appclass; $self->_mk_makefile; + $self->_mk_readme; + $self->_mk_changes; $self->_mk_apptest; $self->_mk_server; $self->_mk_test; @@ -168,8 +170,8 @@ sub next_test { sub _mk_dirs { my $self = shift; $self->mk_dir( $self->{dir} ); - $self->{bin} = File::Spec->catdir( $self->{dir}, 'bin' ); - $self->mk_dir( $self->{bin} ); + $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} ); $self->{root} = File::Spec->catdir( $self->{dir}, 'root' ); @@ -258,6 +260,27 @@ WriteMakefile( EOF } +sub _mk_readme { + my $self = shift; + my $dir = $self->{dir}; + $self->mk_file( "$dir\/README", <<"EOF"); +Run script/server.pl to test the application. +EOF +} + +sub _mk_changes { + my $self = shift; + my $name = $self->{name}; + my $dir = $self->{dir}; + my $time = localtime time; + $self->mk_file( "$dir\/Changes", <<"EOF"); +This file documents the revision history for Perl extension $name. + +0.01 $time + - initial revision, generated by Catalyst +EOF +} + sub _mk_apptest { my $self = shift; my $t = $self->{t}; @@ -280,10 +303,10 @@ EOF } sub _mk_server { - my $self = shift; - my $name = $self->{name}; - my $bin = $self->{bin}; - $self->mk_file( "$bin\/server", <<"EOF"); + my $self = shift; + my $name = $self->{name}; + my $script = $self->{script}; + $self->mk_file( "$script\/server.pl", <<"EOF"); #!/usr/bin/perl -w use strict; @@ -311,7 +334,7 @@ server - Catalyst Testserver =head1 SYNOPSIS -server [options] +server.pl [options] Options: -? -help display this help and exits @@ -338,14 +361,14 @@ the same terms as perl itself. =cut EOF - chmod 0700, "$bin/server"; + chmod 0700, "$script/server.pl"; } sub _mk_test { - my $self = shift; - my $name = $self->{name}; - my $bin = $self->{bin}; - $self->mk_file( "$bin/test", <<"EOF"); + my $self = shift; + my $name = $self->{name}; + my $script = $self->{script}; + $self->mk_file( "$script/test.pl", <<"EOF"); #!/usr/bin/perl -w use strict; @@ -374,14 +397,14 @@ test - Catalyst Test =head1 SYNOPSIS -test [options] uri +test.pl [options] uri Options: -help display this help and exits Examples: - perl test http://localhost/some_action - perl test /some_action + test.pl http://localhost/some_action + test.pl /some_action See also: perldoc Catalyst::Manual @@ -404,14 +427,14 @@ the same terms as perl itself. =cut EOF - chmod 0700, "$bin/test"; + chmod 0700, "$script/test.pl"; } sub _mk_create { - my $self = shift; - my $name = $self->{name}; - my $bin = $self->{bin}; - $self->mk_file( "$bin\/create", <<"EOF"); + my $self = shift; + my $name = $self->{name}; + my $script = $self->{script}; + $self->mk_file( "$script\/create.pl", <<"EOF"); #!/usr/bin/perl -w use strict; @@ -437,19 +460,19 @@ create - Create a new Catalyst Component =head1 SYNOPSIS -create [options] model|view|controller name [helper] [options] +create.pl [options] model|view|controller name [helper] [options] Options: -help display this help and exits Examples: - perl create controller My::Controller - perl create view My::View - perl create view MyView TT - perl create view TT TT - perl create model My::Model - perl create model SomeDB CDBI dbi:SQLite:/tmp/my.db - perl create model AnotherDB CDBI dbi:Pg:dbname=foo root 4321 + create.pl controller My::Controller + create.pl view My::View + create.pl view MyView TT + create.pl view TT TT + create.pl model My::Model + create.pl model SomeDB CDBI dbi:SQLite:/tmp/my.db + create.pl model AnotherDB CDBI dbi:Pg:dbname=foo root 4321 See also: perldoc Catalyst::Manual @@ -472,7 +495,7 @@ the same terms as perl itself. =cut EOF - chmod 0700, "$bin/create"; + chmod 0700, "$script/create.pl"; } sub _mk_compclass { diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index ef60d39..6527af6 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -101,13 +101,13 @@ Here's how to install Catalyst and get a simple application up and running, usin =head3 Setup - $ catalyst My::App + $ catalyst.pl My::App $ cd My-App - $ perl bin/create controller My::Controller + $ script/create.pl controller My::Controller =head3 Run - $ perl bin/server + $ script/server.pl Now visit these locations with your favorite browser or user agent to see Catalyst in action: