line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::MOP::Module; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2206'; |
3
|
|
|
|
|
|
|
|
4
|
450
|
|
|
450
|
|
210695
|
use strict; |
|
450
|
|
|
|
|
1119
|
|
|
450
|
|
|
|
|
13442
|
|
5
|
450
|
|
|
450
|
|
2455
|
use warnings; |
|
450
|
|
|
|
|
941
|
|
|
450
|
|
|
|
|
11986
|
|
6
|
|
|
|
|
|
|
|
7
|
450
|
|
|
450
|
|
2282
|
use parent 'Class::MOP::Package'; |
|
450
|
|
|
|
|
1048
|
|
|
450
|
|
|
|
|
2651
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _new { |
10
|
1
|
|
|
1
|
|
4
|
my $class = shift; |
11
|
1
|
50
|
|
|
|
11
|
return Class::MOP::Class->initialize($class)->new_object(@_) |
12
|
|
|
|
|
|
|
if $class ne __PACKAGE__; |
13
|
|
|
|
|
|
|
|
14
|
0
|
0
|
|
|
|
0
|
my $params = @_ == 1 ? $_[0] : {@_}; |
15
|
|
|
|
|
|
|
return bless { |
16
|
|
|
|
|
|
|
# Need to quote package to avoid a problem with PPI mis-parsing this |
17
|
|
|
|
|
|
|
# as a package statement. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# from Class::MOP::Package |
20
|
|
|
|
|
|
|
'package' => $params->{package}, |
21
|
0
|
|
|
|
|
0
|
namespace => \undef, |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# attributes |
24
|
|
|
|
|
|
|
version => \undef, |
25
|
|
|
|
|
|
|
authority => \undef |
26
|
|
|
|
|
|
|
} => $class; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub version { |
30
|
12
|
|
|
12
|
|
6284
|
my $self = shift; |
31
|
12
|
|
|
|
|
27
|
${$self->get_or_add_package_symbol('$VERSION')}; |
|
12
|
|
|
|
|
62
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub authority { |
35
|
8
|
|
|
8
|
|
36
|
my $self = shift; |
36
|
8
|
|
|
|
|
13
|
${$self->get_or_add_package_symbol('$AUTHORITY')}; |
|
8
|
|
|
|
|
23
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub identifier { |
40
|
5
|
|
|
5
|
1
|
685
|
my $self = shift; |
41
|
5
|
|
66
|
|
|
38
|
join '-' => ( |
|
|
|
66
|
|
|
|
|
42
|
|
|
|
|
|
|
$self->name, |
43
|
|
|
|
|
|
|
($self->version || ()), |
44
|
|
|
|
|
|
|
($self->authority || ()), |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub create { |
49
|
1514
|
|
|
1514
|
1
|
3984
|
my $class = shift; |
50
|
1514
|
|
|
|
|
4591
|
my @args = @_; |
51
|
|
|
|
|
|
|
|
52
|
1514
|
50
|
|
|
|
6782
|
unshift @args, 'package' if @args % 2 == 1; |
53
|
1514
|
|
|
|
|
4761
|
my %options = @args; |
54
|
|
|
|
|
|
|
|
55
|
1514
|
|
|
|
|
3806
|
my $package = delete $options{package}; |
56
|
1514
|
|
|
|
|
3259
|
my $version = delete $options{version}; |
57
|
1514
|
|
|
|
|
3284
|
my $authority = delete $options{authority}; |
58
|
|
|
|
|
|
|
|
59
|
1514
|
|
|
|
|
8611
|
my $meta = $class->SUPER::create($package => %options); |
60
|
|
|
|
|
|
|
|
61
|
1509
|
|
|
|
|
9235
|
$meta->_instantiate_module($version, $authority); |
62
|
|
|
|
|
|
|
|
63
|
1509
|
|
|
|
|
7679
|
return $meta; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
0
|
|
0
|
sub _anon_package_prefix { 'Class::MOP::Module::__ANON__::SERIAL::' } |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub _anon_cache_key { |
69
|
1
|
|
|
1
|
|
5
|
my $class = shift; |
70
|
1
|
|
|
|
|
5
|
my %options = @_; |
71
|
1
|
|
|
|
|
15
|
$class->_throw_exception( PackagesAndModulesAreNotCachable => class_name => $class, |
72
|
|
|
|
|
|
|
params => \%options, |
73
|
|
|
|
|
|
|
is_module => 1 |
74
|
|
|
|
|
|
|
); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _instantiate_module { |
78
|
1509
|
|
|
1509
|
|
4617
|
my($self, $version, $authority) = @_; |
79
|
1509
|
|
|
|
|
5241
|
my $package_name = $self->name; |
80
|
|
|
|
|
|
|
|
81
|
1509
|
100
|
|
|
|
7505
|
$self->add_package_symbol('$VERSION' => $version) |
82
|
|
|
|
|
|
|
if defined $version; |
83
|
1509
|
100
|
|
|
|
4875
|
$self->add_package_symbol('$AUTHORITY' => $authority) |
84
|
|
|
|
|
|
|
if defined $authority; |
85
|
|
|
|
|
|
|
|
86
|
1509
|
|
|
|
|
18115
|
return; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# ABSTRACT: Module Meta Object |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
__END__ |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=pod |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=encoding UTF-8 |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 NAME |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Class::MOP::Module - Module Meta Object |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 VERSION |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
version 2.2206 |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 DESCRIPTION |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
A module is essentially a L<Class::MOP::Package> with metadata, in our |
110
|
|
|
|
|
|
|
case the version and authority. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 INHERITANCE |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
B<Class::MOP::Module> is a subclass of L<Class::MOP::Package>. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 METHODS |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head2 Class::MOP::Module->create($package, %options) |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Overrides C<create> from L<Class::MOP::Package> to provide these additional |
121
|
|
|
|
|
|
|
options: |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=over 4 |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=item C<version> |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
A version number, to be installed in the C<$VERSION> package global variable. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=item C<authority> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
An authority, to be installed in the C<$AUTHORITY> package global variable. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
This is a legacy field and its use is not recommended. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=back |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head2 $metamodule->version |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
This is a read-only attribute which returns the C<$VERSION> of the |
140
|
|
|
|
|
|
|
package, if one exists. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head2 $metamodule->authority |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
This is a read-only attribute which returns the C<$AUTHORITY> of the |
145
|
|
|
|
|
|
|
package, if one exists. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head2 $metamodule->identifier |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
This constructs a string which combines the name, version and |
150
|
|
|
|
|
|
|
authority. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head2 Class::MOP::Module->meta |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This will return a L<Class::MOP::Class> instance for this class. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 AUTHORS |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=over 4 |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item * |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Stevan Little <stevan@cpan.org> |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item * |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=item * |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
Jesse Luehrs <doy@cpan.org> |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=item * |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Shawn M Moore <sartak@cpan.org> |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=item * |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org> |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item * |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item * |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=item * |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Hans Dieter Pearcey <hdp@cpan.org> |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=item * |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
Chris Prather <chris@prather.org> |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=item * |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Matt S Trout <mstrout@cpan.org> |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=back |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
This software is copyright (c) 2006 by Infinity Interactive, Inc. |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
207
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=cut |