| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Ubic::Credentials; | 
| 2 |  |  |  |  |  |  | $Ubic::Credentials::VERSION = '1.58_01'; # TRIAL | 
| 3 | 40 |  |  | 40 |  | 19122 | use strict; | 
|  | 40 |  |  |  |  | 56 |  | 
|  | 40 |  |  |  |  | 1294 |  | 
| 4 | 40 |  |  | 40 |  | 191 | use warnings; | 
|  | 40 |  |  |  |  | 67 |  | 
|  | 40 |  |  |  |  | 2202 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | # ABSTRACT: base class for OS-specific credential methods | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 | 40 |  |  | 40 |  | 25578 | use List::MoreUtils qw(uniq); | 
|  | 40 |  |  |  |  | 447322 |  | 
|  | 40 |  |  |  |  | 376 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 | 40 |  |  | 40 |  | 24085 | use Params::Validate qw(:all); | 
|  | 40 |  |  |  |  | 8229 |  | 
|  | 40 |  |  |  |  | 9186 |  | 
| 12 | 40 |  |  | 40 |  | 268 | use Carp; | 
|  | 40 |  |  |  |  | 67 |  | 
|  | 40 |  |  |  |  | 11258 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | our $OS_CLASS; | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | sub import { | 
| 17 | 65 |  |  | 65 |  | 263 | my %module = ( | 
| 18 |  |  |  |  |  |  | MSWin32 => 'Windows', | 
| 19 |  |  |  |  |  |  | darwin  => 'MacOSX', | 
| 20 |  |  |  |  |  |  | ); | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 65 |  | 50 |  |  | 922 | my $module = $ENV{UBIC_CREDENTIALS_OS} || $ENV{UBIC_OS} || $module{$^O} || 'POSIX'; | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 65 |  |  |  |  | 18178 | require "Ubic/Credentials/OS/$module.pm"; | 
| 25 | 65 |  |  |  |  | 3365 | $OS_CLASS = "Ubic::Credentials::OS::$module"; | 
| 26 |  |  |  |  |  |  | } | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | sub new { | 
| 30 | 204 |  |  | 204 | 1 | 330 | my $class = shift; | 
| 31 | 204 | 50 |  |  |  | 1601 | 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__ |