Easy/Roles/Types.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 97.0% 33 / 34 CC 2 SCAR 2.3
CC
2
Cov
96%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Easy.pm ↑ Summary
1 package Net::OAuth::Easy::Roles::Types;
2 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 $Net::OAuth::Easy::Roles::Types::VERSION = '0.001_07';
4 }
5 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use File::Slurp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Data::Validate::URI qw(is_uri);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 require Crypt::OpenSSL::RSA;
10  
11 # ABSTRACT: Role to tuck away types into
12  
13 2 enum 'OAuthProtocol' => qw(1.0 1.0a);
14  
15 2 enum 'RequestMethod' => qw(GET POST);
16  
17 2 enum 'SignatureMethod' => qw(HMAC-SHA1 RSA-SHA1);
18  
19 2 subtype SignatureKey => as 'Crypt::OpenSSL::RSA';
20 coerce SignatureKey =>
21 from Str =>
22 1 ▶ via { my $file = $_[0];
Subroutine __ANON__: called CC=2 SCAR=7.1
23 1 ▶ die sprintf q{%s does not exist as a readable file}, $file
Branch: 1 branch
BranchTrueFalseTotal
unless -r $file 0 1 1
24 unless -r $file;
25 1 Crypt::OpenSSL::RSA->new_private_key( join '', read_file($file) );
26 2 };
27  
28 8 ▶type ValidURI => as Str => where {is_uri($_)};
Subroutine __ANON__: called CC=1 SCAR=0.0
29  
30 2 1;
31  
32 __END__
« Easy.pm ↑ Summary