5.8000
- Port to Moose
- Added test for action stringify
+ - Added test for component instances getting $self->{value} from config.
5.7013
- Fix subdirs for scripts that run in subdirs more than one level deep.
all_from 'lib/Catalyst/Runtime.pm';
requires 'MooseX::Emulate::Class::Accessor::Fast';
-
+requires 'Moose' => '0.51';
requires 'Carp';
requires 'Class::Accessor::Fast';
requires 'Class::Data::Inheritable';
__PACKAGE__->mk_classdata('_plugins');
__PACKAGE__->mk_classdata('_config');
-around new => sub {
- my ( $orig, $self) = @_;
-
+sub BUILDARGS {
+ my ($self) = @_;
+
# Temporary fix, some components does not pass context to constructor
my $arguments = ( ref( $_[-1] ) eq 'HASH' ) ? $_[-1] : {};
my $args = $self->merge_config_hashes( $self->config, $arguments );
- $self->$orig( $args );
-};
+
+ return $args;
+}
no Moose;
no Moose;
-#We can't immutablize anything that ISA Component just yet
-#__PACKAGE__->meta->make_immutable();
-
=head1 NAME
Catalyst::Model - Catalyst Model base class
use base qw/ Catalyst::Model /;
+__PACKAGE__->config( 'quux' => 'chunkybacon' );
+
sub model_foo_method { 1 }
+sub model_quux_method { shift->{quux} }
+
package TestApp::Model::Foo::Bar;
sub model_foo_bar_method_from_foo { 1 }
-use Test::More tests => 5;
+use Test::More tests => 6;
use strict;
use warnings;
use lib 't/lib';
can_ok($model_foo_bar, 'model_foo_bar_method_from_foo');
can_ok($model_foo_bar, 'model_foo_bar_method_from_foo_bar');
+
+TestApp->setup;
+
+is($model_foo->model_quux_method, 'chunkybacon', 'Model method getting $self->{quux} from config');
+