Merge branch 'master' into forward_to_instances
John Napiorkowski [Thu, 21 Jul 2022 20:04:39 +0000 (15:04 -0500)]
Makefile.PL
lib/Catalyst/Action.pm
lib/Catalyst/Script/Server.pm

index 1f76be6..f94cd54 100644 (file)
@@ -100,9 +100,8 @@ my %META = (
   },
   resources => {
     repository => {
-      # r/w: catagits@git.shadowcat.co.uk:Catalyst-Runtime.git
-      url => 'git://git.shadowcat.co.uk/catagits/Catalyst-Runtime.git',
-      web => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Runtime.git;a=summary',
+      url => 'https://github.com/perl-catalyst/catalyst-runtime.git',
+      web => 'https://github.com/perl-catalyst/catalyst-runtime',
       type => 'git',
     },
     x_IRC => 'irc://irc.perl.org/#catalyst',
index 36f4793..6fa9d19 100644 (file)
@@ -97,12 +97,23 @@ has number_of_args_constraints => (
         $tc->can('is_strictly_a_type_of') &&
         $tc->is_strictly_a_type_of('Tuple'))
       {
-        my @parameters = @{ $tc->parameters||[]};
-        if( defined($parameters[-1]) and exists($parameters[-1]->{slurpy})) {
-          return undef;
-        } else {
-          return my $total_params = scalar(@parameters);
+        my @parameters = @{ $tc->parameters||[] };
+        my $final = $parameters[-1];
+        if ( defined $final ) {
+          if ( blessed $final ) {
+            # modern form of slurpy
+            if ($final->can('is_strictly_a_type_of') && $final->is_strictly_a_type_of('Slurpy')) {
+              return undef;
+            }
+          }
+          else {
+            # old form of slurpy
+            if (ref $final eq 'HASH' && $final->{slurpy}) {
+              return undef;
+            }
+          }
         }
+        return scalar @parameters;
       } elsif($tc->is_a_type_of('Ref')) {
         return undef;
       } else {
index 6c859b9..2fb80f3 100644 (file)
@@ -44,6 +44,10 @@ has port => (
     documentation => 'Specify a different listening port (to the default port 3000)',
 );
 
+has '+help_flag' => (
+    cmd_aliases => [ qw(usage ?) ],
+);
+
 use Moose::Util::TypeConstraints;
 class_type 'MooseX::Daemonize::Pid::File';
 subtype 'Catalyst::Script::Server::Types::Pidfile',