r24122 - in /trunk/libdata-report-perl: ./ debian/ lib/Data/ lib/Data/Report/Plugin/ t/

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Mon Aug 11 12:31:58 UTC 2008


Author: angelabad-guest
Date: Mon Aug 11 12:31:56 2008
New Revision: 24122

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=24122
Log:
Release 0.09

Added:
    trunk/libdata-report-perl/.includepath
      - copied unchanged from r24121, branches/upstream/libdata-report-perl/current/.includepath
    trunk/libdata-report-perl/.project
      - copied unchanged from r24121, branches/upstream/libdata-report-perl/current/.project
    trunk/libdata-report-perl/Makefile.PL
      - copied unchanged from r24121, branches/upstream/libdata-report-perl/current/Makefile.PL
    trunk/libdata-report-perl/t/01text07.t
      - copied unchanged from r24121, branches/upstream/libdata-report-perl/current/t/01text07.t
    trunk/libdata-report-perl/t/03csv05.t
      - copied unchanged from r24121, branches/upstream/libdata-report-perl/current/t/03csv05.t
    trunk/libdata-report-perl/t/03csv06.t
      - copied unchanged from r24121, branches/upstream/libdata-report-perl/current/t/03csv06.t
    trunk/libdata-report-perl/t/09poc06.t
      - copied unchanged from r24121, branches/upstream/libdata-report-perl/current/t/09poc06.t
Modified:
    trunk/libdata-report-perl/Build.PL
    trunk/libdata-report-perl/Changes
    trunk/libdata-report-perl/MANIFEST
    trunk/libdata-report-perl/META.yml
    trunk/libdata-report-perl/debian/changelog
    trunk/libdata-report-perl/lib/Data/Report.pm
    trunk/libdata-report-perl/lib/Data/Report/Plugin/Csv.pm
    trunk/libdata-report-perl/lib/Data/Report/Plugin/Html.pm
    trunk/libdata-report-perl/lib/Data/Report/Plugin/Text.pm
    trunk/libdata-report-perl/t/00basic.t
    trunk/libdata-report-perl/t/03csv03.t
    trunk/libdata-report-perl/t/03csv04.t

Modified: trunk/libdata-report-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/Build.PL?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/Build.PL (original)
+++ trunk/libdata-report-perl/Build.PL Mon Aug 11 12:31:56 2008
@@ -1,4 +1,4 @@
-# $Id: Build.PL,v 1.3 2006/05/22 13:31:44 jv Exp $
+# $Id: Build.PL,v 1.4 2008/08/07 14:50:31 jv Exp $
 
 use strict;
 use Module::Build 0.28;
@@ -16,6 +16,7 @@
 
     build_requires => {
         'Test::More' => 0,
+        'Text::CSV'  => 1.00,
     },
 
 #    auto_features => {
@@ -34,6 +35,7 @@
     meta_add            => {
       no_index          => { package => [ qw(DB) ] },
     },
+    create_makefile_pl => 'traditional',
 );
 
 $builder->create_build_script;

Modified: trunk/libdata-report-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/Changes?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/Changes (original)
+++ trunk/libdata-report-perl/Changes Mon Aug 11 12:31:56 2008
@@ -1,10 +1,23 @@
 Revision history for Data-Report
 
-0.07	2008-08-03
+0.09	2008-08-06
+
+	Add column property 'ignore'. Does what the name implies.
+	This change was suggested by Mário Silva.
+
+	Upgrade requirements for Text::CSV to 1.00.
+
+0.08	2008-08-06 14:27
+
+	Allow handling of Latin texts with CSV plugin and Text::CSV_XS.
+	This change was suggested by Mário Silva.
+
+0.07	2008-08-03 16:26
 
 	Add 'raw_html' style mod for HTML plugin. When a cell has this
 	property, the data will be placed in the cell unmodified. This
 	makes it possible to place pre-prepared HTML code in the cell.
+	This change was suggested by Cristina Nunes.
 
 0.05	2006-06-08 15:46
 

