[Catalyst-commits] r9352 - in trunk/Catalyst-Example-InstantCRUD:
lib/Catalyst/Example lib/Catalyst/Example/Controller script t
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Thu Feb 19 21:51:19 GMT 2009
Author: zby
Date: 2009-02-19 21:51:19 +0000 (Thu, 19 Feb 2009)
New Revision: 9352
Modified:
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl
trunk/Catalyst-Example-InstantCRUD/t/00.createapp.t
trunk/Catalyst-Example-InstantCRUD/t/20.create_dvdzbr.t
Log:
name is not an option
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm 2009-02-19 21:21:35 UTC (rev 9351)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm 2009-02-19 21:51:19 UTC (rev 9352)
@@ -9,7 +9,7 @@
use Path::Class;
use Rose::HTMLx::Form::DBIC;
-use version; our $VERSION = qv('0.0.14');
+use version; our $VERSION = qv('0.0.15');
sub auto : Local {
my ( $self, $c ) = @_;
@@ -47,6 +47,7 @@
my ( $self, $c, @pks ) = @_;
if ( $c->req->method eq 'POST' ) {
$self->model_item( $c, @pks )->delete;
+ $c->stash->{template} = lc( $self->source_name ) . '/list.tt';
$c->forward('list');
}
else {
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm 2009-02-19 21:21:35 UTC (rev 9351)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm 2009-02-19 21:51:19 UTC (rev 9352)
@@ -1,6 +1,6 @@
package Catalyst::Example::InstantCRUD;
-use version; $VERSION = qv('0.0.26');
+use version; $VERSION = qv('0.0.27');
use warnings;
use strict;
Modified: trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl 2009-02-19 21:21:35 UTC (rev 9351)
+++ trunk/Catalyst-Example-InstantCRUD/script/instantcrud.pl 2009-02-19 21:51:19 UTC (rev 9352)
@@ -17,6 +17,8 @@
use DBI;
+my $appname = $ARGV[0];
+
my $help = 0;
my $adv_help = 0;
my $nonew = 0;
@@ -26,24 +28,18 @@
my $dsn;
my $duser;
my $dpassword;
-my $appname;
-
my $model_name = 'DBICSchemamodel';
my $schema_name = 'DBSchema';
my %auth;
my %authz;
-
-#exit;
-
GetOptions(
'help|?' => \$help,
'advanced_help' => \$adv_help,
'nonew' => \$nonew,
'scripts' => \$scripts,
'short' => \$short,
- 'name=s' => \$appname,
'dsn=s' => \$dsn,
'user=s' => \$duser,
'password=s'=> \$dpassword,
@@ -223,7 +219,7 @@
=head1 SYNOPSIS
-instantcrud.pl [options]
+instantcrud.pl [options] ApplicationName
Options:
-help display this help and exits
@@ -238,10 +234,13 @@
-model_name model name (default: DBICSchemamodel)
-schema_name schema name (default: DBSchema)
- application-name must be a valid Perl module name and can include "::"
+ ApplicationName must be a valid Perl module name and can include "::";
+ All options are optional, if no dsn is provided an example SQLite database will be
+ created and used.
+
Examples:
- instantcrud.pl -name=My::App -dsn='dbi:Pg:dbname=CE' -user=zby -password='pass'
+ instantcrud.pl -dsn='dbi:Pg:dbname=CE' -user=zby -password='pass' My::App
=head1 OPTIONS
Modified: trunk/Catalyst-Example-InstantCRUD/t/00.createapp.t
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/t/00.createapp.t 2009-02-19 21:21:35 UTC (rev 9351)
+++ trunk/Catalyst-Example-InstantCRUD/t/00.createapp.t 2009-02-19 21:51:19 UTC (rev 9352)
@@ -17,12 +17,12 @@
my $tmpdir = dir(qw/ t tmp/);
my $libdir = dir(dir()->parent->parent, 'lib');
my $instant = file(dir()->parent->parent, 'script', 'instantcrud.pl');
-my $line = "cd $tmpdir; $^X -I$libdir ../../script/instantcrud.pl -name=My::App -dsn='dbi:SQLite:dbname=$testfile' -noauth";
-warn $line;
my $currdir = dir()->absolute;
chdir $tmpdir;
-`$^X -I$libdir ../../script/instantcrud.pl -name=My::App -dsn='dbi:SQLite:dbname=$testfile' -noauth`;
+my $line = "$^X -I$libdir ../../script/instantcrud.pl My::App -dsn='dbi:SQLite:dbname=$testfile' -noauth";
+warn $line;
+`$line`;
chdir $currdir;
ok( -f file(qw/ t tmp My-App lib My App DBSchema.pm/), 'DBSchema creation');
Modified: trunk/Catalyst-Example-InstantCRUD/t/20.create_dvdzbr.t
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/t/20.create_dvdzbr.t 2009-02-19 21:21:35 UTC (rev 9351)
+++ trunk/Catalyst-Example-InstantCRUD/t/20.create_dvdzbr.t 2009-02-19 21:51:19 UTC (rev 9352)
@@ -10,7 +10,7 @@
rmtree( ["t/tmp/$app", "t/tmp/$lcapp.db"] );
-`cd t/tmp; $^X -I../../lib ../../script/instantcrud.pl -name=$app`;
+`cd t/tmp; $^X -I../../lib ../../script/instantcrud.pl $app`;
ok( -f "t/tmp/$app/lib/$app/DBSchema.pm", 'DBSchema creation');
More information about the Catalyst-commits
mailing list