r23156 - in /branches/upstream/libcddb-file-perl: ./ current/ current/data/ current/lib/ current/lib/CDDB/ current/t/
roam-guest at users.alioth.debian.org
roam-guest at users.alioth.debian.org
Mon Jul 14 13:18:04 UTC 2008
Author: roam-guest
Date: Mon Jul 14 13:18:04 2008
New Revision: 23156
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=23156
Log:
[svn-inject] Installing original source of libcddb-file-perl
Added:
branches/upstream/libcddb-file-perl/
branches/upstream/libcddb-file-perl/current/
branches/upstream/libcddb-file-perl/current/Changes
branches/upstream/libcddb-file-perl/current/MANIFEST
branches/upstream/libcddb-file-perl/current/MANIFEST.SKIP
branches/upstream/libcddb-file-perl/current/META.yml
branches/upstream/libcddb-file-perl/current/Makefile.PL
branches/upstream/libcddb-file-perl/current/README
branches/upstream/libcddb-file-perl/current/data/
branches/upstream/libcddb-file-perl/current/data/9a0bed0d
branches/upstream/libcddb-file-perl/current/data/be0c140e
branches/upstream/libcddb-file-perl/current/data/ee074b12
branches/upstream/libcddb-file-perl/current/lib/
branches/upstream/libcddb-file-perl/current/lib/CDDB/
branches/upstream/libcddb-file-perl/current/lib/CDDB/File.pm (with props)
branches/upstream/libcddb-file-perl/current/t/
branches/upstream/libcddb-file-perl/current/t/pod-coverage.t
branches/upstream/libcddb-file-perl/current/t/pod.t
branches/upstream/libcddb-file-perl/current/t/readfile.t
Added: branches/upstream/libcddb-file-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/Changes?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/Changes (added)
+++ branches/upstream/libcddb-file-perl/current/Changes Mon Jul 14 13:18:04 2008
@@ -1,0 +1,41 @@
+Revision history
+
+1.05 Tue Oct 4 11:22:23 UTC 2005
+ - Quote PREREQs in Makefile.PL to keep broken 5.8.0 happy
+
+1.04 Sat Sep 3 15:19:08 UTC 2005
+ - Remove obsolete submitted_by (should be using submitted_via)
+
+1.03 Wed Aug 21 2002
+ - Handle length as "dddd secs" as well as "dddd seconds"
+ (Thanks to Andy Warley)
+
+1.02 Tue Feb 19 2002
+ - Only extract separate artist for song titles if the CD artist
+ is "Various" (as per specification).
+
+1.01 Sat Feb 9 2002
+ - Loosen match for titles to split on any amount of whitespace
+
+0.96 Mon Dec 24 2001
+ - Loosen match for offsets. Some CD files have no spaces before
+ these.
+
+0.95 Sun Dec 23 2001
+ - Allow access to the track offsets directly
+
+0.94 Sat Dec 8 2001
+ - Added support for 'processed_by'
+ - renamed 'submitted_by' to 'submitted_via'
+
+0.93 Wed Dec 5 2001
+ - Fixed bug where track offsets were being calculated incorrectly
+ for some files with slightly different data format
+
+0.92 Tue Dec 4 2001
+ - Added support for 'artist' info in tracks on compilations
+
+0.91 Mon Dec 3 2001
+ - Created this
+
+
Added: branches/upstream/libcddb-file-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/MANIFEST?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/MANIFEST (added)
+++ branches/upstream/libcddb-file-perl/current/MANIFEST Mon Jul 14 13:18:04 2008
@@ -1,0 +1,13 @@
+Changes
+data/9a0bed0d
+data/be0c140e
+data/ee074b12
+lib/CDDB/File.pm
+Makefile.PL
+MANIFEST
+MANIFEST.SKIP
+META.yml Module meta-data (added by MakeMaker)
+README
+t/pod-coverage.t
+t/pod.t
+t/readfile.t
Added: branches/upstream/libcddb-file-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/MANIFEST.SKIP?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libcddb-file-perl/current/MANIFEST.SKIP Mon Jul 14 13:18:04 2008
@@ -1,0 +1,32 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+,B$
+,D$
+\B\.svn\b
+aegis.log$
+\bconfig$
+\bbuild$
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build
+
+# Avoid temp and backup files.
+~$
+\.gz$
+\.old$
+\.bak$
+\.swp$
+\.tdy$
+\#$
+\b\.#
+
Added: branches/upstream/libcddb-file-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/META.yml?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/META.yml (added)
+++ branches/upstream/libcddb-file-perl/current/META.yml Mon Jul 14 13:18:04 2008
@@ -1,0 +1,11 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: CDDB-File
+version: 1.05
+version_from: lib/CDDB/File.pm
+installdirs: site
+requires:
+ Test::More: 0.17
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17
Added: branches/upstream/libcddb-file-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/Makefile.PL?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/Makefile.PL (added)
+++ branches/upstream/libcddb-file-perl/current/Makefile.PL Mon Jul 14 13:18:04 2008
@@ -1,0 +1,9 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ NAME => 'CDDB::File',
+ AUTHOR => 'Tony Bowden <kasei at tmtm.com>',
+ VERSION_FROM => 'lib/CDDB/File.pm',
+ ABSTRACT_FROM => 'lib/CDDB/File.pm',
+ PREREQ_PM => { 'Test::More' => 0.17, },
+);
Added: branches/upstream/libcddb-file-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/README?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/README (added)
+++ branches/upstream/libcddb-file-perl/current/README Mon Jul 14 13:18:04 2008
@@ -1,0 +1,103 @@
+NAME
+ CDDB::File - Parse a CDDB/freedb data file
+
+SYNOPSIS
+ my $disc = CDDB::File->new("rock/f4109511");
+
+ print $disc->id, $disc->all_ids;
+ print $disc->artist, $disc->title;
+ print $disc->year, $disc->genre, $disc->extd;
+ print $disc->length, $disc->track_count;
+
+ print $disc->revision, $disc->submitted_via, $disc->processed_by;
+
+ foreach my $track ($disc->tracks) {
+ print $track->number, $track->title, $track->artist;
+ print $track->length, $track->extd;
+ }
+
+DESCRIPTION
+ This module provides an interface for extracting data from CDDB-format
+ data files, as used by freedb.
+
+ It does not read data from your CD, or submit information to freedb.
+
+METHODS
+ new
+ my $disc = CDDB::File->new("rock/f4109511");
+
+ This will create a new object representing the data in the file name
+ specified.
+
+ id / all_ids
+ my $discid = $disc->id;
+ my @discid = $disc->all_ids;
+
+ Due to how freedb works, one CD may have several IDs associated with it.
+ 'id' will return the first of these (not necessarily related to the
+ filename from which this was read), whilst 'all_ids' will return all of
+ them.
+
+ title / artist
+ The title and artist of this CD. For eponymous CDs these will be
+ identical, even if the data file leaves the artist field blank.
+
+ year
+ The (4-digit) year of release.
+
+ genre
+ The genre of this CD. This is the genre as stored in the data file
+ itself, which is not related to the 11 main freedb genres.
+
+ extd
+ The "extended data" for the CD. This is used for storing miscellaneous
+ information which has no better storage place, and can be of any length.
+
+ length
+ The run time of the CD in seconds.
+
+ track_count
+ The number of tracks on the CD.
+
+ revision
+ Each time information regarding the CD is updated this revision number
+ is incremented. This returns the revision number of this version.
+
+ processed_by / submitted_via
+ The software which submitted this information to freedb and which
+ processed it at the other end.
+
+ tracks
+ foreach my $track ($disc->tracks) {
+ print $track->number, $track->title, $track->artist;
+ print $track->length, $track->extd;
+ }
+
+ Returns a list of Track objects, each of which knows its number
+ (numering from 1), title, length (in seconds), offset, and may also have
+ extended track data.
+
+ Tracks may also contain an 'artist' field. If this is not set the artist
+ method will return the artist of the CD.
+
+SEE ALSO
+ http://www.freedb.org/
+
+AUTHOR
+ Tony Bowden
+
+BUGS and QUERIES
+ Please direct all correspondence regarding this module to:
+ bug-CDDB-File at rt.cpan.org
+
+COPYRIGHT
+ Copyright (C) 2001-2005 Tony Bowden. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License; either version 2 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE.
+
Added: branches/upstream/libcddb-file-perl/current/data/9a0bed0d
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/data/9a0bed0d?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/data/9a0bed0d (added)
+++ branches/upstream/libcddb-file-perl/current/data/9a0bed0d Mon Jul 14 13:18:04 2008
@@ -1,0 +1,56 @@
+# xmcd CD database file
+# Copyright (C) 1996 Ti Kan
+#
+# Track frame offsets:
+# 183
+# 17295
+# 36375
+# 53063
+# 84555
+# 98718
+# 117013
+# 135803
+# 150515
+# 159580
+# 178073
+# 194040
+# 213028
+#
+# Disc length: 3055 seconds
+#
+# Revision: 1
+# Processed by: cddbd v1.4b41PL1 Copyright (c) Steve Scherf et al.
+# Submitted via: EasyCD 2.21 - (C) 1996 Greg Leichner
+#
+DISCID=9a0bed0d
+DTITLE=Chagall Guevara / Chagall Guevara
+DYEAR=
+DGENRE=
+TTITLE0=Murder In The Big House
+TTITLE1=Escher's World
+TTITLE2=Play God
+TTITLE3=Monkey Grinder
+TTITLE4=Can't You Feel The Chains ?
+TTITLE5=Violent Blue
+TTITLE6=Love Is A Dead Language
+TTITLE7=Take Me Back To Love Canal
+TTITLE8=The Wrong George
+TTITLE9=Candy Guru
+TTITLE10=I Need Somebody
+TTITLE11=The Rub Of Love
+TTITLE12=If It All Comes True
+EXTD=
+EXTT0=
+EXTT1=
+EXTT2=
+EXTT3=
+EXTT4=
+EXTT5=
+EXTT6=
+EXTT7=
+EXTT8=
+EXTT9=
+EXTT10=
+EXTT11=
+EXTT12=
+PLAYORDER=
Added: branches/upstream/libcddb-file-perl/current/data/be0c140e
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/data/be0c140e?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/data/be0c140e (added)
+++ branches/upstream/libcddb-file-perl/current/data/be0c140e Mon Jul 14 13:18:04 2008
@@ -1,0 +1,59 @@
+# xmcd CD database file
+# Copyright (C) 1995-1998 Ti Kan
+#
+# Track frame offsets:
+# 150
+# 15030
+# 34935
+# 50752
+# 66790
+# 84827
+# 106260
+# 124360
+# 141017
+# 154050
+# 168782
+# 187235
+# 200825
+# 218000
+#
+# Disc length: 3094 seconds
+#
+# Revision: 6
+# Processed by: cddbd v1.4b42PL1 Copyright (c) Steve Scherf et al.
+# Submitted via: audiograbber 1.80
+#
+DISCID=af10420e,be0c140e
+DTITLE=Various / Clueless Soundtrack
+DYEAR=
+DGENRE=Rock
+TTITLE0=The Muffs / Kids In America
+TTITLE1=Cracker / Shake Some Action
+TTITLE2=Counting Crows / The Ghost In You
+TTITLE3=Here (Squirmel Mix)
+TTITLE4=World Party / All The Young Dudes
+TTITLE5=Radiohead / Fake Plastic Trees (Acoustic Version)
+TTITLE6=Lightning Seeds / Change
+TTITLE7=Smoking Popes / Need You Around
+TTITLE8=Beastie Boys / Mullet Head
+TTITLE9=Mighty Mighty Bosstones / Where'd You Go
+TTITLE10=Coolio / Rollin' With My Homies
+TTITLE11=Supergrass / Alright
+TTITLE12=Velocity Girl / My Forgotton Favorite
+TTITLE13=Jill Sobule / Supermodel
+EXTD=\n YEAR: 1995 ID3G: 17
+EXTT0=
+EXTT1=
+EXTT2=
+EXTT3=
+EXTT4=
+EXTT5=
+EXTT6=
+EXTT7=
+EXTT8=
+EXTT9=
+EXTT10=
+EXTT11=
+EXTT12=
+EXTT13=
+PLAYORDER=
Added: branches/upstream/libcddb-file-perl/current/data/ee074b12
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/data/ee074b12?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/data/ee074b12 (added)
+++ branches/upstream/libcddb-file-perl/current/data/ee074b12 Mon Jul 14 13:18:04 2008
@@ -1,0 +1,72 @@
+# xmcd CD database file generated by Grip 2.95
+#
+# Track frame offsets:
+# 182
+# 3220
+# 5187
+# 17127
+# 31505
+# 51782
+# 54577
+# 58947
+# 70180
+# 74390
+# 78905
+# 84597
+# 90200
+# 94427
+# 97450
+# 103137
+# 109690
+# 133780
+#
+# Disc length: 1869 secs
+#
+# Revision: 3
+# Processed by: cddbd v1.4b42PL1 Copyright (c) Steve Scherf et al.
+# Submitted via: Grip 2.95
+#
+DISCID=ee074b12
+DTITLE=Zbigniew Preisner / The double life of Veronika/Kieslowski
+DYEAR=1991
+DGENRE=Classical
+TTITLE0=Weronika
+TTITLE1=Vironique
+TTITLE2=You will come
+TTITLE3=Childhood
+TTITLE4=Van den Budenmayer
+TTITLE5=Vironique (2)
+TTITLE6=Solitude
+TTITLE7=The Puppets
+TTITLE8=Theme : 1st transcription
+TTITLE9=Childhood II
+TTITLE10=Alexander
+TTITLE11=Alexander II
+TTITLE12=Theme / 2nd transc
+TTITLE12=ription
+TTITLE13=Concerto in e 1
+TTITLE14=Concerto in e 2
+TTITLE15=Concerto in e 3
+TTITLE16=Van den Budenmayer (2)
+TTITLE17=End Credits
+EXTD=The soundtrack to La Double Vie De Veronique
+EXTT0=Open
+EXTT0=ing song
+EXTT1=
+EXTT2=
+EXTT3=
+EXTT4=
+EXTT5=
+EXTT6=
+EXTT7=
+EXTT8=
+EXTT9=
+EXTT10=
+EXTT11=
+EXTT12=
+EXTT13=
+EXTT14=
+EXTT15=
+EXTT16=
+EXTT17=
+PLAYORDER=
Added: branches/upstream/libcddb-file-perl/current/lib/CDDB/File.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/lib/CDDB/File.pm?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/lib/CDDB/File.pm (added)
+++ branches/upstream/libcddb-file-perl/current/lib/CDDB/File.pm Mon Jul 14 13:18:04 2008
@@ -1,0 +1,272 @@
+package CDDB::File;
+
+$VERSION = '1.05';
+
+=head1 NAME
+
+CDDB::File - Parse a CDDB/freedb data file
+
+=head1 SYNOPSIS
+
+ my $disc = CDDB::File->new("rock/f4109511");
+
+ print $disc->id, $disc->all_ids;
+ print $disc->artist, $disc->title;
+ print $disc->year, $disc->genre, $disc->extd;
+ print $disc->length, $disc->track_count;
+
+ print $disc->revision, $disc->submitted_via, $disc->processed_by;
+
+ foreach my $track ($disc->tracks) {
+ print $track->number, $track->title, $track->artist;
+ print $track->length, $track->extd;
+ }
+
+=head1 DESCRIPTION
+
+This module provides an interface for extracting data from CDDB-format
+data files, as used by freedb.
+
+It does not read data from your CD, or submit information to freedb.
+
+=head1 METHODS
+
+=head2 new
+
+ my $disc = CDDB::File->new("rock/f4109511");
+
+This will create a new object representing the data in the file name
+specified.
+
+=head2 id / all_ids
+
+ my $discid = $disc->id;
+ my @discid = $disc->all_ids;
+
+Due to how freedb works, one CD may have several IDs associated with
+it. 'id' will return the first of these (not necessarily related to the
+filename from which this was read), whilst 'all_ids' will return all
+of them.
+
+=head2 title / artist
+
+The title and artist of this CD. For eponymous CDs these will be
+identical, even if the data file leaves the artist field blank.
+
+=head2 year
+
+The (4-digit) year of release.
+
+=head2 genre
+
+The genre of this CD. This is the genre as stored in the data file itself,
+which is not related to the 11 main freedb genres.
+
+=head2 extd
+
+The "extended data" for the CD. This is used for storing miscellaneous
+information which has no better storage place, and can be of any length.
+
+=head2 length
+
+The run time of the CD in seconds.
+
+=head2 track_count
+
+The number of tracks on the CD.
+
+=head2 revision
+
+Each time information regarding the CD is updated this revision number
+is incremented. This returns the revision number of this version.
+
+=head2 processed_by / submitted_via
+
+The software which submitted this information to freedb and which
+processed it at the other end.
+
+=head2 tracks
+
+ foreach my $track ($disc->tracks) {
+ print $track->number, $track->title, $track->artist;
+ print $track->length, $track->extd;
+ }
+
+Returns a list of Track objects, each of which knows its number (numering
+from 1), title, length (in seconds), offset, and may also have extended
+track data.
+
+Tracks may also contain an 'artist' field. If this is not set the artist
+method will return the artist of the CD.
+
+=cut
+
+use strict;
+use IO::File;
+
+sub new {
+ my ($class, $file) = @_;
+ my $fh = new IO::File $file, "r" or die "Can't read $file\n";
+ chomp(my @data = <$fh>);
+ bless {
+ _data => \@data,
+ }, $class;
+}
+
+sub _data { @{shift->{_data}} }
+
+sub id { (shift->all_ids)[0] }
+sub all_ids { split /,/, shift->_get_lines("DISCID=") }
+sub year { shift->_get_lines("DYEAR=") }
+sub genre { shift->_get_lines("DGENRE=") }
+sub extd { shift->_get_lines("EXTD=") }
+sub revision { shift->_get_lines("# Revision: ") }
+sub submitted_via { shift->_get_lines("# Submitted via: ") }
+sub processed_by { shift->_get_lines("# Processed by: ") }
+
+sub _offsets {
+ my $self = shift;
+ my $from = $self->_offset_line;
+ ((grep s/^#\s*//, ($self->_data)[$from + 1 .. $from + $self->track_count]),
+ $self->length * 75);
+}
+
+sub _offset_line {
+ my $self = shift;
+ my @data = $self->_data;
+ foreach (0 .. $#data) {
+ return $_ if $data[$_] =~ /^# Track frame offsets/;
+ }
+ return 2;
+}
+
+sub length {
+ my $length = shift->_get_lines("# Disc length: ");
+ $length =~ s/ sec(ond)?s//;
+ return $length;
+}
+
+sub _title_line {
+ my $self = shift;
+ $self->{_title_line} ||= $self->_get_lines("DTITLE=")
+}
+
+sub _split_title {
+ my $self = shift;
+ ($self->{_artist}, $self->{_title}) = split /\s+\/\s+/, $self->_title_line, 2;
+ $self->{_title} ||= $self->{_artist};
+}
+
+sub title {
+ my $self = shift;
+ $self->_split_title unless defined $self->{_title};
+ $self->{_title};
+}
+
+sub artist {
+ my $self = shift;
+ $self->_split_title unless defined $self->{_artist};
+ $self->{_artist};
+}
+
+sub tracks {
+ my $self = shift;
+ my @title = $self->_get_multi_lines("TTITLE");
+ my @extd = $self->_get_multi_lines("EXTT");
+ my @offset = $self->_offsets;
+ return map {
+ bless {
+ _cd => $self,
+ _number => $_+1,
+ _tline => $title[$_],
+ _extd => $extd[$_],
+ _offset => $offset[$_],
+ _length => int(($offset[$_+1] - $offset[$_]) / 75),
+ }, 'CDDB::File::Track'
+ } 0 .. $self->_highest_track_no;
+}
+
+sub _get_lines {
+ my ($self, $keyword) = @_;
+ join "", grep s/^${keyword}//, $self->_data;
+}
+
+sub _get_multi_lines {
+ my ($self, $keyword) = @_;
+ map $self->_get_lines("${keyword}$_="), 0 .. $self->_highest_track_no;
+}
+
+sub _highest_track_no {
+ my $self = shift;
+ $self->{_high} ||= pop @{[ map /^TTITLE(\d+)=/, $self->_data ]}
+}
+
+sub track_count { shift->_highest_track_no + 1 }
+
+# ==================================================================== #
+
+package CDDB::File::Track;
+
+use overload
+ '""' => 'title';
+
+sub cd { shift->{_cd} }
+sub extd { shift->{_extd} }
+sub length { shift->{_length}}
+sub number { shift->{_number}}
+sub offset { shift->{_offset}}
+
+sub _split_title {
+ my $self = shift;
+ if ($self->cd->artist eq "Various") {
+ ($self->{_artist}, $self->{_title}) = split /\s+\/\s+/, $self->{_tline}, 2
+ } else {
+ $self->{_title} = $self->{_tline};
+ $self->{_artist} = $self->cd->artist;
+ }
+
+ unless ($self->{_title}) {
+ $self->{_title} = $self->{_artist};
+ $self->{_artist} = $self->cd->artist;
+ }
+}
+
+sub title {
+ my $self = shift;
+ $self->_split_title unless defined $self->{_title};
+ $self->{_title};
+}
+
+sub artist {
+ my $self = shift;
+ $self->_split_title unless defined $self->{_artist};
+ $self->{_artist};
+}
+
+1;
+
+=head1 SEE ALSO
+
+http://www.freedb.org/
+
+=head1 AUTHOR
+
+Tony Bowden
+
+=head1 BUGS and QUERIES
+
+Please direct all correspondence regarding this module to:
+ bug-CDDB-File at rt.cpan.org
+
+=head1 COPYRIGHT
+
+ Copyright (C) 2001-2005 Tony Bowden. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License; either version 2 of the License,
+ or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE.
+
Propchange: branches/upstream/libcddb-file-perl/current/lib/CDDB/File.pm
------------------------------------------------------------------------------
svn:executable =
Added: branches/upstream/libcddb-file-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/t/pod-coverage.t?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/t/pod-coverage.t (added)
+++ branches/upstream/libcddb-file-perl/current/t/pod-coverage.t Mon Jul 14 13:18:04 2008
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod::Coverage 1.00";
+plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
+all_pod_coverage_ok();
Added: branches/upstream/libcddb-file-perl/current/t/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/t/pod.t?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/t/pod.t (added)
+++ branches/upstream/libcddb-file-perl/current/t/pod.t Mon Jul 14 13:18:04 2008
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
Added: branches/upstream/libcddb-file-perl/current/t/readfile.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcddb-file-perl/current/t/readfile.t?rev=23156&op=file
==============================================================================
--- branches/upstream/libcddb-file-perl/current/t/readfile.t (added)
+++ branches/upstream/libcddb-file-perl/current/t/readfile.t Mon Jul 14 13:18:04 2008
@@ -1,0 +1,64 @@
+#!/usr/bin/perl -w
+
+use Test::More tests => 35;
+use CDDB::File;
+use strict;
+
+my $file = "data/ee074b12";
+my $disc = CDDB::File->new($file);
+
+isa_ok $disc, 'CDDB::File';
+
+is $disc->title, "The double life of Veronika/Kieslowski", "title";
+is $disc->artist, "Zbigniew Preisner", "artist";
+is $disc->year, 1991, "year";
+is $disc->genre, "Classical", "genre";
+is $disc->extd, "The soundtrack to La Double Vie De Veronique", "extd";
+is $disc->length, 1869, "length";
+is $disc->revision, 3, "revision no";
+is $disc->submitted_via, "Grip 2.95", "submitter";
+is $disc->processed_by, "cddbd v1.4b42PL1 Copyright (c) Steve Scherf et al.",
+ "processed by";
+
+is $disc->track_count, 18, "track count";
+
+my @tracks = $disc->tracks;
+is scalar @tracks, 18, "So 18 tracks";
+
+isa_ok $tracks[0], 'CDDB::File::Track';
+isa_ok $tracks[17], 'CDDB::File::Track';
+is $tracks[0]->number, 1, "Track number";
+is $tracks[0]->title, 'Weronika', "Track title";
+is $tracks[0]->artist, "Zbigniew Preisner", "Track artist = CD artist";
+is $tracks[0]->extd, 'Opening song', "Track extd info";
+is $tracks[12]->number, 13, 'Track number';
+is $tracks[12]->title, 'Theme / 2nd transcription', "multi-line title";
+
+is $tracks[0]->length, 40, "first song length";
+is $tracks[17]->length, 85, "last song length";
+
+{
+ my $file = "data/be0c140e";
+ my $disc = CDDB::File->new($file);
+ is $disc->id, "af10420e", "ID correct";
+ is $disc->year, '', "year";
+ my @ids = $disc->all_ids;
+ is scalar @ids, 2, "Disc has 2 ids";
+ ok eq_set(\@ids, [qw/af10420e be0c140e/]), "Both correct";
+ my @tracks = $disc->tracks;
+ is $tracks[3]->artist, "Various", "no track artist";
+ is $tracks[5]->artist, "Radiohead", "track artist";
+ is $tracks[13]->artist, "Jill Sobule", "track artist";
+ is $tracks[13]->length, 187, "last song length";
+ is $tracks[0]->offset, 150, "Starting offset 150";
+ is $tracks[-1]->offset, 218000, "Final offset";
+}
+
+{
+ my $file = "data/9a0bed0d";
+ my $disc = CDDB::File->new($file);
+ is $disc->id, "9a0bed0d", "ID correct";
+ is $disc->artist, "Chagall Guevara", "Artist";
+ is $disc->title, "Chagall Guevara", " same as title";
+}
+
More information about the Pkg-perl-cvs-commits
mailing list