X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FIOC%2FContainer.pm;h=a5c4492eb5a19fea752dbcbca511083e2e68aba2;hb=344858a720ae4deadd0bd67569a8880984690d28;hp=2cbc1cba50afe5df318f0afe6953b3417ef56089;hpb=38957dfeb8be485af571af1cd74e8a4a1fa789e4;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/IOC/Container.pm b/lib/Catalyst/IOC/Container.pm index 2cbc1cb..a5c4492 100644 --- a/lib/Catalyst/IOC/Container.pm +++ b/lib/Catalyst/IOC/Container.pm @@ -1,5 +1,5 @@ package Catalyst::IOC::Container; -use Bread::Board; +use Bread::Board qw/depends_on/; use Moose; use Config::Any; use Data::Visitor::Callback; @@ -41,12 +41,6 @@ has substitutions => ( default => sub { +{} }, ); -has application_name => ( - is => 'ro', - isa => 'Str', - required => 1, -); - has sub_container_class => ( isa => LoadableClass, is => 'ro', @@ -167,20 +161,18 @@ sub build_home_service { } $home ||= Catalyst::Utils::home($class); -# $class->config(home => $home); # FIXME - Needed to make path_to work. return $home; }, dependencies => [ depends_on('application_name') ], ); } -# FIXME: very ambiguous - maybe root_dir? -sub build_root_service { +sub build_root_dir_service { my $self = shift; return Bread::Board::BlockInjection->new( lifecycle => 'Singleton', - name => 'root', + name => 'root_dir', block => sub { my $self = shift; @@ -193,7 +185,7 @@ sub build_root_service { sub build_application_name_service { my $self = shift; - return Bread::Board::Literal->new( name => 'application_name', value => $self->application_name ); + return Bread::Board::Literal->new( name => 'application_name', value => $self->name ); } sub build_driver_service { @@ -766,6 +758,8 @@ sub expand_component_module { return Devel::InnerPackage::list_packages( $module ); } +__PACKAGE__->meta->make_immutable; + 1; __END__