line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Goo::TrailProfiler; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
# Nigel Hamilton |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2004 |
7
|
|
|
|
|
|
|
# All Rights Reserved |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
10
|
|
|
|
|
|
|
# Filename: GooTrailProfiler.pm |
11
|
|
|
|
|
|
|
# Description: Show a Trail of Things the programmer has been working on |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# Date Change |
14
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
# 12/08/2005 Added method: testingNow |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
############################################################################### |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
3470
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
5
|
use Goo::Object; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
22
|
1
|
|
|
1
|
|
5
|
use Goo::Profile; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
23
|
1
|
|
|
1
|
|
5
|
use Goo::Prompter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
24
|
1
|
|
|
1
|
|
6
|
use Goo::TrailManager; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
388
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our @ISA = ("Goo::Object"); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
############################################################################### |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
# run - show a trail of things |
32
|
|
|
|
|
|
|
# |
33
|
|
|
|
|
|
|
############################################################################### |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub run { |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
1
|
|
my ($this, $thing) = @_; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $profile = Goo::Profile->new($thing); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
while (1) { |
42
|
0
|
|
|
|
|
|
$profile->clear(); |
43
|
0
|
|
|
|
|
|
$profile->show_header("The Zone", "The tail of the Trail", "trail.goo"); |
44
|
0
|
|
|
|
|
|
$profile->add_rendered_table($this->add_trail_table($profile, $thing)); |
45
|
0
|
|
|
|
|
|
$profile->display(); |
46
|
0
|
|
|
|
|
|
$profile->get_command(); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
############################################################################### |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
# add_trail_table - return a table of package that this module uses |
55
|
|
|
|
|
|
|
# |
56
|
|
|
|
|
|
|
############################################################################### |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub add_trail_table { |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
1
|
|
my ($this, $profile, $thing) = @_; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my @actions; |
63
|
|
|
|
|
|
|
|
64
|
0
|
0
|
|
|
|
|
if ($thing->get_filename() eq "tail.trail") { |
65
|
0
|
|
|
|
|
|
@actions = Goo::TrailManager::get_latest_actions(); |
66
|
|
|
|
|
|
|
} else { |
67
|
0
|
|
|
|
|
|
@actions = |
68
|
|
|
|
|
|
|
Goo::TrailManager::get_context($thing->{start_position}, $thing->{end_position}); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# return a list of the most recent Things! |
72
|
0
|
|
|
|
|
|
my $table = Text::FormatTable->new('4l 25l 35l 20l'); |
73
|
0
|
|
|
|
|
|
$table->head('', 'Things', "Action", "When"); |
74
|
0
|
|
|
|
|
|
$table->rule('-'); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
foreach my $action (@actions) { |
77
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
my $index_key = $profile->get_next_index_key(); |
79
|
0
|
|
|
|
|
|
$profile->add_option($index_key, $action->get_thing(), "Goo::ThingProfileOption"); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# show a row in the table |
82
|
0
|
|
|
|
|
|
$table->row("[$index_key]", $action->get_short_thing(), |
83
|
|
|
|
|
|
|
$action->get_action(), $action->get_when()); |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
return Goo::Prompter::highlight_options($table->render()); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 NAME |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Goo::TrailProfiler - Show a Trail of Things the programmer has been working on |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 SYNOPSIS |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
use Goo::TrailProfiler; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 DESCRIPTION |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 METHODS |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=over |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item run |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
show a Trail of Things |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=item add_trail_table |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
return a list of Trail actions and Things |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=back |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 AUTHOR |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 SEE ALSO |
128
|
|
|
|
|
|
|
|