);
}
+sub build_home_service {
+ my $self = shift;
+
+ return Bread::Board::BlockInjection->new(
+ lifecycle => 'Singleton',
+ name => 'home',
+ block => sub {
+ my $self = shift;
+ my $class = $self->param('application_name');
+
+ if ( my $env = Catalyst::Utils::env_value( $class, 'HOME' ) ) {
+ $home = $env;
+ }
+
+ $home ||= Catalyst::Utils::home($class);
+
+ return $home;
+ },
+ dependencies => [ depends_on('application_name') ],
+ );
+}
+
+# FIXME: very ambiguous - maybe root_dir?
+sub build_root_service {
+ my $self = shift;
+
+ return Bread::Board::BlockInjection->new(
+ lifecycle => 'Singleton',
+ name => 'root',
+ block => sub {
+ my $self = shift;
+
+ return Path::Class::Dir->new( $self->param('home') )->subdir('root');
+ },
+ dependencies => [ depends_on('home') ],
+ );
+}
+
sub build_application_name_service {
my $self = shift;
dependencies => [
depends_on( '/application_name' ),
],
- )
+ ),
);
+ # XXX - FIXME - We have to explicitly build the service here,
+ # causing the COMPONENT method to be called early here, as otherwise
+ # if the component method defines other classes (e.g. the
+ # ACCEPT_CONTEXT injection Model::DBIC::Schema does)
+ # then they won't be found by Devel::InnerPackage
+ # see also t/aggregate/unit_core_component_loading.t
+ $instance_container->get_service($component_service_name)->get;
$accept_context_container->add_service(
Catalyst::IOC::BlockInjection->new(