requires 'MooseX::Getopt' => '0.30';
requires 'MooseX::Types';
requires 'MooseX::Types::Common::Numeric';
+requires 'MooseX::Types::LoadableClass';
requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace
- requires 'Plack' => '0.9974'; # IIS6 fix middleware
+ requires 'Plack' => '0.9991'; # IIS6+7 fix middleware
requires 'Plack::Middleware::ReverseProxy' => '0.04';
requires 'Plack::Test::ExternalServer';
$caller->setup_home;
}
+sub MODIFY_CODE_ATTRIBUTES {
+ Catalyst::Exception->throw(
+ "Catalyst applications (aka MyApp) cannot be controllers anymore. " .
+ "That has been deprecated and removed. You should create a " .
+ "controller class called Root.pm, and move relevant code to that class."
+ );
+}
+
+
sub _application { $_[0] }
- =encoding utf8
+ =encoding UTF-8
=head1 NAME
use base qw/Catalyst/;
- __PACKAGE__->components( { map { ( ref($_)||$_ , $_ ) } @complist } );
+ no warnings 'redefine';
- my $thingie={};
- bless $thingie, 'Some::Test::Object';
- __PACKAGE__->components->{'MyMVCTestApp::Model::Test::Object'} = $thingie;
+ local *Catalyst::IOC::Container::build_locate_components_service = sub {
+ my $self = shift;
- # allow $c->log->warn to work
- __PACKAGE__->setup_log;
+ return Bread::Board::BlockInjection->new(
+ lifecycle => 'Singleton',
+ name => 'locate_components',
+ block => sub {
+ return [@complist, 'MyMVCTestApp::Model::Test::Object'];
+
+ },
+ );
+ };
+ local *Catalyst::Log::warn = sub { $warnings++ };
+
+ __PACKAGE__->setup;
}
+ok( $warnings, 'Issues deprecated warnings' );
+is( @{[ MyMVCTestApp->component_list ]}, scalar @complist + 1, 'Loaded all components' );
+
+ {
+ package MyStringThing;
+
+ use overload '""' => sub { $_[0]->{string} }, fallback => 1;
+ }
+
is( MyMVCTestApp->view('View'), 'MyMVCTestApp::V::View', 'V::View ok' );
is( MyMVCTestApp->controller('Controller'),