auto-import perl-Text-Autoformat-1.13-1 on branch devel from

perl-Text-Autoformat-1.13-1.src.rpm
epel9
Steven Pritchard 20 years ago
parent 08d640fc0e
commit 03f204185b

@ -1 +1 @@
Text-Autoformat-1.12.tar.gz Text-Autoformat-1.13.tar.gz

@ -1,139 +0,0 @@
--- lib/Text/Autoformat.pm.orig 2003-05-27 18:34:38.000000000 -0500
+++ lib/Text/Autoformat.pm 2005-02-09 11:35:36.487236034 -0600
@@ -2,7 +2,7 @@
use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use Carp;
use 5.005;
-$VERSION = '1.12';
+$VERSION = '1.13beta';
require Exporter;
@@ -74,15 +74,23 @@
return "";
}
-my $ignore_headers = qr/\A(From\b.*$)?([^:]+:.*$([ \t].*$)*)+\s*\Z/m;
+my $ignore_headers = qr/
+ \A
+ (?: From \b .* $)?
+ (?: [^:\n]+ : .* \n
+ (?: [ \t] .* \n)*
+ )+
+ \s*
+ \Z
+ /mx;
my $ignore_indent = qr/^[^\S\n].*(\n[^\S\n].*)*$/;
-sub ignore_headers { $_[0]==1 && /$ignore_headers/ }
+sub ignore_headers { $_[0] && /$ignore_headers/ }
# BITS OF A TEXT LINE
my $quotechar = qq{[!#%=|:]};
-my $quotechunk = qq{(?:$quotechar(?![a-z])|[a-z]*>+)};
+my $quotechunk = qq{(?:$quotechar(?![a-z])|(?:[a-z]\\w*)?>+)};
my $quoter = qq{(?:(?i)(?:$quotechunk(?:[ \\t]*$quotechunk)*))};
my $separator = q/(?:[-_]{2,}|[=#*]{3,}|[+~]{4,})/;
@@ -120,9 +128,11 @@
$args{break} = break_at('-') unless exists $args{break};
$args{impfill} = ! exists $args{fill};
$args{expfill} = $args{fill};
+ $args{tabspace} = 8 unless exists $args{tabspace};
$args{renumber} = 1 unless exists $args{renumber};
$args{autocentre} = 1 unless exists $args{autocentre};
$args{_centred} = 1 if $args{justify} =~ /cent(er(ed)?|red?)/;
+ $args{all} ||= $args{mail};
# SPECIAL IGNORANCE...
if ($args{ignore}) {
@@ -138,13 +148,16 @@
croak "Expected suboutine reference as value for -ignore option"
if ref $args{ignore} ne 'CODE';
}
- else {
+ elsif ($args{mail}) {
$args{ignore} = \&ignore_headers;
}
+ else {
+ $args{ignore} = sub{0};
+ }
# DETABIFY
my @rawlines = split /\n/, $text;
- use Text::Tabs;
+ use Text::Tabs; $tabstop = $args{tabspace};
@rawlines = expand(@rawlines);
# PARSE EACH LINE
@@ -255,11 +268,13 @@
# SELECT PARAS TO HANDLE
my $remainder = "";
- if ($args{all}) { # STOP AT MAIL TERMINATOR
+ if ($args{all}) { # STOP AT MAIL TERMINATOR IF $args{mail}
+ my $lastignored = 1;
for my $index (0..$#paras) {
- local $_ = $paras[$index]{raw};
- $paras[$index]{ignore} = $args{ignore}($index+1);
- next unless /^--$/;
+ local $_ = $paras[$index]{raw} . "\n";
+ $lastignored &&=
+ $paras[$index]{ignore} = $args{ignore}($lastignored);
+ next unless $args{mail} && /^--$/;
$remainder = join "\n", map { $_->{raw} } splice @paras, $index;
$remainder .= "\n" unless $remainder =~ /\n\z/;
last;
@@ -513,7 +528,9 @@
}
my $abbrev = join '|', qw{
- etc[.] pp[.] ph[.]?d[.] U[.]S[.]
+ etc[.] pp[.] ph[.]?d[.]
+ (?:[A-Z][A-Za-z]+[.])+
+ (?:[A-Z][.])(?:[A-Z][.])+
};
my $gen_abbrev = join '|', $abbrev, qw{
@@ -604,6 +621,7 @@
}
package Hang;
+use strict;
# ROMAN NUMERALS
@@ -658,6 +676,9 @@
elsif ($_[1] =~ s#\A($hang)##) {
@vals = { type => 'bul', val => $1 }
}
+ elsif ($_[1] =~ m#\([^\s)]+\s#) {
+ @vals = ();
+ }
else {
local $^W;
my $cut;
@@ -801,6 +822,7 @@
sub empty { 0 }
package NullHang;
+use strict;
sub new { bless {}, $_[0] }
sub stringify { "" }
@@ -1021,6 +1043,14 @@
C<autoformat> will ignore any paragraph in which I<every> line begins with a
whitespace.
+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>.
+
+
=head2 Bulleting and (re-)numbering
Often plaintext will include lists that are either:

@ -0,0 +1,9 @@
#!/bin/sh
if [ -x /usr/lib/rpm/redhat/find-provides ]; then
FINDREQ=/usr/lib/rpm/redhat/find-provides
else
FINDREQ=/usr/lib/rpm/find-provides
fi
$FINDREQ $* | grep -v 'perl(\(Null\)\?Hang)'

@ -2,14 +2,18 @@
Name: perl-Text-Autoformat Name: perl-Text-Autoformat
Version: 1.13 Version: 1.13
Release: 0.3.beta%{?dist} Release: 1%{?dist}
Summary: Text::Autoformat Perl module Summary: Text::Autoformat Perl module
License: Artistic License: Artistic
Group: Development/Libraries Group: Development/Libraries
URL: http://search.cpan.org/dist/Text-Autoformat/ URL: http://search.cpan.org/dist/Text-Autoformat/
Source0: http://www.cpan.org/modules/by-module/Text/Text-Autoformat-1.12.tar.gz Source0: http://www.cpan.org/modules/by-module/Text/Text-Autoformat-%{version}.tar.gz
# From http://rt.cpan.org/NoAuth/Bug.html?id=8018
Patch0: Text-Autoformat-1.12-1.13beta.patch # Filter out perl(Hang) and perl(NullHang) auto-provides.
Source1: filter-provides.sh
%define _use_internal_dependency_generator 0
%define __find_provides %{SOURCE1}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
BuildRequires: perl(Text::Reform) BuildRequires: perl(Text::Reform)
@ -27,8 +31,7 @@ The module also supplies a re-entrant, highly configurable replacement for
the built-in Perl format() mechanism. the built-in Perl format() mechanism.
%prep %prep
%setup -q -n Text-Autoformat-1.12 %setup -q -n Text-Autoformat-%{version}
%patch0 -p0
%build %build
%{__perl} Makefile.PL INSTALLDIRS=vendor %{__perl} Makefile.PL INSTALLDIRS=vendor
@ -57,6 +60,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/* %{_mandir}/man3/*
%changelog %changelog
* Tue May 24 2005 Steven Pritchard <steve@kspei.com> 1.13-1
- Update to 1.13 final.
* Tue May 10 2005 Steven Pritchard <steve@kspei.com> 1.13-0.3.beta * Tue May 10 2005 Steven Pritchard <steve@kspei.com> 1.13-0.3.beta
- Drop Epoch and change Release for Fedora Extras. - Drop Epoch and change Release for Fedora Extras.

@ -1 +1 @@
a5a588e7a2d98fc8e8f196db71290dc0 Text-Autoformat-1.12.tar.gz 1a944e3e21e176178bb4f87a6068f041 Text-Autoformat-1.13.tar.gz

Loading…
Cancel
Save