[Bps-public-commit] Text-Quoted branch, master, updated. 2.09-8-g6a3cb7b
? sunnavy
sunnavy at bestpractical.com
Thu Jul 26 13:50:02 EDT 2018
The branch, master has been updated
via 6a3cb7b176874bb47f2ff5909656346a537e3721 (commit)
via e58ad72493a578974dfb2f3caf45121960afcd20 (commit)
via 13938e38863201a2916f12f7c92ce4e8b8e67cfd (commit)
via 9115586a070a43be36e62f1161e817022c884122 (commit)
via 6585d4486bd0a44ad317da1f01d6dfb7820ef9df (commit)
from 908b7d4e0d05c2fe830e8a3a5362573d50f9590b (commit)
Summary of changes:
Changes | 6 ++-
META.yml | 4 +-
Makefile.PL | 1 +
README | 7 ++++
inc/Module/Install.pm | 35 +++--------------
inc/Module/Install/Base.pm | 2 +-
inc/Module/Install/Can.pm | 13 ++++++-
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Makefile.pm | 2 +-
inc/Module/Install/Metadata.pm | 2 +-
inc/Module/Install/ReadmeFromPod.pm | 76 +++++++++++++++++++++++++++++--------
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
lib/Text/Quoted.pm | 3 +-
14 files changed, 101 insertions(+), 56 deletions(-)
- Log -----------------------------------------------------------------
commit 6585d4486bd0a44ad317da1f01d6dfb7820ef9df
Author: Stefan Bühler <source at stbuehler.de>
Date: Fri Dec 8 00:00:00 2017 +0800
Fix "Negative repeat count does nothing" warning
This warning was added in perl 5.22, and $extraspace could be negative
when the previous line ends up with more spaces than current line, e.g.
> foo<SPACE>
> bar
Fixes: CPAN#111986
diff --git a/lib/Text/Quoted.pm b/lib/Text/Quoted.pm
index 4e4f814..5437c99 100644
--- a/lib/Text/Quoted.pm
+++ b/lib/Text/Quoted.pm
@@ -252,6 +252,7 @@ sub _classify {
else {
my $extraspace =
length( $line->{raw} ) - length( $line->{text} ) - $firstfrom;
+ $extraspace = 0 if $extraspace < 0;
$paras[-1]->{text} .= "\n" . q{ } x $extraspace . $line->{text};
$paras[-1]->{raw} .= "\n" . $line->{raw};
}
commit 9115586a070a43be36e62f1161e817022c884122
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jul 27 01:26:23 2018 +0800
Update inc/
diff --git a/META.yml b/META.yml
index fe05ba4..f734f6f 100644
--- a/META.yml
+++ b/META.yml
@@ -8,7 +8,7 @@ configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
-generated_by: 'Module::Install version 1.14'
+generated_by: 'Module::Install version 1.19'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index ff767fa..7ba98c2 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.14';
+ $VERSION = '1.19';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -244,6 +244,8 @@ sub new {
}
return $args{_self} if $args{_self};
+ $base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';
+
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
$args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
@@ -322,7 +324,7 @@ sub find_extensions {
my ($self, $path) = @_;
my @found;
- File::Find::find( sub {
+ File::Find::find( {no_chdir => 1, wanted => sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
my $subpath = $1;
@@ -336,7 +338,7 @@ sub find_extensions {
# correctly. Otherwise, root through the file to locate the case-preserved
# version of the package name.
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
- my $content = Module::Install::_read($subpath . '.pm');
+ my $content = Module::Install::_read($File::Find::name);
my $in_pod = 0;
foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
@@ -351,7 +353,7 @@ sub find_extensions {
}
push @found, [ $file, $pkg ];
- }, $path ) if -d $path;
+ }}, $path ) if -d $path;
@found;
}
@@ -373,8 +375,6 @@ sub _caller {
return $call;
}
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
@@ -383,16 +383,6 @@ sub _read {
close FH or die "close($_[0]): $!";
return $string;
}
-END_NEW
-sub _read {
- local *FH;
- open( FH, "< $_[0]" ) or die "open($_[0]): $!";
- binmode FH;
- my $string = do { local $/; <FH> };
- close FH or die "close($_[0]): $!";
- return $string;
-}
-END_OLD
sub _readperl {
my $string = Module::Install::_read($_[0]);
@@ -413,8 +403,6 @@ sub _readpod {
return $string;
}
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
@@ -424,17 +412,6 @@ sub _write {
}
close FH or die "close($_[0]): $!";
}
-END_NEW
-sub _write {
- local *FH;
- open( FH, "> $_[0]" ) or die "open($_[0]): $!";
- binmode FH;
- foreach ( 1 .. $#_ ) {
- print FH $_[$_] or die "print($_[0]): $!";
- }
- close FH or die "close($_[0]): $!";
-}
-END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 4206347..9fa42c2 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.19';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 9929b1b..d65c753 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -121,6 +121,15 @@ END_C
# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
+
+ if ($^O eq 'VMS') {
+ require ExtUtils::CBuilder;
+ my $builder = ExtUtils::CBuilder->new(
+ quiet => 1,
+ );
+ return $builder->have_compiler;
+ }
+
my @chunks = split(/ /, $Config::Config{cc}) or return;
# $Config{cc} may contain args; try to find out the program part
@@ -151,4 +160,4 @@ if ( $^O eq 'cygwin' ) {
__END__
-#line 236
+#line 245
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 3d8de76..3072b08 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 66993af..13a4464 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index e547fa0..11bf971 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index b5e03c3..3738232 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,12 +7,41 @@ use warnings;
use base qw(Module::Install::Base);
use vars qw($VERSION);
-$VERSION = '0.22';
+$VERSION = '0.30';
+
+{
+
+ # these aren't defined until after _require_admin is run, so
+ # define them so prototypes are available during compilation.
+ sub io;
+ sub capture(&;@);
+
+#line 28
+
+ my $done = 0;
+
+ sub _require_admin {
+
+ # do this once to avoid redefinition warnings from IO::All
+ return if $done;
+
+ require IO::All;
+ IO::All->import( '-binary' );
+
+ require Capture::Tiny;
+ Capture::Tiny->import ( 'capture' );
+
+ return;
+ }
+
+}
sub readme_from {
my $self = shift;
return unless $self->is_admin;
+ _require_admin;
+
# Input file
my $in_file = shift || $self->_all_from
or die "Can't determine file to make readme_from";
@@ -50,6 +79,8 @@ sub readme_from {
$out_file = $self->_readme_htm($in_file, $out_file, $options);
} elsif ($format eq 'man') {
$out_file = $self->_readme_man($in_file, $out_file, $options);
+ } elsif ($format eq 'md') {
+ $out_file = $self->_readme_md($in_file, $out_file, $options);
} elsif ($format eq 'pdf') {
$out_file = $self->_readme_pdf($in_file, $out_file, $options);
}
@@ -67,10 +98,10 @@ sub _readme_txt {
$out_file ||= 'README';
require Pod::Text;
my $parser = Pod::Text->new( @$options );
- open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
+ my $io = io->file($out_file)->open(">");
+ my $out_fh = $io->io_handle;
$parser->output_fh( *$out_fh );
$parser->parse_file( $in_file );
- close $out_fh;
return $out_file;
}
@@ -79,11 +110,14 @@ sub _readme_htm {
my ($self, $in_file, $out_file, $options) = @_;
$out_file ||= 'README.htm';
require Pod::Html;
- Pod::Html::pod2html(
- "--infile=$in_file",
- "--outfile=$out_file",
- @$options,
- );
+ my ($o) = capture {
+ Pod::Html::pod2html(
+ "--infile=$in_file",
+ "--outfile=-",
+ @$options,
+ );
+ };
+ io->file($out_file)->print($o);
# Remove temporary files if needed
for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
if (-e $file) {
@@ -99,7 +133,10 @@ sub _readme_man {
$out_file ||= 'README.1';
require Pod::Man;
my $parser = Pod::Man->new( @$options );
- $parser->parse_from_file($in_file, $out_file);
+ my $io = io->file($out_file)->open(">");
+ my $out_fh = $io->io_handle;
+ $parser->output_fh( *$out_fh );
+ $parser->parse_file( $in_file );
return $out_file;
}
@@ -111,11 +148,20 @@ sub _readme_pdf {
or die "Could not generate $out_file because pod2pdf could not be found\n";
my $parser = App::pod2pdf->new( @$options );
$parser->parse_from_file($in_file);
- open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
- select $out_fh;
- $parser->output;
- select STDOUT;
- close $out_fh;
+ my ($o) = capture { $parser->output };
+ io->file($out_file)->print($o);
+ return $out_file;
+}
+
+sub _readme_md {
+ my ($self, $in_file, $out_file, $options) = @_;
+ $out_file ||= 'README.md';
+ require Pod::Markdown;
+ my $parser = Pod::Markdown->new( @$options );
+ my $io = io->file($out_file)->open(">");
+ my $out_fh = $io->io_handle;
+ $parser->output_fh( *$out_fh );
+ $parser->parse_file( $in_file );
return $out_file;
}
@@ -134,5 +180,5 @@ sub _all_from {
__END__
-#line 254
+#line 316
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 9706e5f..f7aa615 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index dbedc00..2db861a 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.19';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
commit 13938e38863201a2916f12f7c92ce4e8b8e67cfd
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jul 27 01:26:51 2018 +0800
Sync README
diff --git a/README b/README
index 45be783..229d7cb 100644
--- a/README
+++ b/README
@@ -45,9 +45,16 @@ DESCRIPTION
FUNCTIONS
extract
+ my $struct = extract($text, \%arg);
+
Takes a single string argument which is the text to extract quote
structure from. Returns a nested datastructure as described above.
+ Second argument is optional: a hashref of options. The only valid
+ argument at present is:
+
+ no_separators - never mark paragraphs as "separators"
+
Exported by default.
set_quote_characters
commit e58ad72493a578974dfb2f3caf45121960afcd20
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jul 27 01:33:43 2018 +0800
Fix Makefile.PL for perl 5.26 where "." is not in @INC by default
Fixes: CPAN#121699
diff --git a/Makefile.PL b/Makefile.PL
index 8d78582..2a2806c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,4 +1,5 @@
use 5.006;
+use lib '.';
use inc::Module::Install;
all_from 'lib/Text/Quoted.pm';
commit 6a3cb7b176874bb47f2ff5909656346a537e3721
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jul 27 01:43:10 2018 +0800
Release 2.10
diff --git a/Changes b/Changes
index 01dc9b1..0f3005e 100644
--- a/Changes
+++ b/Changes
@@ -1,7 +1,11 @@
Revision history for Perl extension Text::Quoted.
-2.10
+2.10 2018-07-26
- Add no_separators option (RJBS)
+ - Fix "Negative repeat count does nothing" warning (thanks to Stefan
+ Bühler)
+ - Fix Makefile.PL for perl 5.26 where "." is not in @INC by default
+ (thanks to Petr Písař)
2.09 2015-02-20
- Switch back to using Text::Tabs, as it no longer segfaults perl
diff --git a/META.yml b/META.yml
index f734f6f..9ffa2fa 100644
--- a/META.yml
+++ b/META.yml
@@ -25,4 +25,4 @@ requires:
perl: 5.6.0
resources:
license: http://dev.perl.org/licenses/
-version: '2.09'
+version: '2.10'
diff --git a/lib/Text/Quoted.pm b/lib/Text/Quoted.pm
index 5437c99..9cceb59 100644
--- a/lib/Text/Quoted.pm
+++ b/lib/Text/Quoted.pm
@@ -1,5 +1,5 @@
package Text::Quoted;
-our $VERSION = "2.09";
+our $VERSION = "2.10";
use 5.006;
use strict;
use warnings;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list