File Coverage

lib/Code/Statistics/App/Command/collect.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition n/a
subroutine 5 6 83.3
pod 3 3 100.0
total 23 25 92.0


line stmt bran cond sub pod time code
1 1     1   13130 use strict;
  1         2  
  1         31  
2 1     1   6 use warnings;
  1         2  
  1         62  
3              
4             package Code::Statistics::App::Command::collect;
5             $Code::Statistics::App::Command::collect::VERSION = '1.190680';
6             # ABSTRACT: the shell command handler for stat collection
7              
8 1     1   6 use Code::Statistics::App -command;
  1         1  
  1         10  
9              
10 0     0 1 0 sub abstract { return 'gather measurements on targets and write them to disk' }
11              
12             sub opt_spec {
13 2     2 1 24296 my ( $self ) = @_;
14 2         14 my @opts = (
15             [ 'dirs=s' => 'the directories in which to to search for perl code files' ],
16             [ 'no_dump' => 'prevents writing of measurements to disk' ],
17             [ 'relative_paths' => 'switches file paths in dump from absolute to relative format' ],
18             [ 'foreign_paths=s' => 'file paths in dump are printed in indicated system format; see File::Spec' ],
19             [ 'targets=s' => 'specifies targets that will be looked for inside of files; see C::S::Target::*' ],
20             [ 'metrics=s' => 'specifies metrics that be tried to be measured on targets; see C::S::Metric::*' ],
21             );
22 2         10 return @opts;
23             }
24              
25             sub execute {
26 2     2 1 3333 my ( $self, $opt, $arg ) = @_;
27              
28 2         5 return $self->cstat( %{$opt} )->collect;
  2         24  
29             }
30              
31             1;
32              
33             __END__
34              
35             =pod
36              
37             =encoding UTF-8
38              
39             =head1 NAME
40              
41             Code::Statistics::App::Command::collect - the shell command handler for stat collection
42              
43             =head1 VERSION
44              
45             version 1.190680
46              
47             =head1 AUTHOR
48              
49             Christian Walde <mithaldu@yahoo.de>
50              
51             =head1 COPYRIGHT AND LICENSE
52              
53              
54             Christian Walde has dedicated the work to the Commons by waiving all of his
55             or her rights to the work worldwide under copyright law and all related or
56             neighboring legal rights he or she had in the work, to the extent allowable by
57             law.
58              
59             Works under CC0 do not require attribution. When citing the work, you should
60             not imply endorsement by the author.
61              
62             =cut