Finger/GPG.pm

filter: Statementstmt 59.2% 16 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 1 totaltotal 55.5% 20 / 36 CC 2 SCAR 9.4
CC
2
Cov
55%
fetch
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 2.6
« Finger.pm ↑ Summary Finger/Source.pm »
1 package PGP::Finger::GPG;
2  
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 extends 'PGP::Finger::Source';
6  
7 # ABSTRACT: gpgfinger source to query local gnupg
8 1 our $VERSION = '1.1'; # VERSION
9  
10 1 ▶use PGP::Finger::Result;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use PGP::Finger::Key;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use IPC::Run qw(run);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 has 'cmd' => ( is => 'ro', isa => 'ArrayRef', lazy => 1,
16 0 ▶ default => sub { [ '/usr/bin/gpg', '--export' ] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
17 1 );
18  
19 0 ▶sub fetch {
Subroutine fetch: not called CC=2 SCAR=17.9
Pod undocumented
20 0 my ( $self, $addr ) = @_;
21 0 my @cmd = ( @{$self->cmd}, $addr );
22 0 my ( $in, $out, $err );
23 0 ▶ run( \@cmd, \$in, \$out, \$err )
Branch: 1 branch
BranchTrueFalseTotal
run(\@cmd, \$in, \$out, \$err) or die 'error running gpg: ' . $err . ' (' . $! . ')' 0 0 0
24 or die('error running gpg: '.$err.' ('.$!.')');
25  
26 0 my $result = PGP::Finger::Result->new;
27 0 my $key = PGP::Finger::Key->new(
28 mail => $addr,
29 data => $out,
30 );
31 0 $key->set_attr( source => 'local GnuPG' );
32  
33 0 $result->add_key( $key );
34 0 return $result;
35 }
36  
37 1 1;
38  
39 __END__
« Finger.pm ↑ Summary Finger/Source.pm »