r1445 - in packages/libdata-dumper-simple-perl/branches/upstream/current: . lib/Data/Dumper t

Gunnar Wolf gwolf at costa.debian.org
Mon Oct 24 16:55:14 UTC 2005


Author: gwolf
Date: 2005-10-24 16:55:14 +0000 (Mon, 24 Oct 2005)
New Revision: 1445

Added:
   packages/libdata-dumper-simple-perl/branches/upstream/current/Build.PL
   packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod-coverage.t
   packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod.t
Modified:
   packages/libdata-dumper-simple-perl/branches/upstream/current/Changes
   packages/libdata-dumper-simple-perl/branches/upstream/current/MANIFEST
   packages/libdata-dumper-simple-perl/branches/upstream/current/META.yml
   packages/libdata-dumper-simple-perl/branches/upstream/current/Makefile.PL
   packages/libdata-dumper-simple-perl/branches/upstream/current/README
   packages/libdata-dumper-simple-perl/branches/upstream/current/lib/Data/Dumper/Simple.pm
Log:
Load /tmp/tmp.vEHS6Z/libdata-dumper-simple-perl-0.10 into
packages/libdata-dumper-simple-perl/branches/upstream/current.


Added: packages/libdata-dumper-simple-perl/branches/upstream/current/Build.PL
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/Build.PL	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/Build.PL	2005-10-24 16:55:14 UTC (rev 1445)
@@ -0,0 +1,19 @@
+use strict;
+use warnings;
+use Module::Build;
+
+my $builder = Module::Build->new(
+    module_name       => 'Data::Dumper::Simple',
+    license           => 'perl',
+    dist_author       => 'Curtis "Ovid" Poe <ovid at cpan.org>',
+    dist_version_from => 'lib/Data/Dumper/Simple.pm',
+    requires          => {
+        'Test::More'     => 0,
+        'Filter::Simple' => '0.77',
+    },
+    add_to_cleanup     => ['Data-Dumper-Simple-*'],
+    create_makefile_pl => 'traditional',
+);
+
+$builder->create_build_script();
+

Modified: packages/libdata-dumper-simple-perl/branches/upstream/current/Changes
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/Changes	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/Changes	2005-10-24 16:55:14 UTC (rev 1445)
@@ -1,5 +1,12 @@
 Revision history for Perl extension Data::Dumper::Simple.
 
+0.10  2005-10-08
+    - Added POD tests.
+    - Converted to Module::Build
+    - Fixed tiny bug where import list error wasn't getting
+      reported correctly (because I was missing 'strict'.  Fancy
+      that).
+
 0.07  Thu May 19 2005
     - Implemented patch from Tom Phoenix that makes parentheses
       optional (and a doc fix, too).

Modified: packages/libdata-dumper-simple-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/MANIFEST	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/MANIFEST	2005-10-24 16:55:14 UTC (rev 1445)
@@ -1,3 +1,4 @@
+Build.PL
 Changes
 lib/Data/Dumper/Simple.pm
 Makefile.PL
@@ -8,3 +9,5 @@
 t/20import.t
 t/30autowarn.t
 t/40noparens.t
+t/pod-coverage.t
+t/pod.t

Modified: packages/libdata-dumper-simple-perl/branches/upstream/current/META.yml
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/META.yml	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/META.yml	2005-10-24 16:55:14 UTC (rev 1445)
@@ -1,11 +1,17 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Data-Dumper-Simple
-version:      0.07
-version_from: lib/Data/Dumper/Simple.pm
-installdirs:  site
+---
+name: Data-Dumper-Simple
+version: 0.10
+author:
+  - Curtis "Ovid" Poe <ovid at cpan.org>
+abstract: Easily dump variables with names
+license: perl
+resources:
+  license: http://dev.perl.org/licenses/
 requires:
-    Filter::Simple:                0.77
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+  Filter::Simple: 0.77
+  Test::More: 0
+provides:
+  Data::Dumper::Simple:
+    file: lib/Data/Dumper/Simple.pm
+    version: 0.10
+generated_by: Module::Build version 0.2702

