| 1 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | package MooseX::Types::HTTPMethod; # git description: v0.001-34-g32e5ee8 | ||
| 4 | # ABSTRACT: Type constraints for HTTP method names | ||
| 5 | # KEYWORDS: moose type constraint HTTP method methods RFC | ||
| 6 | # vim: set ts=8 sts=4 sw=4 tw=115 et : | ||
| 7 | |||
| 8 | 2 | our $VERSION = '0.002'; | |
| 9 | |||
| 10 | 2 | ▶ | use MooseX::Types -declare => [ qw(HTTPMethod10 HTTPMethod11 HTTPMethod) ]; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 2 | ▶ | use MooseX::Types::Moose 'Str'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 2 | ▶ | use if MooseX::Types->VERSION >= 0.42, 'namespace::autoclean'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 2 | my @http10_methods = qw(GET POST HEAD); # RFC 1945 | |
| 15 | 2 | my @http11_methods = ( | |
| 16 | @http10_methods, | ||
| 17 | qw(OPTIONS PUT DELETE TRACE CONNECT), # RFC 2616 | ||
| 18 | ); | ||
| 19 | |||
| 20 | 2 | my @methods = ( | |
| 21 | @http11_methods, | ||
| 22 | qw(PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK), # RFC 2518 | ||
| 23 | qw(VERSION-CONTROL REPORT CHECKOUT CHECKIN UNCHECKOUT MKWORKSPACE | ||
| 24 | UPDATE LABEL MERGE BASELINE-CONTROL MKACTIVITY), # RFC 3253 | ||
| 25 | qw(ORDERPATCH), # RFC 3648 | ||
| 26 | qw(ACL), # RFC 3744 | ||
| 27 | qw(PATCH), # RFC 5789 | ||
| 28 | ); | ||
| 29 | |||
| 30 | 2 | my %http10_methods; @http10_methods{@http10_methods} = () x @http10_methods; | |
| 31 | subtype HTTPMethod10, | ||
| 32 | #as Stringlike, | ||
| 33 | as Str, | ||
| 34 | 7 | ▶ | where { exists $http10_methods{$_} }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 35 | |||
| 36 | 2 | my %http11_methods; @http11_methods{@http11_methods} = () x @http11_methods; | |
| 37 | subtype HTTPMethod11, | ||
| 38 | #as Stringlike, | ||
| 39 | as Str, | ||
| 40 | 9 | ▶ | where { exists $http11_methods{$_} }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 41 | |||
| 42 | 2 | my %methods; @methods{@methods} = () x @methods; | |
| 43 | subtype HTTPMethod, | ||
| 44 | #as Stringlike, | ||
| 45 | as Str, | ||
| 46 | 9 | ▶ | where { exists $methods{$_} }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 47 | |||
| 48 | 2 | 1; | |
| 49 | |||
| 50 | __END__ | ||