blib/lib/Tail/Tool/Plugin/Ignore.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 95.2% 40 / 42 CC 4 SCAR 8.5
CC
4
Cov
97%
process
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.3
« blib/lib/Tail/Tool/Plugin/Spacing.pm ↑ Summary blib/lib/Tail/Tool/PostProcess.pm »
1 package Tail::Tool::Plugin::Ignore;
2  
3 # Created on: 2010-10-06 14:16:02
4 # Create by: Ivan Wills
5 # $Id$
6 # $Revision$, $HeadURL$, $Date$
7 # $Revision$, $Source$, $Date$
8  
9 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use English qw/ -no_match_vars /;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 extends 'Tail::Tool::PreProcess';
16 2 with 'Tail::Tool::RegexList';
17  
18 2 our $VERSION = version->new('0.4.6');
19  
20 sub process {
21 2 ▶ my ($self, $line) = @_;
Subroutine process: called CC=4 SCAR=13.9
Pod documented
22 2 my $matches;
23  
24 2 for my $match ( @{ $self->regex } ) {
25 2 $matches += $match->enabled;
26 2 my $reg = $match->regex;
27 2 ▶ if ( $match->enabled && $line =~ /$reg/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($match->enabled and $line =~ /$reg/) 1 1 2
Condition66%2/3
$match->enabled and $line =~ /$reg/
!ll&&!rl&&r
011
MC/DC50%1/2
$match->enabled and $line =~ /$reg/
$match->enabled $line =~ /$reg/
Truth table66%2/3
A and B
A= $match->enabledB= $line =~ /$reg/
ABresult
0X0
100
111
28 # return empty as the line is to be ignored
29 1 return ();
30 }
31 }
32  
33 # return empty array if there were enabled matches else return the line
34 1 return ($line);
35 }
36  
37 2 1;
38  
39 __END__
40  
41 =head1 NAME
42  
43 Tail::Tool::Plugin::Ignore - <One-line description of module's purpose>
44  
45 =head1 VERSION
46  
47 This documentation refers to Tail::Tool::Plugin::Ignore version 0.4.6.
48  
49  
50 =head1 SYNOPSIS
51  
52 use Tail::Tool::Plugin::Ignore;
53  
54 # Brief but working code example(s) here showing the most common usage(s)
55 # This section will be as far as many users bother reading, so make it as
56 # educational and exemplary as possible.
57  
58  
59 =head1 DESCRIPTION
60  
61 A full description of the module and its features.
62  
63 May include numerous subsections (i.e., =head2, =head3, etc.).
64  
65  
66 =head1 SUBROUTINES/METHODS
67  
68 =head2 C<process ($line)>
69  
70 Param: C<$line> -The line to process
71  
72 Decides if the line should be displayed.
73  
74 =head1 DIAGNOSTICS
75  
76 A list of every error and warning message that the module can generate (even
77 the ones that will "never happen"), with a full explanation of each problem,
78 one or more likely causes, and any suggested remedies.
79  
80 =head1 CONFIGURATION AND ENVIRONMENT
81  
82 A full explanation of any configuration system(s) used by the module, including
83 the names and locations of any configuration files, and the meaning of any
84 environment variables or properties that can be set. These descriptions must
85 also include details of any configuration language used.
86  
87 =head1 DEPENDENCIES
88  
89 A list of all of the other modules that this module relies upon, including any
90 restrictions on versions, and an indication of whether these required modules
91 are part of the standard Perl distribution, part of the module's distribution,
92 or must be installed separately.
93  
94 =head1 INCOMPATIBILITIES
95  
96 A list of any modules that this module cannot be used in conjunction with.
97 This may be due to name conflicts in the interface, or competition for system
98 or program resources, or due to internal limitations of Perl (for example, many
99 modules that use source code filters are mutually incompatible).
100  
101 =head1 BUGS AND LIMITATIONS
102  
103 A list of known problems with the module, together with some indication of
104 whether they are likely to be fixed in an upcoming release.
105  
106 Also, a list of restrictions on the features the module does provide: data types
107 that cannot be handled, performance issues and the circumstances in which they
108 may arise, practical limitations on the size of data sets, special cases that
109 are not (yet) handled, etc.
110  
111 The initial template usually just has:
112  
113 There are no known bugs in this module.
114  
115 Please report problems to Ivan Wills (ivan.wills@gamil.com).
116  
117 Patches are welcome.
118  
119 =head1 AUTHOR
120  
121 Ivan Wills - (ivan.wills@gamil.com)
122 <Author name(s)> (<contact address>)
123  
124 =head1 LICENSE AND COPYRIGHT
125  
126 Copyright (c) 2010 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW, Australia, 2077).
127 All rights reserved.
128  
129 This module is free software; you can redistribute it and/or modify it under
130 the same terms as Perl itself. See L<perlartistic>. This program is
131 distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
132 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
133 PARTICULAR PURPOSE.
134  
135 =cut
« blib/lib/Tail/Tool/Plugin/Spacing.pm ↑ Summary blib/lib/Tail/Tool/PostProcess.pm »