@@ -1,29 +1,9 @@
-Revision history for WWW-Scraper-ISBN-Record
-============================================
+Revision history for Perl extension WWW::Scraper::ISBN::Record.
-0.21 2014-05-20
- - fixed distribution name in META.
+0.17 - 04/06/2004 - A. Schamp
+ Removed exporter and perl version stuff
+ at user request.
-0.20 2014-04-06
- - added LICENSE file.
- - added deprecation warning.
-
-0.19 2013-08-27
- - American dates!
- - cleaned up code.
- - added new test script.
-
-0.18 2013-08-25
- - New Maintainer: Barbie.
- - move module into lib directory structure.
- - change file dates changed to meet W3CDTF standards.
- - reworked Makefile.PL for clarity.
- - added META.json and updated META.yml.
- - extended test suite.
-
-0.17 2004-04-06
- - Removed exporter and perl version stuff at user request.
-
-0.16 2004-03-30
- - Started using Changes file.
- - Fixed some documentation.
+0.16 - 03/30/2004 - A. Schamp
+ Started using Changes file.
+ Fixed some documentation.
@@ -1,7 +0,0 @@
-LICENSE for WWW-Scraper-ISBN-Record
-
-Copyright © 2004-2013 Andy Schamp, andy@schamp.net
-Copyright © 2013-2014 Barbie for Miss Barbell Productions.
-
-This distribution is free software; you can redistribute it and/or
-modify it under the Artistic Licence v2.
@@ -1,15 +1,6 @@
Changes
-lib/WWW/Scraper/ISBN/Record.pm
-LICENSE
Makefile.PL
MANIFEST
-META.json
-META.yml
README
-t/01base.t
-t/10object.t
-t/90podtest.t
-t/91podcover.t
-t/94metatest.t
-t/95changedate.t
-t/96metatest.t
+Record.pm
+t/1.t
@@ -1,62 +0,0 @@
-{
- "name": "WWW-Scraper-ISBN-Record",
- "version": "0.21",
- "abstract": "Book Record class for WWW::Scraper::ISBN module",
- "author": [
- "Andy Schamp <andy@schamp.net>",
- "Barbie <barbie@cpan.org>"
- ],
-
- "license": "artistic_2",
- "dynamic_config" : 0,
- "release_status" : "stable",
- "meta-spec": {
- "version": "2",
- "url": "http://search.cpan.org/dist/CPAN-Meta/lib/CPAN/Meta/Spec.pm"
- },
- "generated_by": "Hand 1.0",
- "keywords" : [
- "isbn",
- "books"
- ],
-
- "prereqs" : {
- "runtime" : {
- "requires" : {
- "perl": "5.006"
- }
- },
- "test" : {
- "requires": {
- "IO::File": "0",
- "Test::More": "0.70"
- },
- "recommends": {
- "Test::CPAN::Meta": "0",
- "Test::CPAN::Meta::JSON": "0",
- "Test::Pod": "1.00",
- "Test::Pod::Coverage": "0.08"
- }
- }
- },
-
- "provides": {
- "WWW::Scraper::ISBN::Record": {
- "file": "lib/WWW/Scraper/ISBN/Record.pm",
- "version": "0.21"
- }
- },
- "no_index": {
- "directory": ["t","examples"]
- },
-
- "resources": {
- "license": "http://www.perlfoundation.org/artistic_license_2_0",
- "bugtracker": { "web": "http://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Scraper-ISBN-Record" },
- "repository": {
- "url": "git://github.com/barbie/www-scraper-isbn-record.git",
- "web": "http://github.com/barbie/www-scraper-isbn-record",
- "type": "git"
- }
- }
-}
@@ -1,42 +0,0 @@
---- #YAML:1.0
-name: WWW-Scraper-ISBN-Record
-version: 0.21
-abstract: Book Record class for WWW::Scraper::ISBN module
-author:
- - Andy Schamp <andy@schamp.net>
- - Barbie <barbie@cpan.org>
-
-license: artistic_2
-distribution_type: module
-installdirs: site
-
-requires:
- perl: 5.006
-recommends:
- Test::CPAN::Meta: 0
- Test::CPAN::Meta::JSON: 0
- Test::Pod: 1.00
- Test::Pod::Coverage: 0.08
-build_requires:
- IO::File: 0
- Test::More: 0.70
-
-provides:
- WWW::Scraper::ISBN::Record:
- file: lib/WWW/Scraper/ISBN/Record.pm
- version: 0.21
-
-no_index:
- directory:
- - t
- - examples
-
-resources:
- license: http://www.perlfoundation.org/artistic_license_2_0
- bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=WWW-Scraper-ISBN-Record
- repository: http://github.com/barbie/www-scraper-isbn-record
-
-meta-spec:
- version: 1.4
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
-generated_by: Hand 1.0
@@ -1,22 +1,10 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-use 5.006;
-
use ExtUtils::MakeMaker;
-
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
WriteMakefile(
- AUTHOR => 'Barbie <barbie@cpan.org>',
- NAME => 'WWW-Scraper-ISBN-Record',
- VERSION_FROM => 'lib/WWW/Scraper/ISBN/Record.pm',
- ABSTRACT => 'Book Record class for WWW::Scraper::ISBN module',
- NO_META => 1,
- PREREQ_PM => {
-
- # build/test prereqs
- 'IO::File' => '0',
- 'Test::More' => '0.70'
-
- }
+ 'NAME' => 'WWW::Scraper::ISBN::Record',
+ 'VERSION_FROM' => 'Record.pm', # finds $VERSION
+ 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (AUTHOR => 'Andy Schamp <ams5@calvin.edu>') : ()),
);
@@ -1,22 +1,12 @@
-WWW-Scraper-ISBN-Record
-=======================
-
-WARNING:
-
-This distribution will be deprecated in the near future. The module within is
-to be merged into the main WWW-Scraper-ISBN distribution.
-
-DESCRIPTION
+WWW/Scraper/ISBN/Record version 0.16
+====================================
WWW::Scraper::ISBN::Record - Book Record class for WWW::Scraper::ISBN module.
-The WWW::Scraper::ISBN::Record module defines a class that can be used to deal
-with book information. It was primarily created as a return type for the
-WWW::Scraper::ISBN module, though it could be used for other purposes. It
-knows minimal information about itself, whether the book was found, where it
-was found, its ISBN number, and whether any errors occurred. It is usually up
-to the WWW::Scraper::ISBN::Driver and its subclasses to make sure that the
-fields get set correctly.
+The WWW::Scraper::ISBN::Record module defines a class that can be used to deal with book information. It was primarily
+created as a return type for the WWW::Scraper::ISBN module, though it could be used for other purposes. It knows minimal
+information about itself, whether the book was found, where it was found, its ISBN number, and whether any errors occurred.
+It is usually up to the WWW::Scraper::ISBN::Driver and its subclasses to make sure that the fields get set correctly.
INSTALLATION
@@ -35,8 +25,10 @@ None, though it is required by WWW::Scraper::ISBN
COPYRIGHT AND LICENCE
- Copyright (C) 2004-2013 Andy Schamp, andy@schamp.net
- Copyright (C) 2013-2014 Barbie, barbie@cpan.org
+Put the correct copyright and licence information here.
+
+Copyright (C) 2004 Andy Schamp
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
- This distribution is free software; you can redistribute it and/or
- modify it under the Artistic Licence v2.
@@ -0,0 +1,185 @@
+package WWW::Scraper::ISBN::Record;
+
+use strict;
+use warnings;
+
+our $VERSION = '0.17';
+
+
+# Preloaded methods go here.
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ $self->{ISBN} = undef;
+ $self->{FOUND} = 0;
+ $self->{FOUND_IN} = undef;
+ $self->{BOOK} = undef;
+ $self->{ERROR} = "";
+ bless ($self, $class);
+ return $self;
+}
+
+sub isbn {
+ my $self = shift;
+ if (@_) { $self->{ISBN} = shift };
+ return $self->{ISBN};
+}
+
+sub found {
+ my $self = shift;
+ if (@_) { $self->{FOUND} = shift };
+ return $self->{FOUND};
+}
+
+sub found_in {
+ my $self = shift;
+ if (@_) { $self->{FOUND_IN} = shift };
+ return $self->{FOUND_IN};
+}
+
+sub book {
+ my $self = shift;
+ if (@_) { $self->{BOOK} = shift };
+ return $self->{BOOK};
+}
+
+sub error {
+ my $self = shift;
+ if (@_) { $self->{ERROR} = shift };
+ return $self->{ERROR};
+}
+
+1;
+__END__
+
+# Documentation
+
+=head1 NAME
+
+WWW::Scraper::ISBN::Record - Book Record class for L<WWW::Scraper::ISBN> module.
+
+=head1 SYNOPSIS
+
+used from within WWW::Scraper::ISBN. No need to invoke directly. But if you want to:
+
+ use WWW::Scraper::ISBN::Record;
+ $record = WWW::Scraper::ISBN::Record->new();
+
+ # It is usually best to let an instantiation of WWW::Scraper::ISBN create it and search for it.
+ # This class does not know how to search on its own.
+
+ print $record->isbn;
+
+ if ($record->found) {
+ print $record->found_in;
+ } else {
+ print "not found";
+ }
+
+ $book = $record->book;
+ print $book->{'title'};
+ print $book->{'author'};
+ # etc.
+
+ if ($record->error) { print $record->error(); }
+
+=head1 DESCRIPTION
+
+The WWW::Scraper::ISBN::Record module defines a class that can be used to deal with book information. It was primarily
+created as a return type for the L<WWW::Scraper::ISBN> module, though it could be used for other purposes. It knows minimal
+information about itself, whether the book was found, where it was found, its ISBN number, and whether any errors occurred.
+It is usually up to the L<WWW::Scraper::ISBN::Driver> and its subclasses to make sure that the fields get set correctly.
+
+=head2 EXPORT
+
+None by default.
+
+=head1 METHODS
+
+=over 4
+
+=item C<new()>
+
+Class Constructor. Usually invoked by C<< WWW::Scraper::ISBN->search() >>. Takes no parameters, creates an object with the
+default values:
+
+ isbn = undef;
+ found = 0;
+ found_in = undef;
+ book = undef;
+ error = "";
+
+=item C<isbn() or isbn($isbn_number)>
+
+ print $record->isbn; # returns the ISBN number string
+ $record->isbn("123456789X"); # set the ISBN
+
+Accessor/Mutator method for handling the ISBN associated with this record.
+
+=item C<found() or found($bool)>
+
+ if ($record->found) { # ... }
+ $record->found(1);
+
+Accessor/Mutator method for handling the search status of this record. This is 0 by default, and should only be set to
+true if the Record object contains the desired information, as retrieved by C<< WWW::Scraper::ISBN::Record->book() >>.
+
+=item C<found_in() or found_in($DRIVER_NAME)>
+
+ print $record->found_in;
+ $record->found_in("Driver_name");
+
+Accessor/Mutator method for handling the L<WWW::Scraper::ISBN::Driver> subclass that first successfully retrieved the
+desired record. Please note that this may depend upon the order in which the drivers are invoked, as set by
+C<< WWW::Scraper::ISBN->drivers() >>. Returns the driver name of the successful driver, e.g. "LOC" if found by
+C<< WWW::Scraper::ISBN::LOC_Driver->search() >>.
+
+=item C<book() or book($hashref)>
+
+ my $book = $record->book;
+ print $book->{'title'};
+ print $book->{'author'};
+ $another_book = { 'title' => "Some book title",
+ 'author' => "Author of some book"
+ };
+ $record->book( $another_book );
+
+Accessor/Mutator method for handling the book information retrieved by the driver. Set to a hashref by the driver, returns
+a hashref when invoked alone. The resulting hash should contain the standard fields as specified by
+L<WWW::Scraper::ISBN::Driver>, and possibly additional fields based on the driver used.
+
+=item C<error() or error($error_string)>
+
+ print $record->error;
+ $record->error("Invalid ISBN number, or some similar error.");
+
+Accessor/Mutator method for handling any errors which occur during the search. The search drivers may add errors to record
+fields, which may be useful in gleaning information about failed searches.
+
+=back
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<WWW::Scraper::ISBN>
+
+=item L<WWW::Scraper::ISBN::Driver>
+
+=back
+
+No mailing list or website currently available. Primary development done through CSX ( L<http://csx.calvin.edu/> ).
+
+=head1 AUTHOR
+
+Andy Schamp, E<lt>andy@schamp.netE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2004 by Andy Schamp
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
@@ -1,179 +0,0 @@
-package WWW::Scraper::ISBN::Record;
-
-use strict;
-use warnings;
-
-our $VERSION = '0.21';
-
-#----------------------------------------------------------------------------
-# Public API
-
-sub new {
- my $proto = shift;
- my $class = ref($proto) || $proto;
- my $self = {
- ISBN => undef,
- FOUND => 0,
- FOUND_IN => undef,
- BOOK => undef,
- ERROR => '',
- };
-
- bless ($self, $class);
- return $self;
-}
-
-sub isbn { my $self = shift; return $self->_accessor('ISBN',@_) }
-sub found { my $self = shift; return $self->_accessor('FOUND',@_) }
-sub found_in { my $self = shift; return $self->_accessor('FOUND_IN',@_) }
-sub book { my $self = shift; return $self->_accessor('BOOK',@_) }
-sub error { my $self = shift; return $self->_accessor('ERROR',@_) }
-
-sub _accessor {
- my $self = shift;
- my $accessor = shift;
- if (@_) { $self->{$accessor} = shift };
- return $self->{$accessor};
-}
-
-1;
-
-__END__
-
-# Documentation
-
-=head1 NAME
-
-WWW::Scraper::ISBN::Record - Book Record class for L<WWW::Scraper::ISBN> module.
-
-=head1 WARNING
-
-This distribution will be deprecated in the near future. The module within is
-to be merged into the main WWW-Scraper-ISBN distribution.
-
-=head1 SYNOPSIS
-
-used from within WWW::Scraper::ISBN. No need to invoke directly. But if you want to:
-
- use WWW::Scraper::ISBN::Record;
- $record = WWW::Scraper::ISBN::Record->new();
-
-It is usually best to let an instantiation of WWW::Scraper::ISBN create it and
-search for it. This class does not know how to search on its own.
-
- print $record->isbn;
-
- if ($record->found) {
- print $record->found_in;
- } else {
- print "not found";
- }
-
- $book = $record->book;
- print $book->{'title'};
- print $book->{'author'};
- # etc.
-
- if ($record->error) { print $record->error(); }
-
-=head1 DESCRIPTION
-
-The WWW::Scraper::ISBN::Record module defines a class that can be used to deal
-with book information. It was primarily created as a return type for the
-L<WWW::Scraper::ISBN> module, though it could be used for other purposes. It
-knows minimal information about itself, whether the book was found, where it
-was found, its ISBN number, and whether any errors occurred. It is usually up
-to the L<WWW::Scraper::ISBN::Driver> and its subclasses to make sure that the
-fields get set correctly.
-
-=head1 METHODS
-
-=over 4
-
-=item C<new()>
-
-Class Constructor. Usually invoked by C<< WWW::Scraper::ISBN->search() >>.
-Takes no parameters, creates an object with the default values:
-
- isbn = undef;
- found = 0;
- found_in = undef;
- book = undef;
- error = "";
-
-=item C<isbn() or isbn($isbn_number)>
-
- print $record->isbn; # returns the ISBN number string
- $record->isbn("123456789X"); # set the ISBN
-
-Accessor/Mutator method for handling the ISBN associated with this record.
-
-=item C<found() or found($bool)>
-
- if ($record->found) { # ... }
- $record->found(1);
-
-Accessor/Mutator method for handling the search status of this record. This is
-0 by default, and should only be set to true if the Record object contains the
-desired information, as retrieved by C<< WWW::Scraper::ISBN::Record->book() >>.
-
-=item C<found_in() or found_in($DRIVER_NAME)>
-
- print $record->found_in;
- $record->found_in("Driver_name");
-
-Accessor/Mutator method for handling the L<WWW::Scraper::ISBN::Driver> subclass
-that first successfully retrieved the desired record. Please note that this
-may depend upon the order in which the drivers are invoked, as set by
-C<< WWW::Scraper::ISBN->drivers() >>. Returns the driver name of the successful
-driver, e.g. "LOC" if found by C<< WWW::Scraper::ISBN::LOC_Driver->search() >>.
-
-=item C<book() or book($hashref)>
-
- my $book = $record->book;
- print $book->{'title'};
- print $book->{'author'};
- $another_book = {
- 'title' => "Some book title",
- 'author' => "Author of some book"
- };
- $record->book( $another_book );
-
-Accessor/Mutator method for handling the book information retrieved by the driver. Set to a hashref by the driver, returns
-a hashref when invoked alone. The resulting hash should contain the standard fields as specified by
-L<WWW::Scraper::ISBN::Driver>, and possibly additional fields based on the driver used.
-
-=item C<error() or error($error_string)>
-
- print $record->error;
- $record->error("Invalid ISBN number, or some similar error.");
-
-Accessor/Mutator method for handling any errors which occur during the search. The search drivers may add errors to record
-fields, which may be useful in gleaning information about failed searches.
-
-=back
-
-=head1 SEE ALSO
-
-=over 4
-
-=item L<WWW::Scraper::ISBN>
-
-=item L<WWW::Scraper::ISBN::Driver>
-
-=back
-
-=head1 AUTHOR
-
- 2004-2013 Andy Schamp, E<lt>andy@schamp.netE<gt>
- 2013-2014 Barbie, E<lt>barbie@cpan.orgE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
- Copyright 2004-2013 by Andy Schamp
- Copyright 2013-2014 by Barbie
-
- This distribution is free software; you can redistribute it and/or
- modify it under the Artistic Licence v2.
-
-=cut
@@ -1,8 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Test::More tests => 1;
-
-BEGIN {
- use_ok( 'WWW::Scraper::ISBN::Record' );
-}
@@ -0,0 +1,15 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl 1.t'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use Test::More tests => 1;
+BEGIN { use_ok('WWW::Scraper::ISBN::Record') };
+
+#########################
+
+# Insert your test code below, the Test::More module is use()ed here so read
+# its man page ( perldoc Test::More ) for help writing this test script.
+
@@ -1,24 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Test::More tests => 12;
-
-use WWW::Scraper::ISBN::Record;
-
-my $record = WWW::Scraper::ISBN::Record->new();
-isa_ok($record,'WWW::Scraper::ISBN::Record');
-my $record2 = $record->new();
-isa_ok($record2,'WWW::Scraper::ISBN::Record');
-
-my %defaults = (
- isbn => undef,
- found => 0,
- found_in => undef,
- book => undef,
- error => '',
-);
-
-for my $method (qw( isbn found found_in book error )) {
- is($record->$method(),$defaults{$method},".. default test for $method");
- is($record->$method('value'),'value',".. value test for $method");
-}
@@ -1,12 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Test::More;
-
-# Skip if doing a regular install
-plan skip_all => "Author tests not required for installation"
- unless ( $ENV{AUTOMATED_TESTING} );
-
-eval "use Test::Pod 1.00";
-plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-all_pod_files_ok();
@@ -1,12 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Test::More;
-
-# Skip if doing a regular install
-plan skip_all => "Author tests not required for installation"
- unless ( $ENV{AUTOMATED_TESTING} );
-
-eval "use Test::Pod::Coverage 0.08";
-plan skip_all => "Test::Pod::Coverage 0.08 required for testing POD coverage" if $@;
-all_pod_coverage_ok();
@@ -1,28 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Test::More;
-
-# Skip if doing a regular install
-plan skip_all => "Author tests not required for installation"
- unless ( $ENV{AUTOMATED_TESTING} );
-
-eval "use Test::CPAN::Meta";
-plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@;
-
-plan 'no_plan';
-
-my $meta = meta_spec_ok(undef,undef,@_);
-
-use WWW::Scraper::ISBN::Record;
-my $version = $WWW::Scraper::ISBN::Record::VERSION;
-
-is($meta->{version},$version,
- 'META.yml distribution version matches');
-
-if($meta->{provides}) {
- for my $mod (keys %{$meta->{provides}}) {
- is($meta->{provides}{$mod}{version},$version,
- "META.yml entry [$mod] version matches");
- }
-}
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Test::More;
-use IO::File;
-
-# Skip if doing a regular install
-plan skip_all => "Author tests not required for installation"
- unless ( $ENV{AUTOMATED_TESTING} );
-
-my $fh = IO::File->new('Changes','r') or plan skip_all => "Cannot open Changes file";
-
-plan 'no_plan';
-
-use WWW::Scraper::ISBN::Record;
-my $version = $WWW::Scraper::ISBN::Record::VERSION;
-
-my $latest = 0;
-while(<$fh>) {
- next unless(m!^\d!);
- $latest = 1 if(m!^$version!);
-
- # 2012-08-26T01:02 or 2012-08-26T01:02:03 or 2012-08-26T01:02:03.04 or 2012-08-26T01:02+01:00
-
- like($_, qr!^
- \d[\d._]+\s+ # version
- ( \d{4}-\d{2}-\d{2} # 2012-08-26 - YYYY-MM-DD
- ( T\d{2}:\d{2} # T01:02 - Thh:mm
- ( :\d{2} # :02 - :ss
- ( \.\d+ # .2 - .ss (microseconds)
- )?
- )?
- ( (Z|[-+]\d+:\d+) # +01:00 - timezone
- )?
- )?
- )
- \s*$!x,'... version has a date');
-}
-
-is($latest,1,'... latest version not listed');
@@ -1,28 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Test::More;
-
-# Skip if doing a regular install
-plan skip_all => "Author tests not required for installation"
- unless ( $ENV{AUTOMATED_TESTING} );
-
-eval "use Test::CPAN::Meta::JSON";
-plan skip_all => "Test::CPAN::Meta::JSON required for testing META.json files" if $@;
-
-plan 'no_plan';
-
-my $meta = meta_spec_ok(undef,undef,@_);
-
-use WWW::Scraper::ISBN::Record;
-my $version = $WWW::Scraper::ISBN::Record::VERSION;
-
-is($meta->{version},$version,
- 'META.json distribution version matches');
-
-if($meta->{provides}) {
- for my $mod (keys %{$meta->{provides}}) {
- is($meta->{provides}{$mod}{version},$version,
- "META.json entry [$mod] version matches");
- }
-}