line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::Types::Wrapper; |
2
|
|
|
|
|
|
|
# ABSTRACT: Wrap exports from a library |
3
|
|
|
|
|
|
|
$MooseX::Types::Wrapper::VERSION = '0.45'; |
4
|
1
|
|
|
1
|
|
784197
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
8406
|
use Carp::Clan qw( ^MooseX::Types ); |
|
1
|
|
|
|
|
1963
|
|
|
1
|
|
|
|
|
9
|
|
6
|
1
|
|
|
1
|
|
160
|
use Module::Runtime 'use_module'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
1810
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1547
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'MooseX::Types'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
13
|
|
|
|
|
|
|
#pod |
14
|
|
|
|
|
|
|
#pod See L<MooseX::Types/SYNOPSIS> for detailed usage. |
15
|
|
|
|
|
|
|
#pod |
16
|
|
|
|
|
|
|
#pod =head1 METHODS |
17
|
|
|
|
|
|
|
#pod |
18
|
|
|
|
|
|
|
#pod =head2 import |
19
|
|
|
|
|
|
|
#pod |
20
|
|
|
|
|
|
|
#pod =cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub import { |
23
|
1
|
|
|
1
|
|
2202
|
my ($class, @args) = @_; |
24
|
1
|
50
|
|
|
|
7
|
my %libraries = @args == 1 ? (Moose => $args[0]) : @args; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
5
|
for my $l (keys %libraries) { |
27
|
|
|
|
|
|
|
|
28
|
2
|
50
|
|
|
|
299
|
croak qq($class expects an array reference as import spec) |
29
|
|
|
|
|
|
|
unless ref $libraries{ $l } eq 'ARRAY'; |
30
|
|
|
|
|
|
|
|
31
|
2
|
100
|
|
|
|
7
|
my $library_class |
32
|
|
|
|
|
|
|
= ($l eq 'Moose' ? 'MooseX::Types::Moose' : $l ); |
33
|
2
|
|
|
|
|
24
|
use_module($library_class); |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
20
|
$library_class->import({ |
36
|
|
|
|
|
|
|
-into => scalar(caller), |
37
|
|
|
|
|
|
|
-wrapper => $class, |
38
|
2
|
|
|
|
|
1333
|
}, @{ $libraries{ $l } }); |
39
|
|
|
|
|
|
|
} |
40
|
1
|
|
|
|
|
4007
|
return 1; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=pod |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=encoding UTF-8 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
MooseX::Types::Wrapper - Wrap exports from a library |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 VERSION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
version 0.45 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 DESCRIPTION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
See L<MooseX::Types/SYNOPSIS> for detailed usage. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 METHODS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 import |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SEE ALSO |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
L<MooseX::Types> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHOR |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Robert "phaylon" Sedlacek <rs@474.at> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This software is copyright (c) 2007 by Robert "phaylon" Sedlacek. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
80
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |