LinkEmbedder/Link/Ix.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 21 CC 2 SCAR 13.9
CC
2
Cov
0%
_learn
6.0
force_secure
2.0
BEGIN
2.0
CRAP 4.0
1 package LinkEmbedder::Link::Ix;
2 use Mojo::Base 'LinkEmbedder::Link';
3  
4 sub force_secure {0}
5 has provider_name => 'Ix';
6 has provider_url => sub { Mojo::URL->new('http://ix.io') };
7  
8 sub _learn {
9 my ($self, $tx) = @_;
10  
11 if ($self->url->path =~ m!^/\w+$!) {
12 $self->{paste} = $tx->res->text;
13 $self->{paste} =~ s![\r\n]+$!!i;
14 $self->type('rich');
15 $self->template->[1] = 'paste.html.ep';
16 }
17 else {
18 $self->SUPER::_learn($tx);
19 }
20  
21 return $self;
22 }
23  
24 1;