Modified: packages/libdata-dumper-simple-perl/branches/upstream/current/Makefile.PL
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/Makefile.PL	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/Makefile.PL	2005-10-24 16:55:14 UTC (rev 1445)
@@ -1,16 +1,15 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
 use ExtUtils::MakeMaker;
-
-WriteMakefile(
-    'NAME'		=> 'Data::Dumper::Simple',
-    'VERSION_FROM'	=> 'lib/Data/Dumper/Simple.pm',
-    'PREREQ_PM'		=> {
-        'Filter::Simple' => '0.77',
-    },
-    ($] >= 5.005
-        ? (
-            ABSTRACT_FROM => 'lib/Data/Dumper/Simple.pm',
-            AUTHOR        => 'Curtis "Ovid" Poe'
-          )
-        : ()
-    ),
-);
+WriteMakefile
+(
+  'NAME' => 'Data::Dumper::Simple',
+  'VERSION_FROM' => 'lib/Data/Dumper/Simple.pm',
+  'PREREQ_PM' => {
+    'Filter::Simple' => '0.77',
+    'Test::More' => '0'
+  },
+  'INSTALLDIRS' => 'site',
+  'EXE_FILES' => [],
+  'PL_FILES' => {}
+)
+;

Modified: packages/libdata-dumper-simple-perl/branches/upstream/current/README
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/README	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/README	2005-10-24 16:55:14 UTC (rev 1445)
@@ -1,4 +1,4 @@
-Data::Dumper::Simple version 0.01
+Data::Dumper::Simple version 0.10
 =====================
 
 INSTALLATION

Modified: packages/libdata-dumper-simple-perl/branches/upstream/current/lib/Data/Dumper/Simple.pm
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/lib/Data/Dumper/Simple.pm	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/lib/Data/Dumper/Simple.pm	2005-10-24 16:55:14 UTC (rev 1445)
@@ -1,17 +1,18 @@
 package Data::Dumper::Simple;
 
 $REVISION = '$Id: Simple.pm,v 1.10 2005/05/20 01:37:08 ovid Exp $';
-$VERSION  = '0.07';
+$VERSION  = '0.10';
 use Filter::Simple;
 use Data::Dumper ();
+use strict;
 
 my $DUMPER_FUNCTION = 'Dumper';
 my $AUTOWARN;
 
-my $COMMA = qr/(?:,|=>)/;
-my $ATOM  = qr/(?!\d)[[:word:]]+/;
-my $SEP   = qr/::/;
-my $NAME  = qr/$SEP?$ATOM(?:$SEP$ATOM)*/;
+my $COMMA      = qr/(?:,|=>)/;
+my $ATOM       = qr/(?!\d)[[:word:]]+/;
+my $SEP        = qr/::/;
+my $NAME       = qr/$SEP?$ATOM(?:$SEP$ATOM)*/;
 
 my $SCALAR     = qr/\$$NAME/;
 my $ARRAY_ELEM = qr/\$$NAME\[[^]]+\]/;
@@ -26,16 +27,16 @@
 my $PAREN_LIST = qr/\([^)]+\)/;
 
 sub import {
-    my ($class, @args) = @_;
-    @args = _validate_args(@args);
+    my ( $class, @args ) = @_;
+    @args = $class->_validate_args(@args);
     my %args = @args;
     $DUMPER_FUNCTION = $args{as}       if $args{as};
     $AUTOWARN        = $args{autowarn} if $args{autowarn};
 }
 
