r1346 - in
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current:
. lib/Spreadsheet/ParseExcel t
Gunnar Wolf
gwolf at costa.debian.org
Tue Sep 6 21:16:25 UTC 2005
Author: gwolf
Date: 2005-09-06 21:16:24 +0000 (Tue, 06 Sep 2005)
New Revision: 1346
Added:
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod-coverage.t
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod.t
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/test.xls
Modified:
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Changes
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/MANIFEST
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/META.yml
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Makefile.PL
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/README
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/lib/Spreadsheet/ParseExcel/Simple.pm
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/01.t
Log:
Load /tmp/tmp.IakkVb/libspreadsheet-parseexcel-simple-perl-1.03 into
packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/curren
t.
Modified: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Changes
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Changes 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Changes 2005-09-06 21:16:24 UTC (rev 1346)
@@ -1,5 +1,9 @@
Revision history for Perl extension Spreadsheet::ParseExcel::Simple.
+1.03 Sat Sep 3 22:32:22 UTC 2005
+ - Document accessing the underlying Spreadsheet::ParseExcel objects
+ - Tidy tests
+
1.02 Wed Mar 23 2005
- handle single row worksheets
(Josh Rosenbaum, John McNamara)
Modified: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/MANIFEST 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/MANIFEST 2005-09-06 21:16:24 UTC (rev 1346)
@@ -1,8 +1,11 @@
Changes
-MANIFEST
+lib/Spreadsheet/ParseExcel/Simple.pm
Makefile.PL
+MANIFEST This list of files
+META.yml
README
-Simple.pm
t/01.t
t/02.t
-META.yml Module meta-data (added by MakeMaker)
+t/pod-coverage.t
+t/pod.t
+test.xls
Modified: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/META.yml
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/META.yml 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/META.yml 2005-09-06 21:16:24 UTC (rev 1346)
@@ -1,12 +1,12 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Spreadsheet-ParseExcel-Simple
-version: 1.02
-version_from: Simple.pm
+version: 1.03
+version_from: lib/Spreadsheet/ParseExcel/Simple.pm
installdirs: site
requires:
Spreadsheet::ParseExcel: 0.18
Test::More: 0.01
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.21
+generated_by: ExtUtils::MakeMaker version 6.17
Modified: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Makefile.PL
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Makefile.PL 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/Makefile.PL 2005-09-06 21:16:24 UTC (rev 1346)
@@ -1,13 +1,12 @@
use ExtUtils::MakeMaker;
WriteMakefile(
- 'NAME' => 'Spreadsheet::ParseExcel::Simple',
- 'VERSION_FROM' => 'Simple.pm', # finds $VERSION
- 'PREREQ_PM' => {
- 'Spreadsheet::ParseExcel' => 0.18,
- 'Test::More' => 0.01,
- },
- ($] >= 5.005 ?
- (ABSTRACT_FROM => 'Simple.pm', # retrieve abstract from module
- AUTHOR => 'Tony Bowden <kasei at tmtm.com>') : ()),
+ NAME => 'Spreadsheet::ParseExcel::Simple',
+ AUTHOR => 'Tony Bowden <kasei at tmtm.com>',
+ VERSION_FROM => 'lib/Spreadsheet/ParseExcel/Simple.pm',
+ ABSTRACT_FROM => 'lib/Spreadsheet/ParseExcel/Simple.pm',
+ PREREQ_PM => {
+ 'Spreadsheet::ParseExcel' => 0.18,
+ 'Test::More' => 0.01,
+ },
);
Modified: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/README
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/README 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/README 2005-09-06 21:16:24 UTC (rev 1346)
@@ -18,7 +18,7 @@
For anything more complex, you probably want to use
Spreadsheet::ParseExcel directly.
-METHODS
+BOOK METHODS
read
my $xls = Spreadsheet::ParseExcel::Simple->read('spreadsheet.xls');
@@ -32,6 +32,15 @@
all back. You can then iterate over them, or jump straight to the one
you wish to play with.
+ book
+ my $book = $xls->book;
+
+ The Spreadsheet::ParseExcel object we are working with. You can use this
+ if you need to manipulate it in ways that this interface doesn't allow.
+
+SHEET METHODS
+ These methods can be called on each sheet returned from $xls->sheets:
+
has_data
if ($sheet->has_data) { ... }
@@ -44,15 +53,31 @@
Fetch the next row of data back.
+ sheet
+ my $obj = $sheet->sheet;
+
+ The underlying Spreadsheet::ParseExcel object for the worksheet. You can
+ use this if you need to manipulate it in ways that this interface
+ doesn't allow (e.g. asking it for the sheet's name).
+
AUTHOR
- Tony Bowden, <kasei at tmtm.com>.
+ Tony Bowden
+BUGS and QUERIES
+ Please direct all correspondence regarding this module to:
+ bug-Spreadsheet-ParseExcel-Simple at rt.cpan.org
+
+COPYRIGHT AND LICENSE
+ Copyright (C) 2001-2005 Tony Bowden.
+
+ 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.
+
SEE ALSO
Spreadsheet::ParseExcel.
-COPYRIGHT
- Copyright (C) 2001 Tony Bowden. All rights reserved.
-
- This module is free software; you can redistribute it and/or modify it
- under the same terms as Perl itself.
-
Modified: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/lib/Spreadsheet/ParseExcel/Simple.pm
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/lib/Spreadsheet/ParseExcel/Simple.pm 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/lib/Spreadsheet/ParseExcel/Simple.pm 2005-09-06 21:16:24 UTC (rev 1346)
@@ -1,9 +1,9 @@
package Spreadsheet::ParseExcel::Simple;
+$VERSION = '1.03';
+
use strict;
use Spreadsheet::ParseExcel;
-use vars qw/$VERSION/;
-$VERSION = '1.02';
=head1 NAME
@@ -28,7 +28,7 @@
For anything more complex, you probably want to use
Spreadsheet::ParseExcel directly.
-=head1 METHODS
+=head1 BOOK METHODS
=head2 read
@@ -45,6 +45,17 @@
all back. You can then iterate over them, or jump straight to the one
you wish to play with.
+=head2 book
+
+ my $book = $xls->book;
+
+The Spreadsheet::ParseExcel object we are working with. You can use this
+if you need to manipulate it in ways that this interface doesn't allow.
+
+=head1 SHEET METHODS
+
+These methods can be called on each sheet returned from $xls->sheets:
+
=head2 has_data
if ($sheet->has_data) { ... }
@@ -59,6 +70,14 @@
Fetch the next row of data back.
+=head2 sheet
+
+ my $obj = $sheet->sheet;
+
+The underlying Spreadsheet::ParseExcel object for the worksheet. You can
+use this if you need to manipulate it in ways that this interface
+doesn't allow (e.g. asking it for the sheet's name).
+
=head1 AUTHOR
Tony Bowden
@@ -68,13 +87,18 @@
Please direct all correspondence regarding this module to:
bug-Spreadsheet-ParseExcel-Simple at rt.cpan.org
-=head1 COPYRIGHT and LICENSE
+=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2001-2004 Tony Bowden. All rights reserved.
+ Copyright (C) 2001-2005 Tony Bowden.
-This module is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
+ 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.
+
=head1 SEE ALSO
L<Spreadsheet::ParseExcel>.
@@ -105,6 +129,8 @@
}, $class;
}
+sub sheet { shift->{sheet} }
+
sub has_data {
my $self = shift;
defined $self->{sheet}->{MaxRow} and ($self->{row} <= $self->{sheet}->{MaxRow});
Modified: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/01.t
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/01.t 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/01.t 2005-09-06 21:16:24 UTC (rev 1346)
@@ -2,58 +2,55 @@
use strict;
use Spreadsheet::ParseExcel::Simple;
-use Test::More tests => 11;
+use Test::More;
-eval {
- require File::Temp;
- require Spreadsheet::WriteExcel::Simple;
-};
+BEGIN {
+ eval "use File::Temp; use Spreadsheet::WriteExcel::Simple 1.03";
+ plan $@
+ ? (skip_all =>
+ 'tests need Spreadsheet::WriteExcel::Simple 1.03 + File::Temp')
+ : (tests => 11);
+}
-if ($@) {
- ok(1, "Need File::Temp and Spreadsheet::WriteExcel::Simple");
- ok(1, " for sensible testing.");
- ok(1, " - skipping tests") for (1 .. 9);
-} else {
- File::Temp->import(qw/tempfile tempdir/);
- my $dir1 = tempdir(CLEANUP => 1);
- my ($fh1, $name1) = tempfile(DIR => $dir1);
-
- my @row1 = qw/foo bar baz/;
- my @row2 = qw/1 fred 2001-01-01/;
- my @row3 = ();
- my @row4 = (2, undef, "2001-03-01");
+File::Temp->import(qw/tempfile tempdir/);
+my $dir1 = tempdir(CLEANUP => 1);
+my ($fh1, $name1) = tempfile(DIR => $dir1);
- # Write our our test file.
- my $ss = Spreadsheet::WriteExcel::Simple->new;
- $ss->write_bold_row(\@row1);
- $ss->write_row(\@row2);
- $ss->write_row(\@row3);
- $ss->write_row(\@row4);
- print $fh1 $ss->data;
- close $fh1;
+my @row1 = qw/foo bar baz/;
+my @row2 = qw/1 fred 2001-01-01/;
+my @row3 = ();
+my @row4 = (2, undef, "2001-03-01");
- # Now read it back in
- my $xls = Spreadsheet::ParseExcel::Simple->read($name1);
- my @sheets = $xls->sheets;
- is scalar @sheets, 1, "We have one sheet";
- my $sheet = $sheets[0];
+# Write our our test file.
+my $ss = Spreadsheet::WriteExcel::Simple->new;
+$ss->write_bold_row(\@row1);
+$ss->write_row(\@row2);
+$ss->write_row(\@row3);
+$ss->write_row(\@row4);
+$ss->save($name1);
- ok $sheet->has_data, "We have data to read";
- my @fetch1 = $sheet->next_row;
- ok eq_array(\@fetch1, \@row1), "Header OK";
+# Now read it back in
+my $xls = Spreadsheet::ParseExcel::Simple->read($name1);
+my @sheets = $xls->sheets;
+is scalar @sheets, 1, "We have one sheet";
+my $sheet = $sheets[0];
- ok $sheet->has_data, "We still have data to read";
- my @fetch2 = $sheet->next_row;
- ok eq_array(\@fetch2, \@row2), "Row 2";
+ok $sheet->has_data, "We have data to read";
+my @fetch1 = $sheet->next_row;
+is_deeply \@fetch1, \@row1, "Header OK";
- ok $sheet->has_data, "We still have data to read";
- my @fetch3 = $sheet->next_row;
- ok eq_array(\@fetch3, \@row3), "Row 3 (blank)";
+ok $sheet->has_data, "We still have data to read";
+my @fetch2 = $sheet->next_row;
+is_deeply \@fetch2, \@row2, "Row 2";
- ok $sheet->has_data, "We still have data to read";
- my @fetch4 = $sheet->next_row;
- ok eq_array(\@fetch4, \@row4), "Row 4";
+ok $sheet->has_data, "We still have data to read";
+my @fetch3 = $sheet->next_row;
+is_deeply \@fetch3, \@row3, "Row 3 (blank)";
- ok !$sheet->has_data, "No more data to read";
- ok !$sheet->next_row, "So, can't read any";
-}
+ok $sheet->has_data, "We still have data to read";
+my @fetch4 = $sheet->next_row;
+local $row4[1] = ""; # undefs come back as empty string
+is_deeply \@fetch4, \@row4, "Row 4";
+
+ok !$sheet->has_data, "No more data to read";
+ok !$sheet->next_row, "So, can't read any";
Added: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod-coverage.t
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod-coverage.t 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod-coverage.t 2005-09-06 21:16:24 UTC (rev 1346)
@@ -0,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: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod.t
===================================================================
--- packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod.t 2005-09-06 21:16:14 UTC (rev 1345)
+++ packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/t/pod.t 2005-09-06 21:16:24 UTC (rev 1346)
@@ -0,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: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/test.xls
===================================================================
(Binary files differ)
Property changes on: packages/libspreadsheet-parseexcel-simple-perl/branches/upstream/current/test.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the Pkg-perl-cvs-commits
mailing list