File Coverage

blib/lib/MP3/CreateInlayCard.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 16 87.5


line stmt bran cond sub pod time code
1             package MP3::CreateInlayCard;
2              
3             our $VERSION = '0.06';
4              
5             # $Id: CreateInlayCard.pm 535 2009-02-13 23:26:32Z davidp $
6              
7 1     1   43481 use strict;
  1         3  
  1         41  
8 1     1   5 use warnings;
  1         2  
  1         32  
9 1     1   1118 use File::Find::Rule;
  1         14303  
  1         11  
10 1     1   632 use Music::Tag;
  0            
  0            
11             use Cwd;
12             use HTML::Template;
13              
14             =head1 NAME
15              
16             MP3::CreateInlayCard - create a CD inlay label for a directory of MP3 files
17              
18             =head1 SYNOPSIS
19              
20             use MP3::CreateInlayCard;
21             print MP3::CreateInlayCard::create_inlay(
22             {dir => $dir, template => $template});
23            
24             # $dir is the directory containing the MP3 files. If not specified, we'll
25             # use the current directory.
26             # $template is the filename of a template which HTML::Template should
27             # read and populate. Alternatively, it can be a scalar reference, in which
28             # case it will be taken to be the template contents to use. If it's not
29             # supplied, a simple default built-in template will be used.
30            
31             # If you can't be bothered to write a script to call this module, use
32             # 'makeinlay.pl' distributed with this package, or just do:
33             perl -MMP3::CreateInlayCard -e \
34             "print MP3::CreateInlayCard(create_inlay({ (see example above) });"
35            
36             # If you're in the directory containing the MP3's, and you want to use the
37             # built-in default template, just supply an empty hashref:
38             perl -MMP3::CreateInlayCard \
39             -e "print MP3::CreateInlayCard(create_inlay({});"
40            
41             # or, more easily, use the eg/createinlay.pl script supplied with this
42             # module. (Perhaps copy it to somewhere in your path and rename it to
43             # 'createinlay', so you can just change directory into the appropriate
44             # place and type 'createinlay').
45            
46            
47             =head1 DESCRIPTION
48              
49             Reads a directory of MP3s, and produces a HTML file you can print for a nice
50             "inlay" for a CD case. Useful if you're burning a directory full of MP3s
51             to a CD, and want an inlay label created for you.
52              
53             =cut
54              
55              
56             =head1 FUNCTIONS
57              
58             =over 4
59              
60             =item create_inlay
61              
62             Go through the specified directory and produce the inlay.
63              
64             Takes a hashref of:
65              
66             =over 4
67              
68             =item I
69              
70             The directory containing the MP3 files
71              
72             =item I