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