line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package InterMine::TypeLibrary; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.9701'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
InterMine::TypeLibrary - a MooseX::Types library |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use InterMine::TypeLibrary qw(Model Join); |
13
|
|
|
|
|
|
|
... |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
This module supplies MooseX::Type types for use by Webservice::InterMine modules |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 AUTHOR |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
FlyMine C<< <support@flymine.org> >> |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 BUGS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<support@flymine.org>. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 SUPPORT |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
perldoc InterMine::TypeLibrary; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
You can also look for information at: |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=over 4 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item * FlyMine |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
L<http://www.flymine.org> |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=back |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Copyright 2010 FlyMine, all rights reserved. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
48
|
|
|
|
|
|
|
under the same terms as Perl itself. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# Declare Our Own Types |
53
|
0
|
|
|
|
|
|
use MooseX::Types -declare => [ |
54
|
|
|
|
|
|
|
qw( |
55
|
|
|
|
|
|
|
File |
56
|
|
|
|
|
|
|
LogHandler |
57
|
|
|
|
|
|
|
DirName PathClassDir |
58
|
|
|
|
|
|
|
) |
59
|
1
|
|
|
1
|
|
26446
|
]; |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
# Import built-in Moose types |
62
|
|
|
|
|
|
|
use MooseX::Types::Moose qw/Str ArrayRef HashRef Undef Maybe Int Value Object/; |
63
|
|
|
|
|
|
|
use Scalar::Util qw(blessed); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
subtype DirName, as Str, where {-d $_}, |
66
|
|
|
|
|
|
|
message {"'$_' should be the name of an existing directory"}; |
67
|
|
|
|
|
|
|
class_type PathClassDir, { class => 'Path::Class::Dir'}; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Type coercions |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
coerce DirName, from PathClassDir, via {$_->stringify}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |