X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=284f1140e0d9701d23948367d2c53908fb78c755;hp=809d2a4e08b9758d4c323e268b5ebd9b5343e40e;hb=cbb931057eb985308705c7b29aca87600b99ecd4;hpb=3b6a1db18241beccccb477ffd5f3abeaaff35418 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 809d2a4..284f114 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -931,6 +931,7 @@ sub uri_for { my $params = ( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} ); + carp "uri_for called with undef argument" if grep { ! defined $_ } @args; s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @args; unshift(@args, $path); @@ -1353,7 +1354,7 @@ sub finalize { if ($c->debug) { my $elapsed = sprintf '%f', tv_interval($c->stats->getNodeValue); - my $av = sprintf '%.3f', ( $elapsed == 0 ? '??' : ( 1 / $elapsed ) ); + my $av = $elapsed == 0 ? '??' : sprintf '%.3f', 1 / $elapsed; my $t = Text::SimpleTable->new( [ 62, 'Action' ], [ 9, 'Time' ] ); $c->stats->traverse( @@ -1856,8 +1857,11 @@ sub setup_components { search_path => [ map { s/^(?=::)/$class/; $_; } @paths ], %$config ); + + my @comps = sort { length $a <=> length $b } $locator->plugins; + my %comps = map { $_ => 1 } @comps; - for my $component ( sort { length $a <=> length $b } $locator->plugins ) { + for my $component ( @comps ) { Catalyst::Utils::ensure_class_loaded( $component, { ignore_loaded => 1 } ); my $module = $class->setup_component( $component ); @@ -1865,6 +1869,8 @@ sub setup_components { $component => $module, map { $_ => $class->setup_component( $_ ) + } grep { + not exists $comps{$_} } Devel::InnerPackage::list_packages( $component ) ); @@ -2153,9 +2159,7 @@ the plugin name does not begin with C. my ( $proto, $plugin, $instant ) = @_; my $class = ref $proto || $proto; - unless (Class::Inspector->loaded($plugin)) { - require Class::Inspector->filename($plugin); - } + Catalyst::Utils::ensure_class_loaded( $plugin, { ignore_loaded => 1 } ); $proto->_plugins->{$plugin} = 1; unless ($instant) {