line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tiffany; |
2
|
3
|
|
|
3
|
|
195286
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
104
|
|
3
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
83
|
|
4
|
3
|
|
|
3
|
|
64
|
use 5.00800; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
900
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub load { |
8
|
1
|
|
|
1
|
1
|
11
|
my ($class, $klass, $args) = @_; |
9
|
1
|
|
|
|
|
5
|
$klass = _load_class($klass, 'Tiffany'); |
10
|
1
|
|
|
|
|
5
|
return $klass->new($args); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# code taken from Plack::Util::load_class. |
14
|
|
|
|
|
|
|
my %loaded; |
15
|
|
|
|
|
|
|
sub _load_class { |
16
|
1
|
|
|
1
|
|
2
|
my ( $class, $prefix ) = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
50
|
|
|
|
3
|
if ($prefix) { |
19
|
1
|
50
|
33
|
|
|
20
|
unless ( $class =~ s/^\+// || $class =~ /^$prefix/ ) { |
20
|
1
|
|
|
|
|
5
|
$class = "$prefix\::$class"; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
5
|
return $class if $loaded{$class}++; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
2
|
my $file = $class; |
27
|
1
|
|
|
|
|
4
|
$file =~ s!::!/!g; |
28
|
1
|
|
|
|
|
1327
|
require "$file.pm"; ## no critic |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
4
|
return $class; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |