Wiki/Plugin/Function/Size.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 40 / 40 CC 3 SCAR 5.6
CC
3
Cov
100%
prepare_args
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Wiki/Plugin/Function/Align.pm ↑ Summary Wiki/Plugin/Function/GoogleVideo.pm »
1 package Text::Livedoor::Wiki::Plugin::Function::Size;
2 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use base qw/Text::Livedoor::Wiki::Plugin::Function/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 __PACKAGE__->function_name('size');
6  
7 12 ▶sub prepare_args {
Subroutine prepare_args: called CC=3 SCAR=11.0
Pod documented
8 12 my $class= shift;
9 12 my $args = shift;
10 12 ▶ die 'no arg' unless scalar @$args ;
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @$args 1 11 12
11 11 my $size = $args->[0];
12 11 ▶ die 'must be number' unless $size =~ /^[0-9]+$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $size =~ /^[0-9]+$/ 1 10 11
13 10 return { size => $size } ;
14 }
15 7 ▶sub process {
Subroutine process: called CC=1 SCAR=0.0
Pod documented
16 7 my ( $class, $inline, $data ) = @_;
17 7 my $size = $data->{args}{size};
18 7 my $value = $data->{value};
19 7 $value = $inline->parse($value);
20 7 return qq|<span class="fsize" style="font-size:${size}px;">$value</span>|;
21 }
22  
23 3 ▶sub process_mobile {
Subroutine process_mobile: called CC=1 SCAR=0.0
Pod documented
24 3 my ( $class, $inline, $data ) = @_;
25 3 my $size = $data->{args}{size};
26 3 my $value = $data->{value};
27 3 $value = $inline->parse($value);
28 3 return qq|<font size="$size">$value</font>|;
29 }
30  
31 11 1;
32  
33 =head1 NAME
34  
35 Text::Livedoor::Wiki::Plugin::Function::Size - Size Function Plugin
36  
37 =head1 SYNOPSIS
38  
39 &size(20){text here}
40  
41 =head1 DESCRIPTION
42  
43 make your text bigger or smaller
44  
45 =head1 FUNCTION
46  
47 =head2 prepare_args
48  
49 =head2 process
50  
51 =head2 process_mobile
52  
53 =head1 AUTHOR
54  
55 polocky
56  
57 =cut
« Wiki/Plugin/Function/Align.pm ↑ Summary Wiki/Plugin/Function/GoogleVideo.pm »