File Coverage

lib/Ubic/Credentials.pm
Criterion Covered Total %
statement 21 28 75.0
branch 1 2 50.0
condition 1 2 50.0
subroutine 7 12 58.3
pod 6 6 100.0
total 36 50 72.0


line stmt bran cond sub pod time code
1             package Ubic::Credentials;
2             $Ubic::Credentials::VERSION = '1.59';
3 38     38   16961 use strict;
  38         44  
  38         904  
4 38     38   134 use warnings;
  38         39  
  38         1308  
5              
6             # ABSTRACT: base class for OS-specific credential methods
7              
8              
9 38     38   17148 use List::MoreUtils qw(uniq);
  38         299007  
  38         242  
10              
11 38     38   17404 use Params::Validate qw(:all);
  38         7101  
  38         6070  
12 38     38   166 use Carp;
  38         52  
  38         8640  
13              
14             our $OS_CLASS;
15              
16             sub import {
17 65     65   797 my %module = (
18             MSWin32 => 'Windows',
19             darwin => 'MacOSX',
20             );
21              
22 65   50     706 my $module = $ENV{UBIC_CREDENTIALS_OS} || $ENV{UBIC_OS} || $module{$^O} || 'POSIX';
23              
24 65         11838 require "Ubic/Credentials/OS/$module.pm";
25 65         2215 $OS_CLASS = "Ubic::Credentials::OS::$module";
26             }
27              
28              
29             sub new {
30 186     186 1 261 my $class = shift;
31 186 50       1114 return $OS_CLASS->new(@_) if $class eq 'Ubic::Credentials';
32 0           croak 'constructor not implemented';
33             }
34              
35             sub set_effective {
36 0     0 1   croak 'not implemented';
37             }
38              
39             sub reset_effective {
40 0     0 1   croak 'not implemented';
41             }
42              
43             sub eq {
44 0     0 1   croak 'not implemented';
45             }
46              
47             sub set {
48 0     0 1   croak 'not implemented';
49             }
50              
51             sub as_string {
52 0     0 1   my $self = shift;
53 0           return "$self"; # ugly default stringification; please override in subclasses
54             }
55              
56              
57             1;
58              
59             __END__