blib/lib/SVG/Calendar.pm

filter: Statementstmt 89.3% 267 / 299 Branchbran 60.7% 68 / 112 Conditioncond 45.7% 32 / 70 MC/DCmcdc 20.4% 9 / 44 Subroutinesub 100% 23 / 23 Podpod 100% 8 / 8 totaltotal 73.2% 407 / 556 CC 88 SCAR 33.3
CC
88
Cov
76%
output_month
75.0
output
34.7
get_page
21.6
CRAP 28.1
« blib/script/svgcal.pl ↑ Summary Build »
1 package SVG::Calendar;
2  
3 # Created on: 2006-04-22 10:36:43
4 # Create by: ivan
5 # $Id$
6 # # $Revision$, $HeadURL$, $Date$
7 # # $Revision$, $Source$, $Date$
8  
9 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use Scalar::Util qw/blessed/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use Data::Dumper qw/Dumper/;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use Clone qw/clone/;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶use Math::Trig;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 4 ▶use DateTime::Format::Strptime qw/strptime strftime/;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 4 ▶use Template;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 4 ▶use File::ShareDir qw/dist_dir/;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 4 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 4 ▶use Image::ExifTool qw/ImageInfo/;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 4 ▶use English '-no_match_vars';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 4 ▶use base qw/Exporter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 4 our $VERSION = version->new('0.3.11');
26 4 our @EXPORT_OK = qw//;
27  
28 4 Readonly my $MARGIN_RATIO => 0.04;
29 4 Readonly my $DAY_COLS => 8;
30 4 Readonly my $ROUNDING_FACTOR => 0.5;
31 4 Readonly my $TEXT_OFFSET_Y => 0.1;
32 4 Readonly my $TEXT_OFFSET_X => 0.15;
33 4 Readonly my $TEXT_WIDTH_RATIO => 0.1;
34 4 Readonly my $TEXT_HEIGHT_RATIO => 0.145;
35 4 Readonly my $MOON_SCALE_WIDTH => 0.3;
36 4 Readonly my $MOON_SCALE_HEIGHT => 0.8;
37 4 Readonly my $HEADING_WIDTH_SCALE => 0.8;
38 4 Readonly my $HEADING_HEIGHT_SCALE => 0.45;
39 4 Readonly my $HEADING_DOW_WIDTH_SCALE => 2;
40 4 Readonly my $HEADING_DOW_HEIGHT_SCALE => 0.4;
41 4 Readonly my $HEADING_WOY_WIDTH_SCALE => 4;
42 4 Readonly my $HEADING_WOY_HEIGHT_SCALE => 0.9;
43 4 Readonly my $MAX_WEEK_ROW => 5;
44 4 Readonly my $MAX_DAYS => 42;
45 4 Readonly my $INTERVAL_ONE_DAY => DateTime::Duration->new(days => 1);
46 4 Readonly my $INTERVAL_ONE_WEEK => DateTime::Duration->new(days => 7);
47 4 Readonly my $INTERVAL_ONE_MONTH => DateTime::Duration->new(months => 1);
48 4 Readonly my $INTERVAL_ELEVEN_MONTHS => DateTime::Duration->new(months => 11);
49 4 Readonly my $FULL_MOON => 100;
50 4 Readonly my $MOON_RADIAL_STEP => 1.34;
51 4 Readonly my $MOON_AT_NIGHT => DateTime::Duration->new(hours => 20);
52 4 Readonly my $FULL_CIRCLE_DEGREES => 360;
53 4 Readonly my $ONE_WEEK => 7;
54  
55 sub new {
56  
57 3 ▶ my ( $class, %param ) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
58 3 my $self = clone \%param;
59  
60 3 bless $self, $class;
61  
62 3 $self->init();
63  
64 3 return $self;
65 }
66  
67 sub init {
68 3 ▶ my $self = shift;
Subroutine init: called CC=11 SCAR=24.3
Pod documented
69 3 my %size = $self->get_page();
70 3 my %temp = ( page => \%size, xu => $self->{page}{width_unit}, yu => $self->{page}{height_unit}, );
71 3 my $height = $self->{page}{height};
72 3 my $width = $self->{page}{width};
73 3 my $xu = $self->{page}{width_unit};
74 3 my $yu = $self->{page}{height_unit};
75 3 ▶ my $xmargin = $self->{page}{margin} || $self->{page}{width} * $MARGIN_RATIO;
Condition33%1/3
$self->{'page'}{'margin'} || $self->{'page'}{'width'} * $MARGIN_RATIO
l!l&&r!l&&!r
030
MC/DC0%0/2
$self->{'page'}{'margin'} || $self->{'page'}{'width'} * $MARGIN_RATIO
$self->{'page'}{'margin'} $self->{'page'}{'width'} * $MARGIN_RATIO
Truth table33%1/3
A || B
A= $self->{'page'}{'margin'}B= $self->{'page'}{'width'} * $MARGIN_RATIO
ABresult
1X1
011
000
76 3 ▶ my $ymargin = $self->{page}{margin} || $self->{page}{height} * $MARGIN_RATIO;
Condition33%1/3
$self->{'page'}{'margin'} || $self->{'page'}{'height'} * $MARGIN_RATIO
l!l&&r!l&&!r
030
MC/DC0%0/2
$self->{'page'}{'margin'} || $self->{'page'}{'height'} * $MARGIN_RATIO
$self->{'page'}{'margin'} $self->{'page'}{'height'} * $MARGIN_RATIO
Truth table33%1/3
A || B
A= $self->{'page'}{'margin'}B= $self->{'page'}{'height'} * $MARGIN_RATIO
ABresult
1X1
011
000
77 3 $self->{page}{x_margin} = $xmargin;
78 3 $self->{page}{y_margin} = $ymargin;
79 3 ▶ $self->{moon}{xoffset} ||= 0;
Condition50%1/2
$self->{"moon"}{"xoffset"} ||= 0
l!l
03
MC/DC0%0/1
$self->{"moon"}{"xoffset"} ||= 0
$self->{"moon"}{"xoffset"}
Truth table50%1/2
A
A= $self->{"moon"}{"xoffset"}
Aresult
11
00
80 3 ▶ $self->{moon}{yoffset} ||= 0;
Condition50%1/2
$self->{"moon"}{"yoffset"} ||= 0
l!l
03
MC/DC0%0/1
$self->{"moon"}{"yoffset"} ||= 0
$self->{"moon"}{"yoffset"}
Truth table50%1/2
A
A= $self->{"moon"}{"yoffset"}
Aresult
11
00
81 3 ▶ $self->{calendar_height} ||= '0.5';
Condition50%1/2
$self->{"calendar_height"} ||= "0.5"
l!l
03
MC/DC0%0/1
$self->{"calendar_height"} ||= "0.5"
$self->{"calendar_height"}
Truth table50%1/2
A
A= $self->{"calendar_height"}
Aresult
11
00
82 3 $self->{calendar_height} =~ s/%//exms;
83 3 ▶ if ( $self->{calendar_height} > 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"calendar_height"} > 1) 0 3 3
84 # assume that the height is a percentage value and divide by 100
85 0 $self->{calendar_height} /= 100;
86 }
87 3 $self->{classes} = {};
88  
89 # cal bounding box (bb)
90 $temp{bb} = {
91 x => $xmargin,
92 y => ( $height * ( 1 - $self->{calendar_height} ) + $ymargin ),
93 3 height => ( $height * $self->{calendar_height} - $ymargin * 2 ),
94 width => ( $width - $xmargin * 2 ),
95 };
96  
97 3 my $rows = $MAX_WEEK_ROW + 1;
98 3 my $row_height = $temp{bb}{height} / ( $rows + $ROUNDING_FACTOR ) * ( 0.5 + $self->{calendar_height} );
99 3 my $row_margin_height = $row_height / ( $rows * 2 );
100 3 my $cols = $DAY_COLS;
101 3 my $col_width = $temp{bb}{width} / ( $cols + $ROUNDING_FACTOR );
102 3 my $col_margin_width = $col_width / ( $cols * 2 );
103  
104 # setup the day boxes row by row
105 3 for my $i ( 2 .. $rows ) {
106 15 my $row_y = $temp{bb}{y} + $row_margin_height * ( 2 * $i - 1 ) + $row_height * ( $i - 1 );
107  
108 # setup the individual days
109 15 for my $j ( 2 .. $cols ) {
110 105 my $x = ( $temp{bb}{x} + $col_margin_width * ( 2 * $j - 1 ) + $col_width * ( $j - 1 ) ) - $col_width / 2;
111 105 my $y = $row_y - $row_height / 2;
112 105 $temp{cal}[ $i - 1 ][ $j - 1 ] = {
113 x => $x,
114 y => $y,
115 height => $row_height,
116 width => $col_width,
117 text => {
118 x => $x + $col_margin_width * $TEXT_OFFSET_X,
119 y => $y + $row_height * $TEXT_OFFSET_X,
120 length => $col_width * $TEXT_WIDTH_RATIO,
121 class => 'mday ',
122 style => 'font-size: ' . ( $row_height * $TEXT_HEIGHT_RATIO ),
123 },
124 };
125 }
126 }
127  
128 # set up the week day headings
129 3 my $count = 1;
130 3 for my $day (qw/Mon Tue Wed Thu Fri Sat Sun/) {
131 21 my $x = $temp{bb}{x} + $col_margin_width * ( 2 * $count + 1 ) + $col_width * ( $count - 1 ) + $col_width / 2;
132 21 my $y = $temp{bb}{y} + $row_margin_height;
133 $temp{cal}[0][$count] = {
134 x => $x,
135 y => $y,
136 height => $row_height * $self->{calendar_height},
137 21 width => $col_width,
138 text => {
139 text => $day,
140 x => $x + $col_width / $HEADING_DOW_WIDTH_SCALE,
141 y => $y + $row_height * $HEADING_DOW_HEIGHT_SCALE,
142 length => $col_width * $HEADING_WIDTH_SCALE,
143 adjust => 'spacing', #AndGlyphs',
144 class => 'day ' . lc $day,
145 style => 'font-size: ' . ( $row_height * $HEADING_HEIGHT_SCALE ),
146 },
147 };
148 21 $count++;
149 }
150  
151 # set up the week of the year column
152 3 $count = 1;
153 3 for my $week ( 1 .. $MAX_WEEK_ROW ) {
154 15 my $x = $temp{bb}{x} + $col_margin_width;
155 15 my $y = $temp{bb}{y} + $row_margin_height * ( 2 * $count + 1 ) + $row_height * ( $count - 1 ) + $row_height / 2;
156 15 $temp{cal}[$count][0] = {
157 x => $x,
158 y => $y,
159 height => $row_height,
160 width => $col_width / 2,
161 text => {
162 text => $week,
163 x => $x + $col_width / $HEADING_WOY_WIDTH_SCALE,
164 y => $y + $row_height * $HEADING_WOY_HEIGHT_SCALE,
165 length => $col_width * $HEADING_WIDTH_SCALE,
166 adjust => 'spacing', #AndGlyphs',
167 class => 'week',
168 style => 'font-size: ' . ( $row_height * $HEADING_HEIGHT_SCALE ),
169 },
170 };
171 15 $count++;
172 }
173  
174 # get the month display stuff
175 $temp{month} = {
176 x => $temp{bb}{x} + $col_margin_width * 2,
177 3 y => $temp{bb}{y} - $ymargin/2,
178 style => 'font-size: ' . ($row_height),
179 };
180  
181 # set up the year display
182 $temp{year} = {
183 x => $temp{bb}{x} + $temp{bb}{width},
184 3 y => $temp{bb}{y} - $ymargin/2,
185 style => 'text-align: end; text-anchor: end; font-size: ' . $row_height,
186 };
187  
188 3 $self->{template} = \%temp;
189  
190 3 return;
191 }
192  
193 sub get_page {
194  
195 20 ▶ my $self = shift;
Subroutine get_page: called CC=19 SCAR=30.7
Pod documented
196 20 ▶ my $page = ref $self->{page} ? $self->{page}{page} : $self->{page};
Branch: 1 branch
BranchTrueFalseTotal
ref $self->{'page'} ? : 15 5 20
197 20 my %size = ( width => '210.00mm', height => '297.00mm' );
198  
199 20 ▶ if ($page) {
Branch: 1 branch
BranchTrueFalseTotal
if ($page) 2 18 20
200 2 ▶ %size =
Branch: 7 branches
BranchTrueFalseTotal
$page eq 'A0' ? : 0 2 2
$page eq 'A1' ? : 0 2 2
$page eq 'A2' ? : 0 2 2
$page eq 'A3' ? : 1 1 2
$page eq 'A4' ? : 1 0 1
$page eq 'A5' ? : 0 0 0
$page eq 'A6' ? : 0 0 0
201 $page eq 'A0' ? ( width => '840.00mm', height => '1188.00mm' )
202 : $page eq 'A1' ? ( width => '594.00mm', height => '840.00mm' )
203 : $page eq 'A2' ? ( width => '420.00mm', height => '594.00mm' )
204 : $page eq 'A3' ? ( width => '297.00mm', height => '420.00mm' )
205 : $page eq 'A4' ? ( width => '210.00mm', height => '297.00mm' )
206 : $page eq 'A5' ? ( width => '148.50mm', height => '210.00mm' )
207 : $page eq 'A6' ? ( width => '105.00mm', height => '148.50mm' )
208 : croak "Unknown page type '$page'!\n";
209 }
210  
211 20 ▶ if ( ref $self->{page} && $self->{page}{width} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self->{"page"} and $self->{"page"}{"width"}) 15 5 20
Condition66%2/3
ref $self->{"page"} and $self->{"page"}{"width"}
!ll&&!rl&&r
5015
MC/DC50%1/2
ref $self->{"page"} and $self->{"page"}{"width"}
ref $self->{"page"} $self->{"page"}{"width"}
Truth table66%2/3
A and B
A= ref $self->{"page"}B= $self->{"page"}{"width"}
ABresult
0X0
100
111
212 15 $size{width} = $self->{page}{width};
213 }
214 20 ▶ if ( ref $self->{page} && $self->{page}{height} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self->{"page"} and $self->{"page"}{"height"}) 15 5 20
Condition66%2/3
ref $self->{"page"} and $self->{"page"}{"height"}
!ll&&!rl&&r
5015
MC/DC50%1/2
ref $self->{"page"} and $self->{"page"}{"height"}
ref $self->{"page"} $self->{"page"}{"height"}
Truth table66%2/3
A and B
A= ref $self->{"page"}B= $self->{"page"}{"height"}
ABresult
0X0
100
111
215 15 $size{height} = $self->{page}{height};
216 }
217  
218 # Get the values to internal variables
219 20 my ( $width, $width_unit ) = $size{width} =~ /\A(.+?)(px|pt|mm|cm|m|in)?\Z/xms;
220 20 $width *= 1.0;
221 20 ▶ croak "Unable to get a width from $self->{page} or $self->{width}" if !$width;
Branch: 1 branch
BranchTrueFalseTotal
unless $width 0 20 20
222 20 ▶ $width_unit ||= 'px';
Condition100%2/2
$width_unit ||= "px"
l!l
614
MC/DC100%1/1
$width_unit ||= "px"
$width_unit
Truth table100%2/2
A
A= $width_unit
Aresult
11
00
223  
224 20 my ( $height, $height_unit ) = $size{height} =~ /\A(.+?)(px|pt|mm|cm|m|in)?\Z/xms;
225 20 $height *= 1.0;
226 20 ▶ croak "Unable to get a height from $self->{page} or $self->{height}" if !$height;
Branch: 1 branch
BranchTrueFalseTotal
unless $height 0 20 20
227 20 ▶ $height_unit ||= 'px';
Condition100%2/2
$height_unit ||= "px"
l!l
614
MC/DC100%1/1
$height_unit ||= "px"
$height_unit
Truth table100%2/2
A
A= $height_unit
Aresult
11
00
228  
229 # store the internal variables
230 20 ▶ if ( !ref $self->{page} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $self->{"page"}) 5 15 20
231 5 $self->{page} = {};
232 }
233 20 $self->{page}{width} = $width;
234 20 $self->{page}{width_unit} = $width_unit;
235 20 $self->{page}{height} = $height;
236 20 $self->{page}{height_unit} = $height_unit;
237  
238 return (
239 20 width => $width,
240 width_unit => $width_unit,
241 height => $height,
242 height_unit => $height_unit,
243 );
244 }
245  
246 sub output_year {
247  
248 1 ▶ my ( $self, @params ) = @_;
Subroutine output_year: called CC=4 SCAR=14.1
Pod documented
249 1 my $file = pop @params;
250 1 my ( $start, $end ) = @params;
251  
252 1 ▶ return if !$start;
Branch: 1 branch
BranchTrueFalseTotal
unless $start 0 1 1
253  
254 1 ▶ if ($end) {
Branch: 1 branch
BranchTrueFalseTotal
if ($end) { } 0 1 1
255 0 $start = strptime('%F', "$start-01");
256 0 $end = strptime('%F', "$end-01");
257 }
258 else {
259 1 $start = strptime('%F', "$start-01-01");
260 1 $end = $start + $INTERVAL_ELEVEN_MONTHS;
261 }
262  
263 1 my @files;
264 1 ▶ while ( $start <= $end ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($start <= $end) 12 1 13
265 12 my $month = $start->strftime('%Y-%m');
266 12 push @files, "$file-$month.svg";
267 12 $self->output_month( $month, "$file-$month.svg" );
268 12 $start += $INTERVAL_ONE_MONTH;
269 }
270  
271 1 return @files;
272 }
273  
274 sub output_month {
275  
276 13 ▶ my ( $self, $month, $file, ) = @_;
Subroutine output_month: called CC=23 SCAR=43.2
Pod documented
277  
278 # add the month specific details to a clone of the general settings
279 13 my $templ = clone $self->{template};
280 13 my %size = $self->get_page();
281 13 $self->{full_moon} = 0;
282  
283 13 ▶ carp "Month '$month' is not the correct format (YYYY-MM) " if !$month || $month !~ /\A\d{4}-\d{2}\Z/xms;
Branch: 1 branch
BranchTrueFalseTotal
unless $month and $month =~ /\A\d{4}-\d{2}\Z/msx 0 13 13
Condition33%1/3
$month and $month =~ /\A\d{4}-\d{2}\Z/msx
!ll&&!rl&&r
0013
MC/DC0%0/2
$month and $month =~ /\A\d{4}-\d{2}\Z/msx
$month $month =~ /\A\d{4}-\d{2}\Z/msx
Truth table33%1/3
A and B
A= $monthB= $month =~ /\A\d{4}-\d{2}\Z/msx
ABresult
0X0
100
111
284  
285 13 my $date = strptime('%F', "$month-01");
286 13 $templ->{year}{text} = $date->year();
287 13 $templ->{month}{text} = $date->month_name();
288 13 my $month_day = $date - $INTERVAL_ONE_WEEK;
289 13 my $row = 1;
290 13 my $wrap = 0;
291  
292 # make sure that we start on a monday
293 13 ▶ while ( $month_day->wday() != 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($month_day->wday != 2) 35 13 48
294 35 $month_day += $INTERVAL_ONE_DAY;
295 }
296  
297 DAY:
298 13 for my $count ( 1 .. $MAX_DAYS ) {
299  
300 # get the day of the week (of the first day of the month)
301 466 my $wday = $month_day->wday();
302 466 ▶ $wday = $wday == 1 ? $ONE_WEEK : $wday - 1;
Branch: 1 branch
BranchTrueFalseTotal
$wday == 1 ? : 65 401 466
303 466 my $r = $templ->{cal}[$row][$wday]{width} / $DAY_COLS;
304 466 ▶ if ( $self->{moon}{radius} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"moon"}{"radius"}) 0 466 466
305 0 $r *= $self->{moon}{radius};
306 }
307  
308 466 $templ->{cal}[$row][$wday]{text}{text} = $month_day->mday();
309 466 ▶ $templ->{cal}[$row][$wday]{current} = $date->month() == $month_day->month() ? 1 : 2;
Branch: 1 branch
BranchTrueFalseTotal
$date->month == $month_day->month ? : 397 69 466
310 466 ▶ if ( $date->month() == $month_day->month() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($date->month == $month_day->month) 397 69 466
311 397 $templ->{cal}[$row][$wday]{text}{class} .= 'current_month';
312 }
313  
314 466 ▶ if ( $self->{moon} && $self->{moon}{display} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"moon"} and $self->{"moon"}{"display"}) 0 466 466
Condition33%1/3
$self->{"moon"} and $self->{"moon"}{"display"}
!ll&&!rl&&r
04660
MC/DC0%0/2
$self->{"moon"} and $self->{"moon"}{"display"}
$self->{"moon"} $self->{"moon"}{"display"}
Truth table33%1/3
A and B
A= $self->{"moon"}B= $self->{"moon"}{"display"}
ABresult
0X0
100
111
315  
316 # get the phase info at 8:00pm
317 0 my $moon_date = $month_day + $MOON_AT_NIGHT;
318 0 my $phase = $self->get_moon_phase($moon_date);
319 $templ->{cal}[$row][$wday]{moon} = $self->moon(
320 phase => $phase,
321 id => 'moon_' . $month_day->strftime('%Y-%m-%d'),
322 x => $templ->{cal}[$row][$wday]{x} + $r + $templ->{cal}[$row][$wday]{width} * $MOON_SCALE_WIDTH + $self->{moon}{xoffset},
323 y => $templ->{cal}[$row][$wday]{y} - $r + $templ->{cal}[$row][$wday]{height} * $MOON_SCALE_HEIGHT + $self->{moon}{yoffset},
324 0 r => $r,
325 );
326 }
327  
328 466 ▶ if ( $wday == $ONE_WEEK ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($wday == $ONE_WEEK) 65 401 466
329 65 $row++;
330 }
331 466 ▶ if ( $row > $MAX_WEEK_ROW ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($row > $MAX_WEEK_ROW) 13 453 466
332 13 $row = 1;
333 13 $wrap = 1;
334 }
335 466 $month_day += $INTERVAL_ONE_DAY;
336  
337 # stop if we leave the current month.
338 466 ▶ last DAY if $wrap && $date->month() != $month_day->month();
Branch: 1 branch
BranchTrueFalseTotal
if $wrap and $date->month != $month_day->month 13 453 466
Condition100%3/3
$wrap and $date->month != $month_day->month
!ll&&!rl&&r
4421113
MC/DC100%2/2
$wrap and $date->month != $month_day->month
$wrap $date->month != $month_day->month
Truth table100%3/3
A and B
A= $wrapB= $date->month != $month_day->month
ABresult
0X0
100
111
339 }
340  
341 # process the image if present
342 13 ▶ if ( $self->{image} && ( $self->{image}{src} || $self->{image}{$month} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"image"} and $self->{"image"}{"src"} || $self->{"image"}{$month}) 0 13 13
Condition16%1/6
$self->{"image"} and $self->{"image"}{"src"} || $self->{"image"}{$month}
!ll&&!rl&&r
1300
$self->{"image"}{"src"} or $self->{"image"}{$month}
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->{"image"} and $self->{"image"}{"src"} || $self->{"image"}{$month}
$self->{"image"} $self->{"image"}{"src"} $self->{"image"}{$month}
Truth table25%1/4
A and B or C
A= $self->{"image"}B= $self->{"image"}{"src"}C= $self->{"image"}{$month}
ABCresult
0XX0
1000
11X1
1011
343 0 ▶ my $image = $self->{image}{$month} || $self->{image}{src};
Condition0%0/3
$self->{'image'}{$month} || $self->{'image'}{'src'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{'image'}{$month} || $self->{'image'}{'src'}
$self->{'image'}{$month} $self->{'image'}{'src'}
Truth table0%0/3
A || B
A= $self->{'image'}{$month}B= $self->{'image'}{'src'}
ABresult
1X1
011
000
344 0 $templ->{image}{src} = $image;
345  
346 0 $templ->{image}{x} = $self->{page}{x_margin};
347 0 $templ->{image}{y} = $self->{page}{y_margin};
348  
349 0 ▶ if ( -f $image ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $image) 0 0 0
350 0 my $info = ImageInfo($image);
351 0 ▶ if ( $info->{ImageHeight} && $info->{ImageWidth} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($info->{'ImageHeight'} and $info->{'ImageWidth'}) { } 0 0 0
Condition0%0/3
$info->{"ImageHeight"} and $info->{"ImageWidth"}
!ll&&!rl&&r
000
MC/DC0%0/2
$info->{"ImageHeight"} and $info->{"ImageWidth"}
$info->{"ImageHeight"} $info->{"ImageWidth"}
Truth table0%0/3
A and B
A= $info->{"ImageHeight"}B= $info->{"ImageWidth"}
ABresult
0X0
100
111
352 0 $templ->{image}{x} = $self->{page}{x_margin};
353 0 $templ->{image}{y} = $self->{page}{y_margin};
354 0 $templ->{image}{width} = $self->{page}{width} - 2 * $self->{page}{x_margin};
355 0 $templ->{image}{height} = $self->{page}{height} * (1 - $self->{calendar_height}) - $self->{page}{y_margin} * 2;
356  
357 0 my $image_scale = $info->{ImageHeight} / $info->{ImageWidth};
358 0 my $page_scale = $templ->{image}{height} / $templ->{image}{width};
359  
360 0 ▶ if ($image_scale < $page_scale) {
Branch: 1 branch
BranchTrueFalseTotal
if ($image_scale < $page_scale) { } 0 0 0
361 0 $templ->{image}{y} -= ( $templ->{image}{height} - ( $templ->{image}{height} * $page_scale / $image_scale ) ) / 2;
362 0 $templ->{image}{height} *= $image_scale / $page_scale;
363 }
364 else {
365 0 $templ->{image}{x} += ( $templ->{image}{width} - ( $templ->{image}{width} * $page_scale / $image_scale ) ) / 2;
366 0 $templ->{image}{width} *= $page_scale / $image_scale;
367 }
368 }
369 else {
370 0 die "The image $image doesn't apear to have a height or width\n";
371 }
372 }
373 }
374  
375 13 return $self->output( $file, $templ );
376 }
377  
378 sub output {
379  
380 14 ▶ my ( $self, $file, $template ) = @_;
Subroutine output: called CC=16 SCAR=35.5
Pod documented
381  
382 14 my $fh;
383 14 my %option = ( EVAL_PERL => 1 );
384 14 ▶ $option{INCLUDE_PATH} = $self->{INCLUDE_PATH} || dist_dir('SVG-Calendar');
Condition33%1/3
$self->{'INCLUDE_PATH'} || dist_dir('SVG-Calendar')
l!l&&r!l&&!r
1400
MC/DC0%0/2
$self->{'INCLUDE_PATH'} || dist_dir('SVG-Calendar')
$self->{'INCLUDE_PATH'} dist_dir('SVG-Calendar')
Truth table33%1/3
A || B
A= $self->{'INCLUDE_PATH'}B= dist_dir('SVG-Calendar')
ABresult
1X1
011
000
385 14 ▶ if ( $self->{path} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"path"}) 0 14 14
386 0 $option{INCLUDE_PATH} .= ':' . $self->{path};
387 }
388  
389 14 ▶ my $tmpl = $self->{tt} || Template->new(%option);
Condition66%2/3
$self->{'tt'} || 'Template'->new(%option)
l!l&&r!l&&!r
1310
MC/DC0%0/2
$self->{'tt'} || 'Template'->new(%option)
$self->{'tt'} 'Template'->new(%option)
Truth table66%2/3
A || B
A= $self->{'tt'}B= 'Template'->new(%option)
ABresult
1X1
011
000
390  
391 14 my $text;
392 14 ▶ print Dumper($template) if $self->{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"verbose"} 0 14 14
393  
394 14 ▶ $tmpl->process( 'calendar.svg', $template, \$text )
Branch: 1 branch
BranchTrueFalseTotal
$tmpl->process("calendar.svg", $template, \$text) or croak($tmpl->error) 0 14 14
395 or croak( $tmpl->error );
396  
397 14 ▶ if ($file) {
Branch: 1 branch
BranchTrueFalseTotal
if ($file) 12 2 14
398 12 ▶ if ( $file eq q/-/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($file eq '-') { } 0 12 12
399 0 ▶ print $text or carp "Could not write to STDOUT: $OS_ERROR\n";
Branch: 1 branch
BranchTrueFalseTotal
print $text or carp("Could not write to STDOUT: $SVG::Calendar::OS_ERROR\n") 0 0 0
400 }
401 else {
402 12 ▶ open $fh, q/>/, $file or croak "Cannot write SVG to file '$file': $!\n";
Branch: 1 branch
BranchTrueFalseTotal
open $fh, ">", $file or croak("Cannot write SVG to file '${file}': $!\n") 0 12 12
403  
404 12 ▶ print {$fh} $text or carp "Could not write to file '$file': $OS_ERROR\n";
Branch: 1 branch
BranchTrueFalseTotal
print {$fh;} $text or carp("Could not write to file '${file}': $SVG::Calendar::OS_ERROR\n") 0 12 12
405  
406 12 ▶ close $fh or carp "There was an issue closing file '$file': $OS_ERROR\n";
Branch: 1 branch
BranchTrueFalseTotal
close $fh or carp("There was an issue closing file '${file}': $SVG::Calendar::OS_ERROR\n") 0 12 12
407  
408 12 ▶ if ( -f $file && $self->{inkscape} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $file and $self->{"inkscape"}) 0 12 12
Condition33%1/3
-f $file and $self->{"inkscape"}
!ll&&!rl&&r
0120
MC/DC0%0/2
-f $file and $self->{"inkscape"}
-f $file $self->{"inkscape"}
Truth table33%1/3
A and B
A= -f $fileB= $self->{"inkscape"}
ABresult
0X0
100
111
409 0 ▶ if ( $self->{inkscape}{pdf} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"inkscape"}{"pdf"}) 0 0 0
410 # get inkscape to convert svg to PDF
411 }
412 0 ▶ if ( $self->{inkscape}{print} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"inkscape"}{"print"}) 0 0 0
413 # get inkscape to print out the document
414 }
415 }
416 }
417 }
418  
419 14 $self->{tt} = $tmpl;
420 14 return $text;
421 }
422  
423 sub moon {
424 31 ▶ my ( $self, %params ) = @_;
Subroutine moon: called CC=11 SCAR=24.4
Pod documented
425  
426 31 my $phase = $params{phase};
427 31 my $id = $params{id};
428 31 ▶ my $x = $params{x} || $FULL_MOON;
Condition33%1/3
$params{'x'} || $FULL_MOON
l!l&&r!l&&!r
3100
MC/DC0%0/2
$params{'x'} || $FULL_MOON
$params{'x'} $FULL_MOON
Truth table33%1/3
A || B
A= $params{'x'}B= $FULL_MOON
ABresult
1X1
011
000
429 31 ▶ my $y = $params{y} || $FULL_MOON;
Condition33%1/3
$params{'y'} || $FULL_MOON
l!l&&r!l&&!r
3100
MC/DC0%0/2
$params{'y'} || $FULL_MOON
$params{'y'} $FULL_MOON
Truth table33%1/3
A || B
A= $params{'y'}B= $FULL_MOON
ABresult
1X1
011
000
430 31 ▶ my $r = $params{r} || $FULL_MOON;
Condition33%1/3
$params{'r'} || $FULL_MOON
l!l&&r!l&&!r
3100
MC/DC0%0/2
$params{'r'} || $FULL_MOON
$params{'r'} $FULL_MOON
Truth table33%1/3
A || B
A= $params{'r'}B= $FULL_MOON
ABresult
1X1
011
000
431 31 my $class = q//;
432  
433 # approx error of less than one lunar day
434 31 my $error = 2 * pi / 56; ## no critic
435  
436 31 my $moon = { id => $id };
437  
438 # moon phases 0 == new moon 3 == last quarter
439  
440 31 my ( $sx, $sy ) = ( $x, $y );
441 31 my ( $ex, $ey ) = ( $x, $y + 2 * $r );
442  
443 31 ▶ if ( $phase < $error || 2 * pi - $error < $phase ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($phase < $error or 6.283185307179586232 - $error < $phase) { } 1 30 31
elsif (3.141592653589793116 - $error < $phase and $phase < 3.141592653589793116 + $error) { } 1 29 30
elsif ($phase < 3.141592653589793116) { } 16 13 29
elsif ($phase > 3.141592653589793116) { } 13 0 13
Condition66%2/3
$phase < $error or "6.28318530717959" - $error < $phase
l!l&&r!l&&!r
0130
MC/DC50%1/2
$phase < $error or "6.28318530717959" - $error < $phase
$phase < $error "6.28318530717959" - $error < $phase
Truth table66%2/3
A or B
A= $phase < $errorB= "6.28318530717959" - $error < $phase
ABresult
1X1
011
000
444 1 $class = ' new-moon';
445 }
446 ▶ elsif ( pi - $error < $phase && $phase < pi + $error ) {
Condition100%3/3
"3.14159265358979" - $error < $phase and $phase < "3.14159265358979" + $error
!ll&&!rl&&r
16131
MC/DC100%2/2
"3.14159265358979" - $error < $phase and $phase < "3.14159265358979" + $error
"3.14159265358979" - $error < $phase $phase < "3.14159265358979" + $error
Truth table100%3/3
A and B
A= "3.14159265358979" - $error < $phaseB= $phase < "3.14159265358979" + $error
ABresult
0X0
100
111
447  
448 # approx full moon
449 1 ▶ my $moon_type = $self->{full_moon}++ ? 'blue-moon' : 'full-moon';
Branch: 1 branch
BranchTrueFalseTotal
$self->{'full_moon'}++ ? : 0 1 1
450 $moon->{highlight} = {
451 1 type => 'circle',
452 id => $id,
453 class => $moon_type,
454 cx => $x,
455 cy => ( $sy + $ey ) / 2,
456 r => $r,
457 };
458 }
459 elsif ( $phase < pi ) {
460  
461 # moon waxing partial
462 16 my $d = "M $sx\t$sy C ";
463 16 $d .= ( $sx + $r * $MOON_RADIAL_STEP ) . q/ / . $sy . q/,/;
464 16 $d .= ( $sx + $r * $MOON_RADIAL_STEP ) . q/ / . $ey;
465 16 $d .= ",$ex\t$ey C ";
466 16 $d .= ( $ex - $r * $MOON_RADIAL_STEP * ( -cos($phase) ) ) . q/ / . ( $ey + $r / 2 * ( -sin($phase) ) ) . q/,/;
467 16 $d .= ( $ex - $r * $MOON_RADIAL_STEP * ( -cos($phase) ) ) . q/ / . ( $sy - $r / 2 * ( -sin($phase) ) );
468 16 $d .= ", $sx\t$sy Z";
469 $moon->{highlight} = {
470 16 type => 'path',
471 id => $id,
472 d => $d,
473 };
474 }
475 elsif ( $phase > pi ) {
476  
477 # moon waning partial
478 13 my $d = "M $sx\t$sy C ";
479 13 $d .= ( $sx - $r * $MOON_RADIAL_STEP ) . q/ / . $sy . q/,/;
480 13 $d .= ( $sx - $r * $MOON_RADIAL_STEP ) . q/ / . $ey;
481 13 $d .= ",$ex\t$ey C ";
482 13 $d .= ( $ex + $r * $MOON_RADIAL_STEP * ( -cos($phase) ) ) . q/ / . ( $ey - $r / 2 * ( -sin($phase) ) ) . q/,/;
483 13 $d .= ( $ex + $r * $MOON_RADIAL_STEP * ( -cos($phase) ) ) . q/ / . ( $sy + $r / 2 * ( -sin($phase) ) );
484 13 $d .= ", $sx\t$sy Z";
485 $moon->{highlight} = {
486 13 type => 'path',
487 id => $id,
488 d => $d,
489 };
490 }
491  
492 $moon->{border} = {
493 31 id => "moon_border_$id",
494 class => "outline$class",
495 cx => $x,
496 cy => ( $sy + $ey ) / 2,
497 r => $r,
498 };
499  
500 31 return $moon;
501 }
502  
503 sub get_moon_phase {
504  
505 93 ▶ my ( $self, $date ) = @_;
Subroutine get_moon_phase: called CC=10 SCAR=24.1
Pod documented
506  
507 93 ▶ if ( !blessed $date || !$date->isa('DateTime') ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (builtin::blessed($date) and $date->isa("DateTime")) 93 0 93
Condition33%1/3
builtin::blessed($date) and $date->isa("DateTime")
!ll&&!rl&&r
9300
MC/DC0%0/2
builtin::blessed($date) and $date->isa("DateTime")
builtin::blessed($date) $date->isa("DateTime")
Truth table33%1/3
A and B
A= builtin::blessed($date)B= $date->isa("DateTime")
ABresult
0X0
100
111
508 93 $date = strptime('%F %T', "$date 20:00:00");
509 }
510  
511 93 ▶ if ( !$date ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($date) 0 93 93
512 0 carp 'Unable to create a date!';
513 }
514  
515 # check if we have a way to calculate the phase of the moon
516 93 ▶ if ( !$self->{moon_phase} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"moon_phase"}) 1 92 93
517 1 my @packages = qw/Astro::Coord::ECI::Moon Astro::MoonPhase/;
518  
519 PACKAGE:
520 1 for my $package (@packages) {
521 1 my $package_file = $package;
522 1 $package_file =~ s{::}{/}gxms;
523  
524 1 eval{ require $package_file . '.pm' }; ## no critic
525 1 ▶ if ( !$EVAL_ERROR ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($SVG::Calendar::EVAL_ERROR) 1 0 1
526 1 $self->{moon_phase} = $package;
527 1 last PACKAGE;
528 }
529 }
530  
531 # croak if there is no way to calculate the phase of the moon
532 1 ▶ if ( !$self->{moon_phase} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"moon_phase"}) 0 1 1
533 0 die "Cannot find any packages installed to calculate the moon phase\nTry installing one of:\ncpan "
534 . join( "\ncpan ", @packages ) . "\n";
535 }
536 }
537  
538 93 my $phase;
539 93 ▶ if ( $self->{moon_phase} eq 'Astro::Coord::ECI::Moon' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'moon_phase'} eq 'Astro::Coord::ECI::Moon') { } 62 31 93
elsif ($self->{'moon_phase'} eq 'Astro::MoonPhase') { } 31 0 31
540  
541 # phase in radians
542 62 $phase = Astro::Coord::ECI::Moon->phase( $date->epoch() );
543 }
544 elsif ( $self->{moon_phase} eq 'Astro::MoonPhase' ) {
545  
546 # phase in fraction of circle
547 31 ($phase) = Astro::MoonPhase::phase( $date->epoch() );
548 31 $phase *= 2 * pi;
549 }
550  
551 93 return $phase;
552 }
553  
554 4 1;
555  
556 __DATA__
557  
558 =head1 NAME
559  
560 SVG::Calendar - Creates calendars in SVG format which can be printed
561  
562 =head1 VERSION
563  
564 This documentation refers to SVG::Calendar version 0.3.11.
565  
566 =head1 SYNOPSIS
567  
568 use SVG::Calendar;
569  
570 # Brief but working code example(s) here showing the most common usage(s)
571 # This section will be as far as many users bother reading, so make it as
572 # educational and exemplary as possible.
573  
574 # Create a new (basic) SVG::Calendar object for producing A4 calendars
575 my $svg = SVG::Calendar->new( page => 'A4' );
576  
577 # print to standard out the calendar for June 2006
578 print $svg->output_month( '2006-06' );
579  
580 # create a calendar for the year 2007 with filenames
581 # my-calendar-2015-01.svg
582 # ...
583 # my-calendar-2015-12.svg
584 $svg->output_year( '2007', 'my-calendar' );
585  
586 =head1 DESCRIPTION
587  
588 This module generates an SVG image for one or more months for a calendar.
589  
590 =head1 SUBROUTINES/METHODS
591  
592 =head3 C<new ( %args )>
593  
594 Arg: C<page> - hash ref - description
595  
596 Arg: C<moon> - hash ref - description
597  
598 Arg: C<image> - hash ref - description
599  
600 Arg: C<path> - string - Directory containing alternate svg template version
601  
602 Arg: C<inkscape> - hash ref - Use inkscape to convert the SVG to a PDF or to
603 print out the generated SVG calendar.
604  
605 Return: SVG::Calendar - A new SVG::Calendar object
606  
607 Description: Creates and sets up a new SVG::Calendar object
608  
609 =head3 C<init ( )>
610  
611 Initialises the calendar object
612  
613 =head3 C<get_page ( )>
614  
615 Return: hash - contains the page height and width and the units used
616  
617 Description: Gets the dimensions of the page based on the parameters
618 supplied at creation time
619  
620 =head3 C<output_year ( ($start, $end | $year), $file )>
621  
622 Param: C<$start> - string ('YYYY-MM') - description
623  
624 Param: C<$end> - string ('YYYY-MM') - description
625  
626 Param: C<$year> - int (year) - description
627  
628 Param: C<$file> - string - The base name for the SVG files calendars for each
629 year
630  
631 Return: list - A list of the files created
632  
633 Description: Creates the SVG calendar files for each month of the year (or for
634 each month from start and end)
635  
636 eg $svg->output_year( 2006, 'folowers' );
637  
638 Will result in the following files created
639  
640 flowers-2006-01.svg
641 flowers-2006-02.svg
642 ..
643 flowers-2006-11.svg
644 flowers-2006-12.svg
645  
646 =head3 C<output_month ( $month, $file, )>
647  
648 Param: C<$month> - string (detail) - The month that the calendar page should
649 display (format YYYY-MM)
650  
651 Param: C<$file> - string (detail) - The file to save the output to if defined.
652 if $file eq '-' prints to STDOUT
653  
654 Return: string - The SVG text to display the calendar page
655  
656 Description: Outputs a particular months calendar...
657  
658 (Adds the week of the year and the
659  
660 =head3 C<output ( $file )>
661  
662 Param: C<$file> - string (detail) - The file name to print the SVG file to (if undefined it will print nothing)
663  
664 Return: scalar - The SVG text.
665  
666 Description:
667  
668 <path
669 style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.25000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
670 d="M 264.88031,225.97672 C 518.24408,341.14207 267.18361,490.85702 267.18361,490.85702 L 264.88031,225.97672 z "
671 id="path1460"
672 sodipodi:nodetypes="ccc" />
673 <path
674 style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.25000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000"
675 d="M 628.80282,189.12380 C 854.52691,299.68254 847.54045,393.30582 626.49951,477.03718 C 579.56639,494.81567 769.30455,334.23215 628.80282,189.12380 z "
676 id="path1464"
677 sodipodi:nodetypes="csc" />
678 <path
679 style="fill: green; fill-opacity: 0.25; stroke: black;"
680 d="M 0 0 C 133.3333 8, 133.3333 192, 0 200 C -133.333 192 -133.3333 8 Z"
681 M 0 0 C 133.3333 8 133.3333 192, 0 200 C -133.333 192 -133.3333 8 Z
682 id="test" />
683 <circle
684 style="fill: none; stroke: red; stroke-opacity: 0.5"
685 cx="0"
686 cy="100"
687 r="100"
688 id="circle" />
689  
690 =head3 C<moon ( %params )>
691  
692 Param: C<phase> - float - 0 <= $phase < 2 * pi, represents the phase of the moon
693  
694 Param: C<id> - string - The id that the moon SVG part should use
695  
696 Param: C<x> - float - The X coordinate of the left hand side of the moon to be drawn
697  
698 Param: C<y> - float - The Y coordinate of the top side of the moon to be drawn
699  
700 Param: C<r> - float - The Radius of the the moon to be drawn
701  
702 Return: SVG part - The SVG to display the moon in the phase passed in
703  
704 Description: From the phase information this function calculates the details
705 of the curve to represent the phase of the moon and puts it on the diagram
706 based on the x, y and r parameters.
707  
708 =head3 C<get_moon_phase ( $date )>
709  
710 Param: C<$date> - date (DateTime object or string to convert to one) - The
711 date that the moon phase is desired
712  
713 Return: float - The phase of the moon from 0 (new moon) via 2 (full moon) to
714 < 4 (next new moon)
715  
716 Description: This method calculates the phase of the moon (it will what ever
717 it can find to calculate the phase)
718  
719 =head1 DIAGNOSTICS
720  
721 A list of every error and warning message that the module can generate (even
722 the ones that will "never happen"), with a full explanation of each problem,
723 one or more likely causes, and any suggested remedies.
724  
725 =head1 CONFIGURATION AND ENVIRONMENT
726  
727 A full explanation of any configuration system(s) used by the module, including
728 the names and locations of any configuration files, and the meaning of any
729 environment variables or properties that can be set. These descriptions must
730 also include details of any configuration language used.
731  
732 =head1 DEPENDENCIES
733  
734 A list of all of the other modules that this module relies upon, including any
735 restrictions on versions, and an indication of whether these required modules
736 are part of the standard Perl distribution, part of the module's distribution,
737 or must be installed separately.
738  
739 =head1 INCOMPATIBILITIES
740  
741 A list of any modules that this module cannot be used in conjunction with.
742 This may be due to name conflicts in the interface, or competition for system
743 or program resources, or due to internal limitations of Perl (for example, many
744 modules that use source code filters are mutually incompatible).
745  
746 =head1 BUGS AND LIMITATIONS
747  
748 A list of known problems with the module, together with some indication of
749 whether they are likely to be fixed in an upcoming release.
750  
751 Also, a list of restrictions on the features the module does provide: data types
752 that cannot be handled, performance issues and the circumstances in which they
753 may arise, practical limitations on the size of data sets, special cases that
754 are not (yet) handled, etc.
755  
756 The initial template usually just has:
757  
758 There are no known bugs in this module.
759  
760 Please report problems to Ivan Wills (ivan.wills@gmail.com).
761  
762 Patches are welcome.
763  
764 =head1 AUTHOR
765  
766 Ivan Wills - (ivan.wills@gmail.com)
767 <Author name(s)> (<contact address>)
768  
769 =head1 LICENSE AND COPYRIGHT
770  
771 Copyright (c) 2006-2009 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077)
772 All rights reserved.
773  
774  
775 This module is free software; you can redistribute it and/or modify it under
776 the same terms as Perl itself. See L<perlartistic>. This program is
777 distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
778 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
779 PARTICULAR PURPOSE.
780  
781 =cut
« blib/script/svgcal.pl ↑ Summary Build »