Add docs, and don't bother to make components mutable if you can detect packages...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / HTTP / Restarter.pm
index 57ca54a..0fffaf0 100644 (file)
@@ -20,7 +20,9 @@ around run => sub {
         close STDIN;
         close STDOUT;
 
-        $self->_make_components_mutable($class);
+        # Best effort if we can't trap compiles..
+        $self->_make_components_mutable($class)
+            if !Catalyst::Engine::HTTP::Restarter::Watcher::DETECT_PACKAGE_COMPILATION();
 
         my $watcher = Catalyst::Engine::HTTP::Restarter::Watcher->new(
             directory => ( 
@@ -79,7 +81,7 @@ around run => sub {
 sub _make_components_mutable {
     my ($self, $class) = @_;
 
-    my @metas = map { find_meta(@_) } ($class, map { blessed($_) } values %{ $class->components });
+    my @metas = map { find_meta($_) } ($class, map { blessed($_) } values %{ $class->components });
 
     foreach my $meta (@metas) {
         $meta->make_mutable if $meta->is_immutable;