File Coverage

blib/lib/DDG/Meta.pm
Criterion Covered Total %
statement 73 73 100.0
branch 2 4 50.0
condition 1 3 33.3
subroutine 21 21 100.0
pod 5 5 100.0
total 102 106 96.2


line stmt bran cond sub pod time code
1             package DDG::Meta;
2             our $AUTHORITY = 'cpan:DDG';
3             # ABSTRACT: Main meta layer implementation factory... dark side of the moon...
4             $DDG::Meta::VERSION = '1018';
5 11     11   77 use strict;
  11         25  
  11         333  
6 11     11   64 use warnings;
  11         25  
  11         287  
7 11     11   62 use Carp;
  11         23  
  11         907  
8             require Data::Printer;
9              
10 11     11   3958 use DDG::Meta::RequestHandler;
  11         34  
  11         401  
11 11     11   4014 use DDG::Meta::ZeroClickInfo;
  11         43  
  11         433  
12 11     11   3736 use DDG::Meta::ZeroClickInfoSpice;
  11         79  
  11         485  
13 11     11   5247 use DDG::Meta::Fathead;
  11         38  
  11         399  
14 11     11   3634 use DDG::Meta::ShareDir;
  11         50  
  11         494  
15 11     11   4908 use DDG::Meta::Block;
  11         47  
  11         434  
16 11     11   4943 use DDG::Meta::Information;
  11         43  
  11         733  
17 11     11   4194 use DDG::Meta::Helper;
  11         47  
  11         455  
18 11     11   4483 use DDG::Meta::AnyBlock;
  11         37  
  11         396  
19 11     11   3734 use DDG::Meta::CountryCodes;
  11         101  
  11         507  
20              
21 11     11   3886 use MooX ();
  11         23872  
  11         4605  
22              
23             require Moo::Role;
24              
25              
26             sub apply_base_to_package {
27 45     45 1 144 my ( $class, $target ) = @_;
28              
29 45         454 MooX->import::into($target, qw(
30             +Data::Printer
31             ));
32             }
33              
34              
35             sub apply_goodie_keywords {
36 24     24 1 90 my ( $class, $target ) = @_;
37 24         249 DDG::Meta::ZeroClickInfo->apply_keywords($target);
38 24         241 DDG::Meta::ShareDir->apply_keywords($target);
39 24         238 DDG::Meta::Block->apply_keywords($target);
40 24         29906 DDG::Meta::Information->apply_keywords($target);
41 24         12759 DDG::Meta::Helper->apply_keywords($target);
42             DDG::Meta::RequestHandler->apply_keywords($target,sub {
43             shift->zci_new(
44 34 50 33 34   396 scalar @_ == 1 && ref $_[0] eq 'HASH' ? $_[0] :
    50          
45             @_ % 2 ? ( answer => @_ ) : @_
46             );
47 24         289 },'DDG::IsGoodie');
48             }
49              
50              
51             sub apply_spice_keywords {
52 11     11 1 45 my ( $class, $target ) = @_;
53 11         101 DDG::Meta::ZeroClickInfoSpice->apply_keywords($target);
54 11         103 DDG::Meta::ShareDir->apply_keywords($target);
55 11         103 DDG::Meta::Block->apply_keywords($target);
56 11         13721 DDG::Meta::Information->apply_keywords($target);
57 11         6170 DDG::Meta::Helper->apply_keywords($target);
58             DDG::Meta::RequestHandler->apply_keywords($target,sub {
59 11     11   49 shift->spice_new(@_);
60 11         123 },'DDG::IsSpice');
61             }
62              
63              
64             sub apply_fathead_keywords {
65 5     5 1 23 my ( $class, $target ) = @_;
66 5         59 DDG::Meta::ZeroClickInfo->apply_keywords($target);
67 5         116 DDG::Meta::ShareDir->apply_keywords($target);
68 5         59 DDG::Meta::Fathead->apply_keywords($target);
69 5         55 DDG::Meta::Information->apply_keywords($target);
70 5         4237 DDG::Meta::AnyBlock->apply_keywords($target);
71 5         6401 Moo::Role->apply_role_to_package($target, "DDG::IsFathead");
72             }
73              
74              
75             sub apply_longtail_keywords {
76 5     5 1 20 my ( $class, $target ) = @_;
77 5         44 DDG::Meta::ZeroClickInfo->apply_keywords($target);
78 5         46 DDG::Meta::ShareDir->apply_keywords($target);
79 5         52 DDG::Meta::Information->apply_keywords($target);
80 5         3648 DDG::Meta::AnyBlock->apply_keywords($target);
81 5         6031 Moo::Role->apply_role_to_package($target, "DDG::IsLongtail");
82             }
83              
84             1;
85              
86             __END__