From: André Walker Date: Thu, 28 Jul 2011 18:26:11 +0000 (-0300) Subject: required container name, small other fixes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dca40344fa6ddcb00a4a1261cb65330f7e08f4bd;hp=5b47e4a998d407fd5c127efc82ccd967c91bbe69;p=catagits%2FCatalyst-Runtime.git required container name, small other fixes --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index ad7b4cd..6df1fd8 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2290,7 +2290,7 @@ sub setup_config { my $container_class = Class::MOP::load_first_existing_class(@container_classes); - my $container = $container_class->new( %args, application_name => "$class" ); + my $container = $container_class->new( %args, application_name => "$class", name => "$class" ); $class->container($container); my $config = $container->resolve(service => 'config'); diff --git a/lib/Catalyst/IOC/Container.pm b/lib/Catalyst/IOC/Container.pm index 1deff61..6a1b489 100644 --- a/lib/Catalyst/IOC/Container.pm +++ b/lib/Catalyst/IOC/Container.pm @@ -167,9 +167,9 @@ sub build_prefix_service { lifecycle => 'Singleton', name => 'prefix', block => sub { - return Catalyst::Utils::appprefix( shift->param('name') ); + return Catalyst::Utils::appprefix( shift->param('application_name') ); }, - dependencies => [ depends_on('name') ], + dependencies => [ depends_on('application_name') ], ); } @@ -182,7 +182,7 @@ sub build_path_service { block => sub { my $s = shift; - return Catalyst::Utils::env_value( $s->param('name'), 'CONFIG' ) + return Catalyst::Utils::env_value( $s->param('application_name'), 'CONFIG' ) || $s->param('file') || $s->param('application_name')->path_to( $s->param('prefix') ); }, @@ -398,7 +398,7 @@ sub build_locate_components_service { # XXX think about ditching this sort entirely my @comps = sort { length $a <=> length $b } $locator->plugins; - return @comps; + return \@comps; }, dependencies => [ depends_on('application_name'), depends_on('config') ], ); @@ -656,7 +656,7 @@ sub expand_component_module { sub setup_components { my ( $self, $class ) = @_; - my @comps = $self->resolve( service => 'locate_components' ); + my @comps = @{ $self->resolve( service => 'locate_components' ) }; my %comps = map { $_ => 1 } @comps; my $deprecatedcatalyst_component_names = 0;