MooseX/Types/SVN.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 90.0% 18 / 20 CC 1 SCAR 0.6
CC
1
Cov
87%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
↑ Summary SVN/Tree.pm »
1 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package MooseX::Types::SVN;
5 {
6 $MooseX::Types::SVN::DIST = 'SVN-Tree';
7 }
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 our $VERSION = '0.005'; # VERSION
11 1 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 0 ▶use SVN::Core;
Subroutine BEGIN: called CC=1 SCAR=2.6
13 use SVN::Fs;
14 use SVN::Repos;
15 use MooseX::Types -declare => [qw(SvnRoot SvnFs SvnTxn SvnRepos)];
16 ## no critic (Subroutines::ProhibitCallsToUndeclaredSubs)
17 use MooseX::Types::Path::Class 'Dir';
18  
19 class_type SvnRoot, { class => '_p_svn_fs_root_t' };
20 class_type SvnFs, { class => '_p_svn_fs_t' };
21 class_type SvnTxn, { class => '_p_svn_fs_txn_t' };
22 class_type SvnRepos, { class => '_p_svn_repos_t' };
23  
24 coerce SvnRoot,
25 from SvnFs, via { $_->revision_root( $_->youngest_rev ) },
26 from SvnTxn, via { $_->root };
27  
28 coerce SvnFs, from SvnRepos, via { $_->fs };
29 coerce SvnRepos, from Dir, via {
30 ## no critic (Subroutines::ProhibitCallsToUnexportedSubs)
31 my $dir = $_;
32 my $repos;
33 try { $repos = SVN::Repos::open("$dir") }
34 catch {
35 ## no critic (ValuesAndExpressions::ProhibitMagicNumbers)
36 $repos = SVN::Repos::create( "$dir", (undef) x 4 );
37 };
38 return $repos;
39 };
40  
41 1;
42  
43 # ABSTRACT: Moose types for the Subversion Perl bindings
44  
45 __END__
↑ Summary SVN/Tree.pm »