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.60';
3 37     37   14221 use strict;
  37         39  
  37         751  
4 37     37   98 use warnings;
  37         39  
  37         1049  
5              
6             # ABSTRACT: base class for OS-specific credential methods
7              
8              
9 37     37   15192 use List::MoreUtils qw(uniq);
  37         227591  
  37         161  
10              
11 37     37   15084 use Params::Validate qw(:all);
  37         7000  
  37         4769  
12 37     37   152 use Carp;
  37         34  
  37         7170  
13              
14             our $OS_CLASS;
15              
16             sub import {
17 64     64   1155 my %module = (
18             MSWin32 => 'Windows',
19             darwin => 'MacOSX',
20             );
21              
22 64   50     613 my $module = $ENV{UBIC_CREDENTIALS_OS} || $ENV{UBIC_OS} || $module{$^O} || 'POSIX';
23              
24 64         10375 require "Ubic/Credentials/OS/$module.pm";
25 64         2000 $OS_CLASS = "Ubic::Credentials::OS::$module";
26             }
27              
28              
29             sub new {
30 186     186 1 215 my $class = shift;
31 186 50       1019 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__