Modified: trunk/libdata-report-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/MANIFEST?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/MANIFEST (original)
+++ trunk/libdata-report-perl/MANIFEST Mon Aug 11 12:31:56 2008
@@ -1,3 +1,5 @@
+.includepath
+.project
 Build.PL
 Changes
 lib/Data/Report.pm
@@ -15,14 +17,19 @@
 t/01text04.t
 t/01text05.t
 t/01text06.t
+t/01text07.t
 t/02html01.t
 t/02html02.t
 t/03csv01.t
 t/03csv02.t
 t/03csv03.t
 t/03csv04.t
+t/03csv05.t
+t/03csv06.t
 t/09poc01.t
 t/09poc02.t
 t/09poc03.t
 t/09poc04.t
 t/09poc05.t
+t/09poc06.t
+Makefile.PL

Modified: trunk/libdata-report-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/META.yml?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/META.yml (original)
+++ trunk/libdata-report-perl/META.yml Mon Aug 11 12:31:56 2008
@@ -1,6 +1,6 @@
 ---
 name: Data-Report
-version: 0.07
+version: 0.09
 author:
   - 'Johan Vromans <jvromans at squirrel.nl>'
 abstract: Framework for flexible reporting
@@ -9,12 +9,13 @@
   license: http://dev.perl.org/licenses/
 build_requires:
   Test::More: 0
+  Text::CSV: 1
 recommends:
   HTML::Entities: 0
 provides:
   Data::Report:
     file: lib/Data/Report.pm
-    version: 0.07
+    version: 0.09
   Data::Report::Base:
     file: lib/Data/Report/Base.pm
   Data::Report::Plugin::Csv:

Modified: trunk/libdata-report-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/debian/changelog?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/debian/changelog (original)
+++ trunk/libdata-report-perl/debian/changelog Mon Aug 11 12:31:56 2008
@@ -1,3 +1,9 @@
+libdata-report-perl (0.09-1) UNRELEASED; urgency=low
+
+  * (NOT RELEASED YET) New upstream release
+
+ -- Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com>  Mon, 11 Aug 2008 14:29:28 +0200
+
 libdata-report-perl (0.07-2) unstable; urgency=low
 
   * debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser

Modified: trunk/libdata-report-perl/lib/Data/Report.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/lib/Data/Report.pm?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/lib/Data/Report.pm (original)
+++ trunk/libdata-report-perl/lib/Data/Report.pm Mon Aug 11 12:31:56 2008
@@ -1,10 +1,10 @@
 # Data::Reporter.pm -- Framework for flexible reporting
-# RCS Info        : $Id: Report.pm,v 1.13 2008/08/03 14:24:15 jv Exp $
+# RCS Info        : $Id: Report.pm,v 1.15 2008/08/07 20:05:00 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Wed Dec 28 13:18:40 2005
 # Last Modified By: Johan Vromans
-# Last Modified On: Sun Aug  3 16:23:30 2008
-# Update Count    : 256
+# Last Modified On: Thu Aug  7 22:02:59 2008
+# Update Count    : 260
 # Status          : Unknown, Use with caution!
 
 package Data::Report;
@@ -13,13 +13,9 @@
 
 Data::Report - Framework for flexible reporting
 
-=head1 VERSION
-
-0.07
-
 =cut
 
-$VERSION = 0.07;
+$VERSION = 0.09;
 
 =head1 SYNOPSIS
 
@@ -409,6 +405,12 @@
 
 (Html) Do not escape special HTML characters, allowing pre-prepared
 HTML code to be placed in the output. Use with care.
+
+=item C<ignore>
+
+(All) Ignore this column. Note that to prevent surprising results, the
+column must be ignored in all applicable styles, including the special
+style C<"head"> that controls the heading.
 
 =back
 

Modified: trunk/libdata-report-perl/lib/Data/Report/Plugin/Csv.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/lib/Data/Report/Plugin/Csv.pm?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/lib/Data/Report/Plugin/Csv.pm (original)
+++ trunk/libdata-report-perl/lib/Data/Report/Plugin/Csv.pm Mon Aug 11 12:31:56 2008
@@ -1,10 +1,10 @@
 # Data::Report::Plugin::Csv.pm -- CSV plugin for Data::Report
