| 1 | #! /bin/false | ||||||||||
| 2 | |||||||||||
| 3 | # Copyright (C) 2016-2018 Guido Flohr <guido.flohr@cantanea.com>, | ||||||||||
| 4 | # all rights reserved. | ||||||||||
| 5 | |||||||||||
| 6 | # This program is free software: you can redistribute it and/or modify | ||||||||||
| 7 | # it under the terms of the GNU General Public License as published by | ||||||||||
| 8 | # the Free Software Foundation; either version 3 of the License, or | ||||||||||
| 9 | # (at your option) any later version. | ||||||||||
| 10 | |||||||||||
| 11 | # This program is distributed in the hope that it will be useful, | ||||||||||
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||
| 14 | # GNU General Public License for more details. | ||||||||||
| 15 | |||||||||||
| 16 | # You should have received a copy of the GNU General Public License | ||||||||||
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||||||||
| 18 | |||||||||||
| 19 | package Qgoda::HTMLFilter::Generator; | ||||||||||
| 20 | 2 | $Qgoda::HTMLFilter::Generator::VERSION = 'v0.9.2'; | |||||||||
| 21 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | 2 | ▶ | use Qgoda; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | |||||||||||
| 25 | 2 | ▶ | use base qw(Qgoda::Processor); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 26 | |||||||||||
| 27 | sub new { | ||||||||||
| 28 | 2 | ▶ | my ($class, %args) = @_; | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 29 | |||||||||||
| 30 | 2 | ▶ | my $indent = exists $args{indent} ? $args{indent} : ' '; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 2 | my $self = { | |||||||||
| 32 | __indent => $indent, | ||||||||||
| 33 | }; | ||||||||||
| 34 | |||||||||||
| 35 | 2 | bless $self, $class; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | sub end { | ||||||||||
| 39 | 27 | ▶ | my ($self, $chunk, %args) = @_; | ||||||||
|
Subroutine
end: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 40 | |||||||||||
| 41 | 27 | ▶ | return $chunk if 'head' ne $args{tagname}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | |||||||||||
| 43 | 3 | $args{output} =~ /([ \t]*)/; | |||||||||
| 44 | 3 | my $head_indent = $1; | |||||||||
| 45 | |||||||||||
| 46 | 3 | my $content = "Qgoda $Qgoda::VERSION (http://www.qgoda.net/)"; | |||||||||
| 47 | 3 | my $version = qq{<meta name="generator" content="$content" />}; | |||||||||
| 48 | |||||||||||
| 49 | 3 | $chunk = $self->{__indent} . "$version\n$head_indent$chunk"; | |||||||||
| 50 | |||||||||||
| 51 | 3 | return $chunk; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 2 | 1; | |||||||||