File Coverage

lib/Kwiki/GoogleLink.pm
Criterion Covered Total %
statement 7 9 77.7
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 10 12 83.3


line stmt bran cond sub pod time code
1             package Kwiki::GoogleLink;
2 1     1   27510 use strict;
  1         3  
  1         39  
3 1     1   6 use warnings;
  1         3  
  1         31  
4 1     1   604 use Kwiki::Plugin '-Base';
  0            
  0            
5              
6             our $VERSION = 0.01;
7              
8             const class_title => 'Google Search Link';
9             const class_id => 'google_link';
10              
11             sub register {
12             my $registry = shift;
13             $registry->add(wafl => google => 'Kwiki::GoogleLink::Wafl');
14             }
15              
16             package Kwiki::GoogleLink::Wafl;
17             use Spoon::Formatter ();
18             use base 'Spoon::Formatter::WaflPhrase';
19              
20             const google_search => 'http://www.google.com/search?q=';
21              
22             sub html {
23             my $search = $self->arguments;
24             join('',
25             ' 26             $self->google_search,
27             $self->uri_escape($search), '">',
28             $self->html_escape($search), ''
29             );
30             }
31              
32             1;
33              
34             __DATA__