[Catalyst-commits] r10722 - in trunk/Catalyst-Example-InstantCRUD:
. lib/Catalyst/Example lib/Catalyst/Example/Controller
lib/Catalyst/Example/Controller/InstantCRUD
lib/Catalyst/Helper lib/Catalyst/Helper/Controller
lib/Catalyst/Helper/Model lib/Catalyst/Helper/View
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Mon Jun 29 07:45:58 GMT 2009
Author: zby
Date: 2009-06-29 07:45:58 +0000 (Mon, 29 Jun 2009)
New Revision: 10722
Modified:
trunk/Catalyst-Example-InstantCRUD/Changes
trunk/Catalyst-Example-InstantCRUD/Makefile.PL
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD/REST.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Controller/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Model/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm
Log:
Moosification, removal of version.pm
Modified: trunk/Catalyst-Example-InstantCRUD/Changes
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/Changes 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/Changes 2009-06-29 07:45:58 UTC (rev 10722)
@@ -1,5 +1,7 @@
Revision history for Catalyst-Example-InstantCRUD
+0.033 Mon Jun 29 09:29:37 CEST 2009 Some Moosyfication, no more uses 'version'
+
0.0.32 Sun Jun 28 21:56:24 CEST 2009 HTML::FormHandler based
0.0.30 Sat Feb 28 11:15:15 CET 2009 Better pager
Modified: trunk/Catalyst-Example-InstantCRUD/Makefile.PL
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/Makefile.PL 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/Makefile.PL 2009-06-29 07:45:58 UTC (rev 10722)
@@ -9,7 +9,7 @@
ABSTRACT_FROM => 'lib/Catalyst/Example/InstantCRUD.pm',
PL_FILES => {},
PREREQ_PM => {
- 'Catalyst::Runtime' => '5.7000',
+ 'Catalyst::Runtime' => '5.8000',
'Catalyst::Devel' => '1.00',
'Catalyst::View::TT' => '0.21',
'DBIx::Class' => '0.08003',
@@ -31,7 +31,6 @@
'HTML::FormHandler::Generator::DBIC' => 0.02,
'HTML::FormHandler' => 0.26,
'Path::Class' => 0,
-# 'version' => 0,
# 'URI::Escape' => 0,
'File::Slurp' => 0,
'Pod::Usage' => 0,
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD/REST.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD/REST.pm 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD/REST.pm 2009-06-29 07:45:58 UTC (rev 10722)
@@ -1,22 +1,22 @@
-use strict;
-use warnings;
-
package Catalyst::Example::Controller::InstantCRUD::REST;
-use base qw/ Catalyst::Example::Controller::InstantCRUD /;
-use Class::C3;
-
-sub create_action {
- my $self = shift;
-
- return $self->maybe::next::method(@_);
+use Moose;
+BEGIN {
+ extends 'Catalyst::Example::Controller::InstantCRUD';
}
use Carp;
use Data::Dumper;
-use version; our $VERSION = qv('0.0.1');
+our $VERSION = '002';
+sub model_pks {
+ my ( $self, $c ) = @_;
+ my $rs = $self->model_resultset($c);
+ my @pks = $rs->result_source->primary_columns;
+ return @pks;
+}
+
sub create_form : Local {
my ( $self, $c, @pks ) = @_;
$self->edit( $c, @pks );
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm 2009-06-29 07:45:58 UTC (rev 10722)
@@ -1,29 +1,29 @@
-use strict;
-use warnings;
-
package Catalyst::Example::Controller::InstantCRUD;
-use base 'Catalyst::Controller';
+use Moose;
+BEGIN {
+ extends 'Catalyst::Controller';
+}
use Carp;
use Data::Dumper;
use Path::Class;
-#use Rose::HTMLx::Form::DBIC;
-use version; our $VERSION = qv('0.0.15');
+our $VERSION = '0.016';
-sub auto : Local {
- my ( $self, $c ) = @_;
- $c->stash->{additional_template_paths} = [ dir( $c->config->{root}, lc $self->source_name) . '', $c->config->{root} . ''];
-}
-
-sub source_name {
+has source_name => ( isa => 'Str', is => 'rw', lazy => 1, builder => 'build_source_name' );
+sub build_source_name {
my $self = shift;
my $class = ref $self;
$class =~ /([^:]*)$/;
return $1;
}
+sub auto : Local {
+ my ( $self, $c ) = @_;
+ $c->stash->{additional_template_paths} = [ dir( $c->config->{root}, lc $self->source_name) . '', $c->config->{root} . ''];
+}
+
sub model_item {
my ( $self, $c, @pks ) = @_;
my $rs = $self->model_resultset($c);
@@ -31,18 +31,10 @@
return $item;
}
-sub model_pks {
- my ( $self, $c ) = @_;
- my $rs = $self->model_resultset($c);
- my @pks = $rs->result_source->primary_columns;
- return @pks;
-}
-
sub model_resultset {
my ( $self, $c ) = @_;
- my $model_name = $c->config->{InstantCRUD}{model_name};
my $source = $self->source_name;
- return $c->model($model_name)->resultset($source);
+ return $self->model_schema($c)->resultset($source);
}
sub model_schema {
@@ -206,9 +198,6 @@
=item model_item
Returns an item from the model.
-=item model_pks
-Returns columns comprising the primary key.
-
=item source_name
Class method for finding name of corresponding database table.
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm 2009-06-29 07:45:58 UTC (rev 10722)
@@ -1,6 +1,6 @@
package Catalyst::Example::InstantCRUD;
-use version; $VERSION = qv('0.0.32');
+$VERSION = '0.033';
use warnings;
use strict;
@@ -19,7 +19,7 @@
=head1 VERSION
-This document describes Catalyst::Example::InstantCRUD version 0.0.30
+This document describes Catalyst::Example::InstantCRUD version 0.033
=head1 SYNOPSIS
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Controller/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Controller/InstantCRUD.pm 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Controller/InstantCRUD.pm 2009-06-29 07:45:58 UTC (rev 10722)
@@ -1,6 +1,6 @@
package Catalyst::Helper::Controller::InstantCRUD;
-use version; $VERSION = qv('0.0.8');
+our $VERSION = '0.0.8';
use warnings;
use strict;
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/InstantCRUD.pm 2009-06-29 07:45:58 UTC (rev 10722)
@@ -2,7 +2,7 @@
use base Catalyst::Helper;
use Path::Class;
-use version; $VERSION = qv('0.0.7');
+our $VERSION = '0.0.8';
use warnings;
use strict;
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Model/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Model/InstantCRUD.pm 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/Model/InstantCRUD.pm 2009-06-29 07:45:58 UTC (rev 10722)
@@ -1,6 +1,6 @@
package Catalyst::Helper::Model::InstantCRUD;
-use version; $VERSION = qv('0.0.2');
+our $VERSION = '0.03';
use warnings;
use strict;
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm 2009-06-29 07:45:43 UTC (rev 10721)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Helper/View/InstantCRUD.pm 2009-06-29 07:45:58 UTC (rev 10722)
@@ -1,6 +1,6 @@
package Catalyst::Helper::View::InstantCRUD;
-use version; $VERSION = qv('0.0.7');
+our $VERSION = '0.08';
use warnings;
use strict;
More information about the Catalyst-commits
mailing list