« blib/lib/Tapper/Reports/Web.pm
↑ Summary
blib/lib/Tapper/Reports/Web/Controller/Tapper/Manual.pm »
| 1 | package Tapper::Reports::Web::Util::Filter::Overview; | ||
| 2 | 14 | our $AUTHORITY = 'cpan:TAPPER'; | |
| 3 | 14 | $Tapper::Reports::Web::Util::Filter::Overview::VERSION = '5.0.17'; | |
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | 14 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 14 | ▶ | use Hash::Merge::Simple 'merge'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 14 | ▶ | use Set::Intersection 'get_intersection'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 14 | ▶ | use Tapper::Model 'model'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 14 | extends 'Tapper::Reports::Web::Util::Filter'; | |
| 15 | |||
| 16 | 0 | ▶ | sub BUILD{ |
|
Subroutine
BUILD: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 17 | 0 | my $self = shift; | |
| 18 | 0 | my $args = shift; | |
| 19 | |||
| 20 | 0 | $self->dispatch( | |
| 21 | merge($self->dispatch, | ||
| 22 | {like => \&like, | ||
| 23 | weeks => \&weeks, | ||
| 24 | hostname => \&hostname, | ||
| 25 | }) | ||
| 26 | ); | ||
| 27 | } | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | sub weeks | ||
| 32 | 0 | ▶ | { |
|
Subroutine
weeks: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 33 | 0 | my ($self, $filter_condition, $duration) = @_; | |
| 34 | |||
| 35 | 0 | my $timeframe = DateTime->now->subtract(weeks => $duration); | |
| 36 | 0 | my $dtf = model("TestrunDB")->storage->datetime_parser; | |
| 37 | 0 | push @{$filter_condition->{late}}, {'reports.created_at' => {'>=' => $dtf->format_datetime($timeframe) }}; | |
| 38 | 0 | return $filter_condition; | |
| 39 | } | ||
| 40 | |||
| 41 | |||
| 42 | |||
| 43 | sub like | ||
| 44 | 0 | ▶ | { |
|
Subroutine
like: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 45 | 0 | my ($self, $filter_condition, $regexp) = @_; | |
| 46 | |||
| 47 | 0 | $regexp =~ tr/*/%/; | |
| 48 | 0 | $filter_condition->{early}->{name} = { 'like', $regexp} ; | |
| 49 | |||
| 50 | 0 | return $filter_condition; | |
| 51 | } | ||
| 52 | |||
| 53 | |||
| 54 | sub hostname | ||
| 55 | 0 | ▶ | { |
|
Subroutine
hostname: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 56 | 0 | my ($self, $filter_condition, $regexp) = @_; | |
| 57 | |||
| 58 | 0 | $regexp =~ tr/*/%/; | |
| 59 | 0 | $filter_condition->{early}->{machine_name} = { 'like', $regexp} ; | |
| 60 | |||
| 61 | 0 | return $filter_condition; | |
| 62 | } | ||
| 63 | |||
| 64 | |||
| 65 | 14 | 1; | |
| 66 | |||
| 67 | __END__ | ||