« lib/Gitalist/Git/CollectionOfRepositories/FromDirectory.pm
↑ Summary
lib/Gitalist/Git/CollectionOfRepositories/Vhost.pm »
| 1 | package Gitalist::Git::Types; | ||||||||||
| 2 | |||||||||||
| 3 | use MooseX::Types | ||||||||||
| 4 | 8 | ▶ | -declare => [qw/ | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | Dir | ||||||||||
| 6 | ArrayRefOfDirs | ||||||||||
| 7 | DirOrUndef | ||||||||||
| 8 | 8 | /]; | |||||||||
| 9 | |||||||||||
| 10 | 8 | ▶ | use MooseX::Types::Path::Class; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 8 | ▶ | use MooseX::Types::DateTime qw/ DateTime /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 8 | ▶ | use MooseX::Storage::Engine (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 8 | ▶ | use MooseX::Types::Common::String qw/NonEmptySimpleStr/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 8 | ▶ | use MooseX::Types::Moose qw/ ArrayRef Undef Str /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 8 | ▶ | use Path::Class qw/ dir /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | MooseX::Storage::Engine->add_custom_type_handler( | ||||||||||
| 18 | DateTime, | ||||||||||
| 19 | 0 | ▶ | expand => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | 0 | my $val = shift; | |||||||||
| 21 | 0 | Carp::confess("Not implemented"); | |||||||||
| 22 | }, | ||||||||||
| 23 | 0 | ▶ | collapse => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 24 | 0 | $_[0]->ymd('-') . 'T' . $_[0]->hms(':') . 'Z' | |||||||||
| 25 | }, | ||||||||||
| 26 | 8 | ); | |||||||||
| 27 | |||||||||||
| 28 | subtype Dir, | ||||||||||
| 29 | as 'MooseX::Types::Path::Class::Dir', | ||||||||||
| 30 | 23 | ▶ | where { 1 }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 31 | |||||||||||
| 32 | 11 | ▶ | subtype ArrayRefOfDirs, as ArrayRef[Dir], where { scalar(@$_) >= 1 }, message { "Cannot find repository dir" }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 33 | 2 | ▶ | coerce ArrayRefOfDirs, from NonEmptySimpleStr, via { [ dir($_)->resolve ] }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 34 | 6 | ▶ | coerce ArrayRefOfDirs, from ArrayRef[NonEmptySimpleStr], via { [ map { dir($_)->resolve } @$_ ] }; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 35 | |||||||||||
| 36 | 8 | subtype DirOrUndef, as Dir | Undef; | |||||||||
| 37 | 0 | ▶ | coerce DirOrUndef, from Str, via { if ($_) { dir($_) } else { undef }}; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||
| 38 | |||||||||||
| 39 | MooseX::Storage::Engine->add_custom_type_handler( | ||||||||||
| 40 | Dir, | ||||||||||
| 41 | 0 | ▶ | expand => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 42 | 0 | my $val = shift; | |||||||||
| 43 | 0 | Carp::confess("Not implemented"); | |||||||||
| 44 | }, | ||||||||||
| 45 | 0 | ▶ | collapse => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 46 | 0 | shift() . ''; | |||||||||
| 47 | }, | ||||||||||
| 48 | 8 | ); | |||||||||
| 49 | |||||||||||
| 50 | 8 | 1; | |||||||||