Add conflict line to Makefile.PL for Component::ACCEPT_CONTEXT
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index a994166..b38be49 100644 (file)
@@ -76,7 +76,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.80003';
+our $VERSION = '5.80005';
 
 {
     my $dev_version = $VERSION =~ /_\d{2}$/;
@@ -904,7 +904,9 @@ Returns the engine instance. See L<Catalyst::Engine>.
 =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:
 
@@ -1101,6 +1103,7 @@ EOF
     # 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, "
@@ -1160,7 +1163,7 @@ using C<< $c->req->captures >>.
   $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
 
@@ -2479,9 +2482,6 @@ the plugin name does not begin with C<Catalyst::Plugin::>.
         my ( $proto, $plugin, $instant ) = @_;
         my $class = ref $proto || $proto;
 
-        # no ignore_loaded here, the plugin may already have been
-        # defined in memory and we don't want to error on "no file" if so
-
         Class::MOP::load_class( $plugin );
 
         $proto->_plugins->{$plugin} = 1;
@@ -2502,14 +2502,26 @@ the plugin name does not begin with C<Catalyst::Plugin::>.
 
         $class->_plugins( {} ) unless $class->_plugins;
         $plugins ||= [];
-        for my $plugin ( reverse @$plugins ) {
 
-            unless ( $plugin =~ s/\A\+// ) {
-                $plugin = "Catalyst::Plugin::$plugin";
-            }
+        my @plugins = map { s/\A\+// ? $_ : "Catalyst::Plugin::$_" } @$plugins;
+        
+        for my $plugin ( reverse @plugins ) {
+            Class::MOP::load_class($plugin);
+            my $meta = find_meta($plugin);
+            next if $meta && $meta->isa('Moose::Meta::Role');
 
             $class->_register_plugin($plugin);
         }
+
+        my @roles =
+            map { $_->name }
+            grep { $_ && blessed($_) && $_->isa('Moose::Meta::Role') }
+            map { find_meta($_) }
+            @plugins;
+         
+        Moose::Util::apply_all_roles(
+            $class => @roles
+        ) if @roles;
     }
 }
 
@@ -2701,6 +2713,8 @@ 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>