-# RCS Info        : $Id: Csv.pm,v 1.5 2006/06/06 20:33:41 jv Exp $
+# RCS Info        : $Id: Csv.pm,v 1.8 2008/08/07 20:05:00 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Thu Jan  5 18:47:37 2006
 # Last Modified By: Johan Vromans
-# Last Modified On: Mon May 22 17:51:41 2006
-# Update Count    : 99
+# Last Modified On: Thu Aug  7 19:57:28 2008
+# Update Count    : 118
 # Status          : Unknown, Use with caution!
 
 package Data::Report::Plugin::Csv;
@@ -52,7 +52,12 @@
     $line = $self->_csv
       ( map {
 	  $data->{$_->{name}} || ""
-        } @{$self->_get_fields}
+        }
+	grep {
+	    my $t = $self->_getstyle($style, $_->{name});
+	    ! $t->{ignore};
+	}
+	@{$self->_get_fields}
       );
     $self->_print($line, "\n");
 }
@@ -66,7 +71,17 @@
     my ($self) = @_;
     my $sep = $self->get_separator;
 
-    $self->_print($self->_csv(map { $_->{title} } @{$self->_get_fields}), "\n");
+
+    $self->_print($self->_csv
+		  (map {
+		       $_->{title}
+		   }
+		   grep {
+		       my $t = $self->_getstyle("head", $_->{name});
+		       ! $t->{ignore};
+		   }
+		   @{$self->_get_fields}),
+		  "\n");
 }
 
 ################ Internal (used if no alternatives) ################
@@ -89,9 +104,11 @@
     if ( $class && $class->isa("Text::CSV_XS") ) {
 
 	# Use always_quote to be compatible with Text::CSV.
+	# Use binary to deal with non-ASCII text.
 	$csv_implementation = Text::CSV_XS->new
 	  ({ sep_char => $self->get_separator,
 	     always_quote => 1,
+	     binary => 1,
 	   });
 
 	# Assign the method.
@@ -100,10 +117,18 @@
 	    $csv_implementation->combine(@_);
 	    $csv_implementation->string;
 	};
+	warn("# CSV plugin uses Text::CSV_XS $Text::CSV_XS::VERSION\n")
+	  if $ENV{AUTOMATED_TESTING};
     }
     elsif ( $class && $class->isa("Text::CSV") ) {
 
-	$csv_implementation = Text::CSV->new;
+	# With modern Text::CSV, it will use Text::CSV_XS if possible.
+	# So this gotta be Text::CSV_PP...
+
+	$csv_implementation = Text::CSV->new
+	  ({ always_quote => 1,
+	     binary => 1,
+	   });
 
 	# Assign the method.
 	*_csv = sub {
@@ -111,11 +136,15 @@
 	    $csv_implementation->combine(@_);
 	    $csv_implementation->string;
 	};
+	warn("# CSV plugin uses Text::CSV $Text::CSV::VERSION, PP version $Text::CSV_PP::VERSION\n")
+	  if $ENV{AUTOMATED_TESTING};
     }
     else {
 	# Use our internal method.
 	*_csv = \&_csv_internal;
 	$csv_implementation = "Data::Report::Plugin::Csv::_csv_internal";
+	warn("# CSV plugin uses built-in CSV packer\n")
+	  if $ENV{AUTOMATED_TESTING};
     }
 
     return $csv_implementation;

Modified: trunk/libdata-report-perl/lib/Data/Report/Plugin/Html.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/lib/Data/Report/Plugin/Html.pm?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/lib/Data/Report/Plugin/Html.pm (original)
+++ trunk/libdata-report-perl/lib/Data/Report/Plugin/Html.pm Mon Aug 11 12:31:56 2008
@@ -1,10 +1,10 @@
 # Data::Report::Plugin::Html.pm -- HTML plugin for Data::Report
-# RCS Info        : $Id: Html.pm,v 1.6 2008/08/03 14:09:49 jv Exp $
+# RCS Info        : $Id: Html.pm,v 1.7 2008/08/07 20:05:00 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Thu Dec 29 15:46:47 2005
 # Last Modified By: Johan Vromans
