fixed spelling errors
[catagits/Catalyst-Runtime.git] / lib / Catalyst / ScriptRunner.pm
index de3c8bb..ee2b1c1 100644 (file)
@@ -6,21 +6,18 @@ use File::Spec;
 use namespace::autoclean;
 
 sub run {
-    my ($self, $class, $scriptclass) = @_;
+    my ($self, $class, $scriptclass, %args) = @_;
     my $classtoload = "${class}::Script::$scriptclass";
 
     lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
 
-    warn("load $classtoload or Catalyst::Script::$scriptclass");
-
-    # FIXME - Error handling / reporting
     unless ( eval { Class::MOP::load_class($classtoload) } ) {
         warn("Could not load $classtoload - falling back to Catalyst::Script::$scriptclass : $@\n")
             if $@ !~ /Can't locate/;
         $classtoload = "Catalyst::Script::$scriptclass";
         Class::MOP::load_class($classtoload);
     }
-    $classtoload->new_with_options( application_name => $class )->run;
+    $classtoload->new_with_options( application_name => $class, %args )->run;
 }
 
 __PACKAGE__->meta->make_immutable;
@@ -44,7 +41,7 @@ This class is responsible for running scripts, either in the application specifi
 
 =head2 run ($application_class, $scriptclass)
 
-Called with two parameters, the application classs (e.g. MyApp)
+Called with two parameters, the application class (e.g. MyApp)
 and the script class, (i.e. one of Server/FastCGI/CGI/Create/Test)
 
 =head1 AUTHORS