From: André Walker Date: Mon, 1 Aug 2011 22:58:32 +0000 (-0300) Subject: overridden WithParameters defaults X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=642eba832e13709cafb0da9b6a1f00216fd45503;hp=9e6091e2f24701da88b4592f4192e6731faa4813;p=catagits%2FCatalyst-Runtime.git overridden WithParameters defaults --- diff --git a/lib/Catalyst/IOC/BlockInjection.pm b/lib/Catalyst/IOC/BlockInjection.pm index 00ed4a5..4453e84 100644 --- a/lib/Catalyst/IOC/BlockInjection.pm +++ b/lib/Catalyst/IOC/BlockInjection.pm @@ -3,7 +3,7 @@ use Moose; extends 'Bread::Board::BlockInjection'; with 'Bread::Board::Service::WithDependencies', - 'Bread::Board::Service::WithParameters', + 'Catalyst::IOC::Service::WithParameters', 'Catalyst::IOC::Service::WithAcceptContext'; __PACKAGE__->meta->make_immutable; diff --git a/lib/Catalyst/IOC/Container.pm b/lib/Catalyst/IOC/Container.pm index dde663a..051f758 100644 --- a/lib/Catalyst/IOC/Container.pm +++ b/lib/Catalyst/IOC/Container.pm @@ -656,12 +656,6 @@ sub add_component { depends_on( '/application_name' ), depends_on( '/config' ), ], - parameters => { - suffix => { - isa => 'Str', - default => Catalyst::Utils::class2classsuffix( $component ), - }, - }, ) ); @@ -671,13 +665,6 @@ sub add_component { dependencies => [ depends_on( "/component/$component_service_name" ), ], - parameters => { - accept_context_args => { - isa => 'ArrayRef|Undef', - required => 0, - default => undef, - }, - }, block => sub { return shift->param($component_service_name) }, ) ); diff --git a/lib/Catalyst/IOC/Service/WithParameters.pm b/lib/Catalyst/IOC/Service/WithParameters.pm new file mode 100644 index 0000000..44c42f9 --- /dev/null +++ b/lib/Catalyst/IOC/Service/WithParameters.pm @@ -0,0 +1,41 @@ +package Catalyst::IOC::Service::WithParameters; +use Moose::Role; + +with 'Bread::Board::Service', + 'Bread::Board::Service::WithParameters'; + +sub _build_parameters { + return { + accept_context_args => { + isa => 'ArrayRef|Undef', + required => 0, + default => undef, + } + }; +} + +no Moose::Role; +1; + +__END__ + +=pod + +=head1 NAME + +Catalyst::IOC::Service::WithParameters + +=head1 DESCRIPTION + +=head1 METHODS + +=head1 AUTHORS + +Catalyst Contributors, see Catalyst.pm + +=head1 COPYRIGHT + +This library is free software. You can redistribute it and/or modify it under +the same terms as Perl itself. + +=cut