X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FIOC%2FContainer.pm;h=cb82f697f33ec7e45bfae1e95c63726cc00adefc;hp=535be3c7bf53a59918551896dc2a95f4eb7bf117;hb=1a5adaee236dda2152a9d0fb1ca27d08f3f92777;hpb=6c6ada816ab56f6f07e2b515ce8073ca4029a64a diff --git a/lib/Catalyst/IOC/Container.pm b/lib/Catalyst/IOC/Container.pm index 535be3c..cb82f69 100644 --- a/lib/Catalyst/IOC/Container.pm +++ b/lib/Catalyst/IOC/Container.pm @@ -74,6 +74,8 @@ sub BUILD { config_local_suffix config_path locate_components + home + root_dir /; my $config = $self->resolve( service => 'config' ); @@ -152,16 +154,21 @@ sub build_home_service { lifecycle => 'Singleton', name => 'home', block => sub { - my $self = shift; + my $self = shift; my $class = $self->param('catalyst_application'); - my $home; if ( my $env = Catalyst::Utils::env_value( $class, 'HOME' ) ) { - $home = $env; + return $env; + } + + if ( my $home = $self->param('home_flag') ) { + return $home; } - $home ||= Catalyst::Utils::home($class); - return $home; + return Catalyst::Utils::home($class); + }, + parameters => { + home_flag => { is => 'ro', isa => 'Str|Undef', required => 0 } }, dependencies => [ depends_on('catalyst_application') ], );