blib/lib/Template/Plugin/DataRandom.pm

filter: Statementstmt 43.4% 20 / 46 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 6 / 15 Podpod 88.8% 8 / 9 totaltotal 48.5% 34 / 70 CC 1 SCAR 4.7
CC
1
Cov
43%
new
2.0
rndwrds
2.0
rndchrs
2.0
CRAP 1.6
↑ Summary
1 #============================================================================
2 #
3 # Template::Plugin::DataRandom
4 #
5 # DESCRIPTION
6 #
7 # Plugin to use Data::Random in Template Toolkit
8 #
9 # AUTHORS
10 # Emmanuel Quevillon <tuco@pasteur.fr>
11 #
12 # COPYRIGHT
13 # Copyright (C) 2010 Emmanuel Quevillon
14 #
15 # This module is free software; you can redistribute it and/or
16 # modify it under the same terms as Perl itself.
17 #
18 #============================================================================
19  
20 package Template::Plugin::DataRandom;
21  
22 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 1 ▶use base 'Template::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Template::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Template::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 1 ▶use Data::Random qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 1 $VERSION = '0.03';
32  
33 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
34  
35 0 my($class, $context) = @_;
36  
37 0 bless {
38 _CONTEXT => $context,
39 },$class;
40 }
41  
42 0 ▶sub rndwrds {
Subroutine rndwrds: not called CC=1 SCAR=6.9
Pod documented
43  
44 0 my $self = shift;
45 0 my $args = shift;
46  
47 0 return rand_words(%$args);
48 }
49  
50 0 ▶sub rndchrs {
Subroutine rndchrs: not called CC=1 SCAR=6.9
Pod documented
51  
52 0 my $self = shift;
53 0 my $args = shift;
54  
55 0 return rand_chars(%$args);
56 }
57  
58 0 ▶sub rndset {
Subroutine rndset: not called CC=1 SCAR=6.9
Pod documented
59  
60 0 my $self = shift;
61 0 my $args = shift;
62  
63 0 return rand_set(%$args);
64 }
65  
66 0 ▶sub rndenum {
Subroutine rndenum: not called CC=1 SCAR=6.9
Pod undocumented
67  
68 0 my $self = shift;
69 0 my $args = shift;
70  
71 0 return rand_enum(%$args);
72 }
73  
74 0 ▶sub rnddate {
Subroutine rnddate: not called CC=1 SCAR=6.9
Pod documented
75  
76 0 my $self = shift;
77 0 my $args = shift;
78  
79 0 return rand_date(%$args);
80 }
81  
82 0 ▶sub rndtime {
Subroutine rndtime: not called CC=1 SCAR=6.9
Pod documented
83  
84 0 my $self = shift;
85 0 my $args = shift;
86  
87 0 return rand_time(%$args);
88 }
89  
90 0 ▶sub rnddtime {
Subroutine rnddtime: not called CC=1 SCAR=6.9
Pod documented
91  
92 0 my $self = shift;
93 0 my $args = shift;
94  
95 0 return rand_datetime(%$args);
96 }
97  
98 0 ▶sub rndimg {
Subroutine rndimg: not called CC=1 SCAR=6.9
Pod documented
99  
100 0 my $self = shift;
101 0 my $args = shift;
102  
103 0 return rand_image(%$args);
104 }
105  
106 1 1;
107  
108 __END__
↑ Summary