line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Goo::Thing::gml::Profiler; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
# Nigel Hamilton |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2005 |
7
|
|
|
|
|
|
|
# All Rights Reserved |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
10
|
|
|
|
|
|
|
# Filename: Goo::Thing::gml::Profiler.pm |
11
|
|
|
|
|
|
|
# Description: Create a synopsis of a gml Thing |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Date Change |
14
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
# 02/07/2005 Version 1 - starting to get momementum in The Goo |
16
|
|
|
|
|
|
|
# 01/08/2005 Broke out ThingFinder into separate module |
17
|
|
|
|
|
|
|
# 06/10/2005 removed chain of inheritance |
18
|
|
|
|
|
|
|
# 06/10/2005 Added method: new |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
############################################################################### |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
2673
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
23
|
1
|
|
|
1
|
|
6
|
use Goo::Object; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
24
|
1
|
|
|
1
|
|
5
|
use Goo::Profile; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
25
|
1
|
|
|
1
|
|
5
|
use base qw(Goo::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
233
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
############################################################################### |
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
# run - return a table of tokens that this template uses |
31
|
|
|
|
|
|
|
# |
32
|
|
|
|
|
|
|
############################################################################### |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub run { |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
1
|
|
my ($this, $thing) = @_; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $profile = Goo::Profile->new($thing); |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
while (1) { |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$profile->clear(); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$profile->show_header("Profile", $thing->get_filename(), $thing->get_location()); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# capture the inside of all tokens in the template |
47
|
0
|
|
|
|
|
|
my @tokens = $thing->get_file() =~ m/\{\{(.*?)\}\}/msg; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# pick out the unique ones |
50
|
0
|
|
|
|
|
|
my %unique_tokens = map { $_ => 1; } @tokens; |
|
0
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
$profile->add_options_table("Tokens", 4, "Goo::TemplateProfileOption", keys(%unique_tokens)); |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
$profile->add_things_table(); |
55
|
0
|
|
|
|
|
|
$profile->display(); |
56
|
0
|
|
|
|
|
|
$profile->get_command(); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 NAME |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Goo::Thing::gml::Profiler - Create a synopsis of a Goo Markup Language (GML) Thing |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SYNOPSIS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
use Goo::Thing::gml::Profiler; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 DESCRIPTION |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 METHODS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=over |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item run |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
return a table of tokens that this template uses |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 SEE ALSO |
94
|
|
|
|
|
|
|
|