# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.80003';
+our $VERSION = '5.80005';
{
my $dev_version = $VERSION =~ /_\d{2}$/;
$c->error(0);
}
-# search components given a name and some prefixes
sub _comp_search_prefixes {
+ my $c = shift;
+ return map $c->components->{ $_ }, $c->_comp_names_search_prefixes(@_);
+}
+
+# search components given a name and some prefixes
+sub _comp_names_search_prefixes {
my ( $c, $name, @prefixes ) = @_;
my $appclass = ref $c || $c;
my $filter = "^${appclass}::(" . join( '|', @prefixes ) . ')::';
my $query = ref $name ? $name : qr/^$name$/i;
my @result = grep { $eligible{$_} =~ m{$query} } keys %eligible;
- return map { $c->components->{ $_ } } @result if @result;
+ return @result if @result;
# if we were given a regexp to search against, we're done.
return if ref $name;
# regexp fallback
$query = qr/$name/i;
- @result = map { $c->components->{ $_ } } grep { $eligible{ $_ } =~ m{$query} } keys %eligible;
+ @result = grep { $eligible{ $_ } =~ m{$query} } keys %eligible;
# no results? try against full names
if( !@result ) {
- @result = map { $c->components->{ $_ } } grep { m{$query} } keys %eligible;
+ @result = grep { m{$query} } keys %eligible;
}
# don't warn if we didn't find any results, it just might not exist
my $filter = "^${appclass}::(" . join( '|', @prefixes ) . ')::';
- my @names = map { s{$filter}{}; $_; } $c->_comp_search_prefixes( undef, @prefixes );
+ my @names = map { s{$filter}{}; $_; }
+ $c->_comp_names_search_prefixes( undef, @prefixes );
+
return @names;
}
=head2 $c->path_to(@path)
Merges C<@path> with C<< $c->config->{home} >> and returns a
-L<Path::Class::Dir> object.
+L<Path::Class::Dir> object. Note you can usually use this object as
+a filename, but sometimes you will have to explicitly stringify it
+yourself by calling the C<<->stringify>> method.
For example:
# modifiers work correctly in MyApp (as you have to call setup _before_
# applying modifiers).
B::Hooks::EndOfScope::on_scope_end {
+ return if $@;
my $meta = Class::MOP::get_metaclass_by_name($class);
if ( $meta->is_immutable && ! { $meta->immutable_options }->{inline_constructor} ) {
warn "You made your application class ($class) immutable, "
$c->uri_for($c->action, $c->req->captures);
# For the Foo action in the Bar controller
- $c->uri_for($c->controller->('Bar')->action_for('Foo'), $c->req->captures);
+ $c->uri_for($c->controller('Bar')->action_for('Foo'), $c->req->captures);
=back
( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} );
carp "uri_for called with undef argument" if grep { ! defined $_ } @args;
- s/([^A-Za-z0-9\-_.!~*'()])/$URI::Escape::escapes{$1}/go for @args;
+ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @args;
unshift(@args, $path);
$_ = "$_";
utf8::encode( $_ ) if utf8::is_utf8($_);
# using the URI::Escape pattern here so utf8 chars survive
- s/([^A-Za-z0-9\-_.!~*'()])/$URI::Escape::escapes{$1}/go;
+ s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go;
s/ /+/g;
"${key}=$_"; } ( ref $val eq 'ARRAY' ? @$val : $val ));
} @keys);
$plugins ||= [];
my @plugins = map { s/\A\+// ? $_ : "Catalyst::Plugin::$_" } @$plugins;
-
- Class::MOP::load_class($_) for @plugins;
-
+
for my $plugin ( reverse @plugins ) {
+ Class::MOP::load_class($plugin);
my $meta = find_meta($plugin);
next if $meta && $meta->isa('Moose::Meta::Role');
grep { $_ && blessed($_) && $_->isa('Moose::Meta::Role') }
map { find_meta($_) }
@plugins;
-
+
Moose::Util::apply_all_roles(
$class => @roles
) if @roles;
David E. Wheeler
+dhoss: Devin Austin <dhoss@cpan.org>
+
dkubb: Dan Kubb <dan.kubb-cpan@onautopilot.com>
Drew Taylor
+dwc: Daniel Westermann-Clark <danieltwc@cpan.org>
+
esskar: Sascha Kiefer
fireartist: Carl Franks <cfranks@cpan.org>
=head1 LICENSE
-This library is free software, you can redistribute it and/or modify it under
+This library is free software. You can redistribute it and/or modify it under
the same terms as Perl itself.
=cut