X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FUtils.pm;h=9cb0eb6db0e265bc685c3c40ccf3f210799f56b7;hb=dd4530ecdc4684838d9c0e9dc00adebb6100b022;hp=847a1c346bf0bab1be37c56317a820cf1a1271ca;hpb=3e5607485bfedb02a06193f653a2f05202db7a4e;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 847a1c3..9cb0eb6 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -13,6 +13,7 @@ use Class::Load (); use namespace::clean; use Devel::InnerPackage; use Moose::Util; +use Ref::Util qw(is_plain_hashref); =head1 NAME @@ -331,8 +332,8 @@ sub merge_hashes { my %merged = %$lefthash; for my $key ( keys %$righthash ) { - my $right_ref = ( ref $righthash->{ $key } || '' ) eq 'HASH'; - my $left_ref = ( ( exists $lefthash->{ $key } && ref $lefthash->{ $key } ) || '' ) eq 'HASH'; + my $right_ref = is_plain_hashref( $righthash->{ $key } ); + my $left_ref = exists $lefthash->{ $key } && is_plain_hashref( $lefthash->{ $key } ); if( $right_ref and $left_ref ) { $merged{ $key } = merge_hashes( $lefthash->{ $key }, $righthash->{ $key } @@ -575,13 +576,10 @@ sub inject_component { my $_setup_component = sub { my $into = shift; my $component_package = shift; - $into->components->{$component_package} = $into->setup_component( $component_package ); + $into->components->{$component_package} = $into->delayed_setup_component( $component_package ); }; $_setup_component->( $into, $component_package ); - # for my $inner_component_package ( Devel::InnerPackage::list_packages( $component_package ) ) { - # $_setup_component->( $into, $inner_component_package ); - # } } =head1 PSGI Helpers