nopaste/Service/sprunge.pm

filter: Statementstmt 33.3% 5 / 15 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 0.0% 0 / 1 totaltotal 27.2% 6 / 22 CC 3 SCAR 22.2
CC
3
Cov
26%
paste
12.0
BEGIN
1.0
CRAP 9.2
« nopaste/Service/debian.pm ↑ Summary nopaste/Service/ubuntu.pm »
1 package Mojolicious::Command::nopaste::Service::sprunge;
2 1 ▶use Mojo::Base 'Mojolicious::Command::nopaste::Service';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 1 has description => "Post to sprunge.us\n";
5  
6 0 ▶sub paste {
Subroutine paste: not called CC=3 SCAR=24.8
Pod undocumented
7 0 my $self = shift;
8  
9 0 my $tx = $self->ua->post(
10 'http://sprunge.us',
11 form => { sprunge => $self->text },
12 );
13  
14 0 ▶ unless ($tx->res->is_success) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($tx->res->is_success) 0 0 0
15 0 say $tx->res->message;
16 0 say $tx->res->body;
17 0 exit 1;
18 }
19  
20 0 chomp( my $url = $tx->res->body );
21  
22 0 ▶ if (my $lang = $self->language) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $lang = $self->language) 0 0 0
23 0 $url .= "?$lang";
24 }
25 0 return $url;
26 }
27  
28 1 1;
29  
« nopaste/Service/debian.pm ↑ Summary nopaste/Service/ubuntu.pm »