| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Verby::Config::Source; |
|
4
|
1
|
|
|
1
|
|
2715
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.05"; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends qw/Verby::Config::Data/; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Tie::Memoize; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
use Scalar::Util (); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has data => ( |
|
15
|
|
|
|
|
|
|
isa => "HashRef", |
|
16
|
|
|
|
|
|
|
is => "ro", |
|
17
|
|
|
|
|
|
|
lazy => 1, |
|
18
|
|
|
|
|
|
|
default => sub { |
|
19
|
|
|
|
|
|
|
my $self = shift; |
|
20
|
|
|
|
|
|
|
Scalar::Util::weaken($self); # closure leak otherwise |
|
21
|
|
|
|
|
|
|
tie my %data, 'Tie::Memoize', sub { $self->get_key(shift) }; |
|
22
|
|
|
|
|
|
|
return \%data, |
|
23
|
|
|
|
|
|
|
}, |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub get_key { |
|
27
|
|
|
|
|
|
|
die "subclass should extract keys from real config source"; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__PACKAGE__ |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=pod |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Verby::Config::Source - |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use Verby::Config::Source; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 METHODS |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=over 4 |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item B<new> |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item B<get_key> |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=back |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 BUGS |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
None that we are aware of. Of course, if you find a bug, let us know, and we will be sure to fix it. |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 CODE COVERAGE |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
We use B<Devel::Cover> to test the code coverage of the tests, please refer to COVERAGE section of the L<Verby> module for more information. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 AUTHOR |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Yuval Kogman, E<lt>nothingmuch@woobling.orgE<gt> |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Copyright 2005-2008 by Infinity Interactive, Inc. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
L<http://www.iinteractive.com> |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
|
77
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |