PAUSE/Plugin/URL.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 39 / 39 CC 2 SCAR 2.5
CC
2
Cov
100%
_parse
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« PAUSE/Plugin/UploadedFile.pm ↑ Summary PAUSE/Plugin.pm »
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  
4 package Parse::PAUSE::Plugin::URL;
5 2 our $VERSION = '1.001';
6  
7  
8 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 has '_regexp' => (
11 is => 'ro',
12 isa => 'RegexpRef',
13 2 ▶ default => sub {qr{
Subroutine __ANON__: called CC=1 SCAR=0.0
14 ^ The \s URL \r\n
15 ^ \r\n
16 ^ \s{4} (.+) \r\n
17 ^ \r\n
18 ^ has \s entered \s CPAN \s as \r\n
19 ^ \r\n
20 ^ \s{2} file: \s (.+) \r\n
21 ^ \s{2} size: \s (\d+) \s bytes \r\n
22 ^ \s{3} md5: \s (.+) \r\n
23 ^ \r\n
24 ^ No \s action \s is \s required \s on \s your \s part \r\n
25 ^ Request \s entered \s by: \s (.+) \r\n
26 ^ Request \s entered \s on: \s (.+) \r\n
27 ^ Request \s completed: \s{2} (.+) \r\n
28 ^ \r\n^ Thanks, \r\n
29 ^ -- \s \r\n
30 ^ paused, \s v (\d+) \r\n
31 }xms},
32 2 );
33  
34 2 with 'Parse::PAUSE::Plugin';
35  
36 2 ▶sub _parse {
Subroutine _parse: called CC=2 SCAR=6.9
37 2 my ($self, $body) = @_;
38 2 my $regexp = $self->_regexp();
39  
40 2 ▶ if (my (
Branch: 1 branch
BranchTrueFalseTotal
if (() = $body =~ /$regexp/msx) { } 1 1 2
41 $upload, $pathname, $size, $md5, $entered_by, $entered_on,
42 $set_completed, $set_paused_version,
43 ) = $body =~ m{$regexp}xms) {
44 1 $self->_set_upload($upload);
45 1 $self->_set_pathname($pathname);
46 1 $self->_set_size($size);
47 1 $self->_set_md5($md5);
48 1 $self->_set_entered_by($entered_by);
49 1 $self->_set_entered_on($entered_on);
50 1 $self->_set_completed($set_completed);
51 1 $self->_set_paused_version($set_paused_version);
52  
53 1 return $self;
54 }
55 else {
56 1 return;
57 }
58 }
59  
60 2 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
61  
62 2 __PACKAGE__->meta->make_immutable;
63  
64 2 1;
« PAUSE/Plugin/UploadedFile.pm ↑ Summary PAUSE/Plugin.pm »