File Coverage

blib/lib/Sentry/DSN.pm
Criterion Covered Total %
statement 36 37 97.3
branch 3 4 75.0
condition 1 3 33.3
subroutine 7 7 100.0
pod 0 1 0.0
total 47 52 90.3


line stmt bran cond sub pod time code
1             use Mojo::Base -base, -signatures;
2 5     5   314919  
  5         42  
  5         33  
3             use Mojo::URL;
4 5     5   4820  
  5         35541  
  5         45  
5             has _url => undef;
6             has protocol => sub ($self) { $self->_url->protocol };
7             has user => sub ($self) { $self->_parse_user($self->_url->userinfo) };
8             has pass => sub ($self) { $self->_parse_pass($self->_url->userinfo) };
9             has host => sub ($self) { $self->_url->host };
10             has port => sub ($self) { $self->_url->port };
11             has path => sub ($self) { $self->_parse_path($self->_url->path) };
12             has project_id => sub ($self) { $self->_parse_project_id($self->_url->path) };
13             has host_port => sub ($self) { $self->_url->host_port };
14              
15             return $url && Sentry::DSN->new(_url => Mojo::URL->new($url));
16 19     19 0 6924 }
  19         32  
  19         32  
  19         29  
17 19   33     133  
18             my @info = split /:/, $auth;
19             return $info[0];
20 9     9   63 }
  9         14  
  9         14  
  9         13  
21 9         53  
22 9         123 my @info = split /:/, $auth;
23             return $info[1];
24             }
25 9     9   47  
  9         13  
  9         13  
  9         14  
26 9         28 if ($path =~ m{\A (.+) / \d+ \z}xms) {
27 9         31 return $1;
28             }
29              
30 2     2   25 return '';
  2         3  
  2         4  
  2         3  
31 2 100       5 }
32 1         409  
33             if ($path =~ m{(\d+) /? \z}xms) {
34             return $1;
35 1         50 }
36              
37             return undef;
38 9     9   122 }
  9         15  
  9         13  
  9         11  
39 9 50       35  
40 9         905 1;