line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SVK::Simple; |
2
|
2
|
|
|
2
|
|
1338
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
83
|
|
3
|
2
|
|
|
2
|
|
1615
|
use Class::Field qw(field); |
|
2
|
|
|
|
|
33434
|
|
|
2
|
|
|
|
|
149
|
|
4
|
2
|
|
|
2
|
|
2219
|
use SVK; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use SVK::XD; |
6
|
|
|
|
|
|
|
use SVK::Util qw(get_anchor catfile catdir); |
7
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
field 'output'; |
10
|
|
|
|
|
|
|
field svk => -init => '$self->_load_svk'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
|
|
|
|
|
|
my $class = shift; |
14
|
|
|
|
|
|
|
my $self = bless {}, $class; |
15
|
|
|
|
|
|
|
return $self->svk; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _load_svk { |
19
|
|
|
|
|
|
|
my $self = shift; |
20
|
|
|
|
|
|
|
$ENV{HOME} ||= catdir(@ENV{qw( HOMEDRIVE HOMEPATH )}); |
21
|
|
|
|
|
|
|
my $svkpath = $ENV{SVKROOT} || catfile($ENV{HOME}, ".svk"); |
22
|
|
|
|
|
|
|
my $xd = SVK::XD->new ( giantlock => "$svkpath/lock", |
23
|
|
|
|
|
|
|
statefile => "$svkpath/config", |
24
|
|
|
|
|
|
|
svkpath => $svkpath, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
$xd->load; |
27
|
|
|
|
|
|
|
if($self->output) { |
28
|
|
|
|
|
|
|
return SVK->new(xd => $xd,output => $self->output); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
return SVK->new(xd => $xd); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |