line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UR::Namespace::Command::Test::Callcount::List; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3
|
use UR; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
our $VERSION = "0.46"; # UR $VERSION; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Transient class that represents the file as a datasource |
10
|
|
|
|
|
|
|
our $TheFile = '/dev/null'; # This will be filled in during create() below |
11
|
|
|
|
|
|
|
UR::DataSource::FileMux->create( |
12
|
|
|
|
|
|
|
id => 'Test::Callcount::List::DataSource', |
13
|
|
|
|
|
|
|
column_order => ['count','subname','subloc','callers'], |
14
|
|
|
|
|
|
|
delimiter => "\t", |
15
|
|
|
|
|
|
|
file_resolver => sub { return $TheFile }, |
16
|
|
|
|
|
|
|
required_for_get => [], |
17
|
|
|
|
|
|
|
constant_values => [], |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#class Test::Callcount::List::DataSource { |
21
|
|
|
|
|
|
|
# is => 'UR::DataSource::File', |
22
|
|
|
|
|
|
|
# column_order => ['count','subname','subloc','callers'], |
23
|
|
|
|
|
|
|
# delimiter => "\t", |
24
|
|
|
|
|
|
|
#}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Transient class that represents the data in the callcount files |
27
|
|
|
|
|
|
|
class Test::Callcount::List::Items { |
28
|
|
|
|
|
|
|
id_by => 'subname', |
29
|
|
|
|
|
|
|
has => [ |
30
|
|
|
|
|
|
|
count => { is => 'Integer' }, |
31
|
|
|
|
|
|
|
subname => { is => 'String' }, |
32
|
|
|
|
|
|
|
subloc => { is => 'String' }, |
33
|
|
|
|
|
|
|
callers => { is => 'String' }, |
34
|
|
|
|
|
|
|
], |
35
|
|
|
|
|
|
|
data_source => 'Test::Callcount::List::DataSource', |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Class for this command |
39
|
|
|
|
|
|
|
class UR::Namespace::Command::Test::Callcount::List { |
40
|
|
|
|
|
|
|
is => 'UR::Object::Command::List', |
41
|
|
|
|
|
|
|
has => [ |
42
|
|
|
|
|
|
|
file => { is => 'String', doc => 'Specify the .callcount file', default_value => '/dev/null' }, |
43
|
|
|
|
|
|
|
subject_class_name => { is_constant => 1, value => 'Test::Callcount::List::Items' }, |
44
|
|
|
|
|
|
|
show => { default_value => 'count,subname,subloc,callers' }, |
45
|
|
|
|
|
|
|
# filter => { default_value => '' }, |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
], |
48
|
|
|
|
|
|
|
doc => 'Filter and list Callcount items', |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _resolve_boolexpr { |
53
|
0
|
|
|
0
|
|
|
my $self = shift; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my $filename = $self->file; |
56
|
0
|
0
|
|
|
|
|
unless (-r $filename ) { |
57
|
0
|
|
|
|
|
|
$self->error_message("File $filename does not exist or is not readable"); |
58
|
0
|
|
|
|
|
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
0
|
|
|
|
|
|
$TheFile = $filename; |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
$self->SUPER::_resolve_boolexpr(@_); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |