r58662 - in /trunk/libtext-autoformat-perl: Changes MANIFEST META.yml README debian/changelog debian/control lib/Text/Autoformat.pm t/._01.ignore.t t/01.ignore.t

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Sun May 30 19:44:36 UTC 2010


Author: carnil-guest
Date: Sun May 30 19:44:28 2010
New Revision: 58662

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=58662
Log:
* New upstream release
* Add myself to Uploaders.

Added:
    trunk/libtext-autoformat-perl/t/._01.ignore.t
      - copied unchanged from r58661, branches/upstream/libtext-autoformat-perl/current/t/._01.ignore.t
    trunk/libtext-autoformat-perl/t/01.ignore.t
      - copied unchanged from r58661, branches/upstream/libtext-autoformat-perl/current/t/01.ignore.t
Modified:
    trunk/libtext-autoformat-perl/Changes
    trunk/libtext-autoformat-perl/MANIFEST
    trunk/libtext-autoformat-perl/META.yml
    trunk/libtext-autoformat-perl/README
    trunk/libtext-autoformat-perl/debian/changelog
    trunk/libtext-autoformat-perl/debian/control
    trunk/libtext-autoformat-perl/lib/Text/Autoformat.pm

Modified: trunk/libtext-autoformat-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-autoformat-perl/Changes?rev=58662&op=diff
==============================================================================
--- trunk/libtext-autoformat-perl/Changes (original)
+++ trunk/libtext-autoformat-perl/Changes Sun May 30 19:44:28 2010
@@ -172,3 +172,8 @@
 1.668001  Sat Apr  3 15:38:55 2010
 
     - Removed spurious debugging statement in bad Pod. (Thanks Chris)
+
+
+1.669001  Fri May 28 07:38:36 2010
+
+    - Added major improvements to the 'ignore' option (thanks Dan!)

Modified: trunk/libtext-autoformat-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-autoformat-perl/MANIFEST?rev=58662&op=diff
==============================================================================
--- trunk/libtext-autoformat-perl/MANIFEST (original)
+++ trunk/libtext-autoformat-perl/MANIFEST Sun May 30 19:44:28 2010
@@ -8,3 +8,4 @@
 t/00.load.t
 config.emacs
 config.vim
+t/01.ignore.t

Modified: trunk/libtext-autoformat-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-autoformat-perl/META.yml?rev=58662&op=diff
==============================================================================
--- trunk/libtext-autoformat-perl/META.yml (original)
+++ trunk/libtext-autoformat-perl/META.yml Sun May 30 19:44:28 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Text-Autoformat
-version:             1.668001
+version:             1.669001
 abstract:            Automatic text wrapping and reformatting
 license:             ~
 author:              

Modified: trunk/libtext-autoformat-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-autoformat-perl/README?rev=58662&op=diff
==============================================================================
--- trunk/libtext-autoformat-perl/README (original)
+++ trunk/libtext-autoformat-perl/README Sun May 30 19:44:28 2010
@@ -1,4 +1,4 @@
-Text::Autoformat version 1.668001
+Text::Autoformat version 1.669001
 
 NAME
     Text::Autoformat - Automatic and manual text wrapping and reformating