-FILTER_ONLY 
-    executable => sub { # not using code due to a possible bug in Filter::Simple
-        s{
+FILTER_ONLY executable =>
+  sub {    # not using code due to a possible bug in Filter::Simple
+    s{
             $DUMPER_FUNCTION\s*($PAREN_LIST|$ARG_LIST)
         }{
             my $args = $1;
@@ -48,19 +49,19 @@
             }
             "($output)"; # parens prevent accidental indirect method syntax
         }gex
-    };
+  };
 
 sub _validate_args {
-    my @args = @_;
-    if (@args % 2) {
+    my ( $class, @args ) = @_;
+    if ( @args % 2 ) {
         _croak("$class->import requires an even sized list");
     }
     my %args = @args;
-    if ( $args{as} && ! _valid_sub_name($args{as}) ) {
+    if ( $args{as} && !_valid_sub_name( $args{as} ) ) {
         _croak("$args{as} is not a valid name for a subroutine");
     }
     if ( $args{autowarn} ) {
-        $args{autowarn} = 'warn' unless _valid_sub_name($args{autowarn});
+        $args{autowarn} = 'warn' unless _valid_sub_name( $args{autowarn} );
     }
     return %args;
 }
@@ -75,21 +76,22 @@
 sub _munge_argument_list {
     my $arguments     = shift;
     my $sigils        = '@%&';
-    my @raw_var_names = 
-        map { _strip_whitespace($_) }
-        split /(?:,|=>)/ => $arguments;
-    my @raw_escaped   = @raw_var_names;
-    my $varnames  = 
-        join ' ' => 
-        map { s/(\\)?[$sigils]/$1 ? '$' : '*'/ge; s/\\//g; $_ } # turn @array into => [$*]array
-            @raw_var_names;
+    my @raw_var_names =
+      map { _strip_whitespace($_) }
+      split /(?:,|=>)/ => $arguments;
+    my @raw_escaped = @raw_var_names;
+    my $varnames = join ' ' => map {
+        s/(\\)?[$sigils]/$1 ? '$' : '*'/ge;
+        s/\\//g;
+        $_
+      }    # turn @array into => [$*]array
+      @raw_var_names;
 
-    my $escaped_vars = 
-        join ', ' => 
-        map { s/\\\$/\$/g; $_ } # do not take a reference to a scalar
-        map { s/(?<!\\)(?=[$sigils])/\\/g; $_ } # take references to all else
-            @raw_escaped;
-    return ($escaped_vars, $varnames);
+    my $escaped_vars =
+      join ', ' => map { s/\\\$/\$/g; $_ } # do not take a reference to a scalar
+      map { s/(?<!\\)(?=[$sigils])/\\/g; $_ }    # take references to all else
+      @raw_escaped;
+    return ( $escaped_vars, $varnames );
 }
 
 sub _strip_whitespace {
@@ -131,6 +133,12 @@
 Note that this is primarily a debugging tool.  C<Data::Dumper> offers a bit
 more than that, so don't expect this module to be more than it is.
 
+Note that if you strongly object to source filters, I've also released
+L<Data::Dumper::Names>.  It does what this module does by it uses L<PadWalker>
+instead of a source filter.  Unfortunately, it has a few limitations and is not
+as powerful as this module.  Think of L<Data::Dumper::Names> as a "proof of
+concept".
+
 =head2 The Problem
 
 Frequently, we use C<Data::Dumper> to dump out some variables while debugging.

Added: packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod-coverage.t
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod-coverage.t	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod-coverage.t	2005-10-24 16:55:14 UTC (rev 1445)
@@ -0,0 +1,18 @@
+#!perl -T
+
+use strict;
+use Test::More;
+eval "use Test::Pod::Coverage 0.08";
+plan skip_all => "Test::Pod::Coverage required for testing POD coverage" if $@;
+
+my %exception_for = ();
+
+my @modules = Test::Pod::Coverage::all_modules();
+plan tests => scalar @modules;
+
+foreach my $module (@modules) {
+    my $exception = $exception_for{$module};
+    pod_coverage_ok( $module, $exception ? { trustme => [$exception] } : () );
+}
+
+

Added: packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod.t
===================================================================
--- packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod.t	2005-10-24 16:52:54 UTC (rev 1444)
+++ packages/libdata-dumper-simple-perl/branches/upstream/current/t/pod.t	2005-10-24 16:55:14 UTC (rev 1445)
@@ -0,0 +1,7 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();
+




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