-# Last Modified On: Sun Aug  3 16:00:53 2008
-# Update Count    : 77
+# Last Modified On: Thu Aug  7 17:13:11 2008
+# Update Count    : 80
 # Status          : Unknown, Use with caution!
 
 package Data::Report::Plugin::Html;
@@ -61,7 +61,8 @@
 	my $value = defined($data->{$fname}) ? $data->{$fname} : "";
 
 	# Examine style mods.
-	my $t = $self->_getstyle("*", $fname);
+	my $t = $self->_getstyle($style, $fname);
+	next if $t->{ignore};
 
 	$self->_print("<td ", _align($col->{align}),
 		      "class=\"c_$fname\">",
@@ -86,6 +87,11 @@
 
     $self->_print("<tr class=\"head\">\n");
     foreach ( @{$self->_get_fields} ) {
+
+	# Examine style mods.
+	my $t = $self->_getstyle("head", $_->{name});
+	next if $t->{ignore};
+
 	$self->_print("<th ", _align($_->{align}),
 		      "class=\"h_", $_->{name}, "\">",
 		      $self->_html($_->{title}), "</th>\n");

Modified: trunk/libdata-report-perl/lib/Data/Report/Plugin/Text.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/lib/Data/Report/Plugin/Text.pm?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/lib/Data/Report/Plugin/Text.pm (original)
+++ trunk/libdata-report-perl/lib/Data/Report/Plugin/Text.pm Mon Aug 11 12:31:56 2008
@@ -1,10 +1,10 @@
 # Data::Report::Plugin::Text.pm -- Text plugin for Data::Report
-# RCS Info        : $Id: Text.pm,v 1.8 2006/05/23 09:35:39 jv Exp $
+# RCS Info        : $Id: Text.pm,v 1.9 2008/08/07 20:05:00 jv Exp $
 # Author          : Johan Vromans
 # Created On      : Wed Dec 28 13:21:11 2005
 # Last Modified By: Johan Vromans
-# Last Modified On: Tue May 23 11:23:52 2006
-# Update Count    : 141
+# Last Modified On: Thu Aug  7 21:49:33 2008
+# Update Count    : 147
 # Status          : Unknown, Use with caution!
 
 package Data::Report::Plugin::Text;
@@ -58,6 +58,9 @@
 
     foreach my $col ( @{$self->_get_fields} ) {
 	my $fname = $col->{name};
+	my $t = $style ? $self->_getstyle($style, $fname) : {};
+	next if $t->{ignore};
+
 	push(@values, defined($data->{$fname}) ? $data->{$fname} : "");
 	push(@widths, $col->{width});
 	if ($col->{truncate} ) {
@@ -68,30 +71,28 @@
 	my $indent = 0;
 	my $wrapindent = 0;
 	my $excess = 0;
-	if ( $style ) {
-	    if ( my $t = $self->_getstyle($style, $fname) ) {
-		$indent = $t->{indent} || 0;
-		$wrapindent = defined($t->{wrap_indent}) ? $t->{wrap_indent} : $indent;
-		croak("Row $style, column $fname, ".
-		      "illegal value for indent property: $indent")
-		  if $indent < 0 || $indent >= $self->_get_fdata->{$fname}->{width};
-		croak("Row $style, column $fname, ".
-		      "illegal value for wrap_indent property: $wrapindent")
-		  if $wrapindent < 0 || $wrapindent >= $self->_get_fdata->{$fname}->{width};
-		if ( $t->{line_before} ) {
-		    $linebefore->{$fname} =
-		      ($t->{line_before} eq "1" ? "-" : $t->{line_before}) x $col->{width};
-		}
-		if ( $t->{line_after} ) {
-		    $lineafter->{$fname} =
-		      ($t->{line_after} eq "1" ? "-" : $t->{line_after}) x $col->{width};
-		}
-		if ( $t->{excess} ) {
-		    $widths[-1] += 2;
-		}
-		if ( $t->{truncate} || $col->{truncate} ) {
-		    $values[-1] = substr($values[-1], 0, $widths[-1] - $indent);
-		}
+	if ( $t ) {
+	    $indent = $t->{indent} || 0;
+	    $wrapindent = defined($t->{wrap_indent}) ? $t->{wrap_indent} : $indent;
+	    croak("Row $style, column $fname, ".
+		  "illegal value for indent property: $indent")
+	      if $indent < 0 || $indent >= $self->_get_fdata->{$fname}->{width};
+	    croak("Row $style, column $fname, ".
+		  "illegal value for wrap_indent property: $wrapindent")
+	      if $wrapindent < 0 || $wrapindent >= $self->_get_fdata->{$fname}->{width};
+	    if ( $t->{line_before} ) {
+		$linebefore->{$fname} =
+		  ($t->{line_before} eq "1" ? "-" : $t->{line_before}) x $col->{width};
+	    }
+	    if ( $t->{line_after} ) {
+		$lineafter->{$fname} =
+		  ($t->{line_after} eq "1" ? "-" : $t->{line_after}) x $col->{width};
+	    }
+	    if ( $t->{excess} ) {
+		$widths[-1] += 2;
+	    }
+	    if ( $t->{truncate} || $col->{truncate} ) {
+		$values[-1] = substr($values[-1], 0, $widths[-1] - $indent);
 	    }
 	}
 	push(@indents, [$indent, $wrapindent]);
@@ -175,7 +176,12 @@
 
     # Print column names.
     my $t = sprintf($self->{format},
-		    map { $_->{title} } @{$self->_get_fields});
+		    map { $_->{title} }
+		    grep {
+			my $t = $self->_getstyle("head", $_->{name});
+			! $t->{ignore};
+		    }
+		    @{$self->_get_fields});
 
     # Add separator line.
     $t .= "-" x ($self->{width});
@@ -212,6 +218,9 @@
     my $format = "";		# new format
 
     foreach my $a ( @{$self->_get_fields} ) {
+
+	my $t = $self->_getstyle("head", $a->{name});
+	next if $t->{ignore};
 
 	# Never mind the trailing blanks -- we'll trim anyway.
 	$width += $a->{width} + 2;

Modified: trunk/libdata-report-perl/t/00basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/t/00basic.t?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/t/00basic.t (original)
+++ trunk/libdata-report-perl/t/00basic.t Mon Aug 11 12:31:56 2008
@@ -2,12 +2,10 @@
 
 use strict;
 use warnings;
-use Test::More qw(no_plan);
+use Test::More tests => 5;
 
 BEGIN { use_ok('Data::Report'); }
 BEGIN { use_ok('Data::Report::Base'); }
 BEGIN { use_ok('Data::Report::Plugin::Text'); }
 BEGIN { use_ok('Data::Report::Plugin::Html'); }
 BEGIN { use_ok('Data::Report::Plugin::Csv' ); }
-
-diag("CSV uses ", Data::Report::Plugin::Csv->new->_select_csv_method, "\n");

Modified: trunk/libdata-report-perl/t/03csv03.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/t/03csv03.t?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/t/03csv03.t (original)
+++ trunk/libdata-report-perl/t/03csv03.t Mon Aug 11 12:31:56 2008
@@ -18,7 +18,7 @@
 my $out = "";
 $rep->set_stylist(sub {
     my ($self, $row, $col) = @_;
-    return { ignore => 1 } if $row eq "total" && !$col;
+    return { ignore => 1 } if $row && $row eq "total" && !$col;
     return;
 });
 $rep->set_output(\$out);

Modified: trunk/libdata-report-perl/t/03csv04.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdata-report-perl/t/03csv04.t?rev=24122&op=diff
==============================================================================
--- trunk/libdata-report-perl/t/03csv04.t (original)
+++ trunk/libdata-report-perl/t/03csv04.t Mon Aug 11 12:31:56 2008
@@ -18,7 +18,7 @@
 my $out = "";
 $rep->set_stylist(sub {
     my ($self, $row, $col) = @_;
-    return { ignore => 1 } if $row eq "total" && !$col;
+    return { ignore => 1 } if $row && $row eq "total" && !$col;
     return;
 });
 $rep->set_output(\$out);




More information about the Pkg-perl-cvs-commits mailing list