Modified: trunk/libtext-autoformat-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-autoformat-perl/debian/changelog?rev=58662&op=diff
==============================================================================
--- trunk/libtext-autoformat-perl/debian/changelog (original)
+++ trunk/libtext-autoformat-perl/debian/changelog Sun May 30 19:44:28 2010
@@ -1,3 +1,10 @@
+libtext-autoformat-perl (1.669001-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Add myself to Uploaders.
+
+ -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Sun, 30 May 2010 21:44:15 +0200
+
 libtext-autoformat-perl (1.668001-1) unstable; urgency=low
 
   [ Jonathan Yu ]

Modified: trunk/libtext-autoformat-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-autoformat-perl/debian/control?rev=58662&op=diff
==============================================================================
--- trunk/libtext-autoformat-perl/debian/control (original)
+++ trunk/libtext-autoformat-perl/debian/control Sun May 30 19:44:28 2010
@@ -7,7 +7,8 @@
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Daniel Ruoso <daniel at ruoso.com>, Niko Tyni <ntyni at iki.fi>,
  gregor herrmann <gregoa at debian.org>, Ryan Niebur <ryan at debian.org>,
- Jonathan Yu <jawnsy at cpan.org>
+ Jonathan Yu <jawnsy at cpan.org>,
+ Salvatore bonaccorso <salvatore.bonaccorso at gmail.com>
 Standards-Version: 3.8.4
 Homepage: http://search.cpan.org/dist/Text-Autoformat/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtext-autoformat-perl/

Modified: trunk/libtext-autoformat-perl/lib/Text/Autoformat.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtext-autoformat-perl/lib/Text/Autoformat.pm?rev=58662&op=diff
==============================================================================
--- trunk/libtext-autoformat-perl/lib/Text/Autoformat.pm (original)
+++ trunk/libtext-autoformat-perl/lib/Text/Autoformat.pm Sun May 30 19:44:28 2010
@@ -2,7 +2,7 @@
 
 use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use Carp;
 use 5.005;
-our $VERSION = '1.668001';
+our $VERSION = '1.669001';
 
 require Exporter;
 
@@ -139,22 +139,15 @@
     # SPECIAL IGNORANCE...
     if ($args{ignore}) {
         $args{all} = 1;
-        my $ig_type = ref $args{ignore};
-        if ($ig_type eq 'Regexp') {
-            my $regex = $args{ignore};
-            $args{ignore} = sub { /$regex/ };
-        }
-        elsif ($args{ignore} =~ /^indent/i) {
-            $args{ignore} = sub { ignore_headers(@_) || /$ignore_indent/ };
-        }
-        croak "Expected suboutine reference as value for -ignore option"
-            if ref $args{ignore} ne 'CODE';
-    }
-    elsif ($args{mail}) {
-        $args{ignore} = \&ignore_headers;
+        $args{ignore} = _build_ignore( $args{ignore} );
     }
     else {
         $args{ignore} = sub{0};
+    }
+
+    if ( $args{mail} ) {
+        my $ignore = $args{ignore};
+        $args{ignore} = sub { $ignore->(@_) || ignore_headers(@_) };
     }
     
     # DETABIFY
@@ -475,6 +468,28 @@
     return $text . $remainder;
 }
 
+sub _build_ignore {
+    my $ignore_arg = shift;
+    my $ig_type = ref $ignore_arg;
+    my $ignore;
+    if ($ig_type eq 'Regexp') {
+        my $regex = $ignore_arg;
+        $ignore = sub { /$regex/ };
+    } elsif ($ig_type eq 'ARRAY') {
+        my @elements = map { _build_ignore($_) } @$ignore_arg;
+        $ignore = sub {
+            for my $sub (@elements) { return 1 if $sub->(@_) }
+            return 0;
+        };
+    }
+    elsif ($ignore_arg =~ /^indent/i) {
+        $ignore = sub { ignore_headers(@_) || /$ignore_indent/ };
+    }
+    croak "Expected suboutine reference as value for -ignore option"
+        if ref $ignore ne 'CODE';
+    return $ignore;
+}
+
 use utf8;
 
 my $alpha = qr/[^\W\d_]/;
@@ -842,7 +857,7 @@
 
 =head1 VERSION
 
-This document describes version 1.668001 of Text::Autoformat
+This document describes version 1.669001 of Text::Autoformat
 released Apr 16, 2009.
 
 =head1 SYNOPSIS
@@ -1046,12 +1061,17 @@
 C<autoformat> will ignore any paragraph in which I<every> line begins with a
 whitespace.
 
+You may also specify multiple C<ignore> options by including them in 
+an array-ref:
+
+        $tidied_mesg = autoformat($messy, {ignore=>[qr/1/,'indented']});
+
 One other special case of ignorance is ignoring mail headers and signature.
 This option is specified using the C<mail> argument:
 
         $tidied_mesg = autoformat($messy_mesg, {mail=>1});
 
-Note that the C<mail> option automatically implies C<all>.
+Note that the C<ignore> or C<mail> options automatically imply C<all>.
 
 
 =head2 Bulleting and (re-)numbering




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