Commit f508e133 authored by Florian Schlichting's avatar Florian Schlichting

Imported Upstream version 1.005

parents 25ae4831 94a1292a
Revision history for IO-TieCombine Revision history for IO-TieCombine
1.005 2015-10-30 22:18:10-04:00 America/New_York
- fileno on a IO::TieCombine::Handle now returns a negative value
so they can be known to be artificial
1.004 2014-02-01 19:15:17-05:00 America/New_York 1.004 2014-02-01 19:15:17-05:00 America/New_York
- update bugtracker link - update bugtracker link
......
This software is copyright (c) 2014 by Ricardo SIGNES. This software is copyright (c) 2015 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself. the same terms as the Perl 5 programming language system itself.
...@@ -12,7 +12,7 @@ b) the "Artistic License" ...@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 --- --- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2014 by Ricardo SIGNES. This software is Copyright (c) 2015 by Ricardo SIGNES.
This is free software, licensed under: This is free software, licensed under:
...@@ -22,7 +22,7 @@ This is free software, licensed under: ...@@ -22,7 +22,7 @@ This is free software, licensed under:
Version 1, February 1989 Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc. Copyright (C) 1989 Free Software Foundation, Inc.
51 Franklin St, Suite 500, Boston, MA 02110-1335 USA 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
...@@ -272,7 +272,7 @@ That's all there is to it! ...@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 --- --- The Artistic License 1.0 ---
This software is Copyright (c) 2014 by Ricardo SIGNES. This software is Copyright (c) 2015 by Ricardo SIGNES.
This is free software, licensed under: This is free software, licensed under:
......
# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.012. # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.041.
Changes Changes
LICENSE LICENSE
MANIFEST MANIFEST
...@@ -10,7 +10,8 @@ dist.ini ...@@ -10,7 +10,8 @@ dist.ini
lib/IO/TieCombine.pm lib/IO/TieCombine.pm
lib/IO/TieCombine/Handle.pm lib/IO/TieCombine/Handle.pm
lib/IO/TieCombine/Scalar.pm lib/IO/TieCombine/Scalar.pm
t/000-report-versions-tiny.t t/00-report-prereqs.dd
t/00-report-prereqs.t
t/basic.t t/basic.t
xt/author/pod-syntax.t
xt/release/changes_has_content.t xt/release/changes_has_content.t
xt/release/pod-syntax.t
This diff is collapsed.
This diff is collapsed.
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.041.
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.012.
use strict; use strict;
use warnings; use warnings;
use ExtUtils::MakeMaker 6.30; use ExtUtils::MakeMaker;
my %WriteMakefileArgs = ( my %WriteMakefileArgs = (
"ABSTRACT" => "produce tied (and other) separate but combined variables", "ABSTRACT" => "produce tied (and other) separate but combined variables",
"AUTHOR" => "Ricardo SIGNES <rjbs\@cpan.org>", "AUTHOR" => "Ricardo SIGNES <rjbs\@cpan.org>",
"BUILD_REQUIRES" => {},
"CONFIGURE_REQUIRES" => { "CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.30" "ExtUtils::MakeMaker" => 0
}, },
"DISTNAME" => "IO-TieCombine", "DISTNAME" => "IO-TieCombine",
"EXE_FILES" => [],
"LICENSE" => "perl", "LICENSE" => "perl",
"NAME" => "IO::TieCombine", "NAME" => "IO::TieCombine",
"PREREQ_PM" => { "PREREQ_PM" => {
...@@ -27,9 +22,11 @@ my %WriteMakefileArgs = ( ...@@ -27,9 +22,11 @@ my %WriteMakefileArgs = (
"warnings" => 0 "warnings" => 0
}, },
"TEST_REQUIRES" => { "TEST_REQUIRES" => {
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"Test::More" => "0.96" "Test::More" => "0.96"
}, },
"VERSION" => "1.004", "VERSION" => "1.005",
"test" => { "test" => {
"TESTS" => "t/*.t" "TESTS" => "t/*.t"
} }
...@@ -38,6 +35,8 @@ my %WriteMakefileArgs = ( ...@@ -38,6 +35,8 @@ my %WriteMakefileArgs = (
my %FallbackPrereqs = ( my %FallbackPrereqs = (
"Carp" => 0, "Carp" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"Symbol" => 0, "Symbol" => 0,
"Test::More" => "0.96", "Test::More" => "0.96",
"strict" => 0, "strict" => 0,
...@@ -55,6 +54,3 @@ delete $WriteMakefileArgs{CONFIGURE_REQUIRES} ...@@ -55,6 +54,3 @@ delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs); WriteMakefile(%WriteMakefileArgs);
This archive contains the distribution IO-TieCombine, This archive contains the distribution IO-TieCombine,
version 1.004: version 1.005:
produce tied (and other) separate but combined variables produce tied (and other) separate but combined variables
This software is copyright (c) 2014 by Ricardo SIGNES. This software is copyright (c) 2015 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself. the same terms as the Perl 5 programming language system itself.
This README file was generated by Dist::Zilla::Plugin::Readme v5.012. This README file was generated by Dist::Zilla::Plugin::Readme v5.041.
...@@ -2,61 +2,61 @@ use strict; ...@@ -2,61 +2,61 @@ use strict;
use warnings; use warnings;
package IO::TieCombine; package IO::TieCombine;
# ABSTRACT: produce tied (and other) separate but combined variables # ABSTRACT: produce tied (and other) separate but combined variables
$IO::TieCombine::VERSION = '1.004'; $IO::TieCombine::VERSION = '1.005';
use Carp (); use Carp ();
use IO::TieCombine::Handle; use IO::TieCombine::Handle;
use IO::TieCombine::Scalar; use IO::TieCombine::Scalar;
use Symbol (); use Symbol ();
# =head1 SYNOPSIS #pod =head1 SYNOPSIS
# #pod
# First, we set up a bunch of access points: #pod First, we set up a bunch of access points:
# #pod
# my $hub = IO::TieCombine->new; #pod my $hub = IO::TieCombine->new;
# #pod
# my $str_ref = $hub->scalar_ref('x'); #pod my $str_ref = $hub->scalar_ref('x');
# my $fh = $hub->fh('x'); #pod my $fh = $hub->fh('x');
# my $callback = $hub->callback('x'); #pod my $callback = $hub->callback('x');
# #pod
# tie my $scalar, $hub, 'x'; #pod tie my $scalar, $hub, 'x';
# tie local *STDOUT, $hub, 'x'; #pod tie local *STDOUT, $hub, 'x';
# #pod
# tie local *STDERR, $hub, 'err'; #pod tie local *STDERR, $hub, 'err';
# #pod
# Then we write to things: #pod Then we write to things:
# #pod
# $$str_ref .= 'And '; #pod $$str_ref .= 'And ';
# print $fh "now "; #pod print $fh "now ";
# $callback->('for '); #pod $callback->('for ');
# $scalar .= 'something '; #pod $scalar .= 'something ';
# print "completely "; #pod print "completely ";
# warn "different.\n"; #pod warn "different.\n";
# #pod
# And then: #pod And then:
# #pod
# $hub->combined_contents; # And now for something completely different. #pod $hub->combined_contents; # And now for something completely different.
# $hub->slot_contents('x'); # And now for something completely #pod $hub->slot_contents('x'); # And now for something completely
# $hub->slot_contents('err'); # different. #pod $hub->slot_contents('err'); # different.
# #pod
# B<ACHTUNG!!> Because of a serious problem with Perl 5.10.0, output sent to a #pod B<ACHTUNG!!> Because of a serious problem with Perl 5.10.0, output sent to a
# tied filehandle using C<say> B<will not have the expected newline>. 5.10.1 or #pod tied filehandle using C<say> B<will not have the expected newline>. 5.10.1 or
# later is needed. Since 5.10.0 is broken in so many other ways, you should #pod later is needed. Since 5.10.0 is broken in so many other ways, you should
# really upgrade anyway. #pod really upgrade anyway.
# #pod
# B<ACHTUNG!!> Because of a different problem with Perls 5.10.1 - 5.16.3, if you #pod B<ACHTUNG!!> Because of a different problem with Perls 5.10.1 - 5.16.3, if you
# send output to a tied filehandle using C<say>, and C<$\> is undefined (which is #pod send output to a tied filehandle using C<say>, and C<$\> is undefined (which is
# the default), B<< C<$\> will not be restored to C<undef> after the C<say> >>! #pod the default), B<< C<$\> will not be restored to C<undef> after the C<say> >>!
# This means that once you've used C<say> to print to I<any> tied filehandle, you #pod This means that once you've used C<say> to print to I<any> tied filehandle, you
# have corrupted the global state of your program. Either start your program by #pod have corrupted the global state of your program. Either start your program by
# setting C<$\> to an empty string, which should be safe, or upgrade to 5.18.0. #pod setting C<$\> to an empty string, which should be safe, or upgrade to 5.18.0.
# #pod
# =cut #pod =cut
# =method new #pod =method new
# #pod
# The constructor takes no arguments. #pod The constructor takes no arguments.
# #pod
# =cut #pod =cut
sub new { sub new {
my ($class) = @_; my ($class) = @_;
...@@ -69,24 +69,24 @@ sub new { ...@@ -69,24 +69,24 @@ sub new {
bless $self => $class; bless $self => $class;
} }
# =method combined_contents #pod =method combined_contents
# #pod
# This method returns the contents of all collected data. #pod This method returns the contents of all collected data.
# #pod
# =cut #pod =cut
sub combined_contents { sub combined_contents {
my ($self) = @_; my ($self) = @_;
return ${ $self->{combined} }; return ${ $self->{combined} };
} }
# =method slot_contents #pod =method slot_contents
# #pod
# my $str = $hub->slot_contents( $slot_name ); #pod my $str = $hub->slot_contents( $slot_name );
# #pod
# This method returns the contents of all collected data for the named slot. #pod This method returns the contents of all collected data for the named slot.
# #pod
# =cut #pod =cut
sub slot_contents { sub slot_contents {
my ($self, $name) = @_; my ($self, $name) = @_;
...@@ -115,13 +115,13 @@ sub _tie_args { ...@@ -115,13 +115,13 @@ sub _tie_args {
}; };
} }
# =method clear_slot #pod =method clear_slot
# #pod
# $hub->clear_slot( $slot_name ); #pod $hub->clear_slot( $slot_name );
# #pod
# This sets the slot back to an empty string. #pod This sets the slot back to an empty string.
# #pod
# =cut #pod =cut
sub clear_slot { sub clear_slot {
my ($self, $slot_name) = @_; my ($self, $slot_name) = @_;
...@@ -129,14 +129,14 @@ sub clear_slot { ...@@ -129,14 +129,14 @@ sub clear_slot {
return; return;
} }
# =method fh #pod =method fh
# #pod
# my $fh = $hub->fh( $slot_name ); #pod my $fh = $hub->fh( $slot_name );
# #pod
# This method returns a reference to a tied filehandle. When printed to, output #pod This method returns a reference to a tied filehandle. When printed to, output
# is collected in the named slot. #pod is collected in the named slot.
# #pod
# =cut #pod =cut
sub fh { sub fh {
my ($self, $name) = @_; my ($self, $name) = @_;
...@@ -159,15 +159,15 @@ sub _tie_fh_args { ...@@ -159,15 +159,15 @@ sub _tie_fh_args {
return ('IO::TieCombine::Handle', $self->_tie_args($name)); return ('IO::TieCombine::Handle', $self->_tie_args($name));
} }
# =method scalar_ref #pod =method scalar_ref
# #pod
# my $str_ref = $hub->scalar_ref( $slot_name ); #pod my $str_ref = $hub->scalar_ref( $slot_name );
# #pod
# This method returns a reference to scalar. When appended to, the new content #pod This method returns a reference to scalar. When appended to, the new content
# is collected in the named slot. Attempting to alter the string other than by #pod is collected in the named slot. Attempting to alter the string other than by
# adding new content to its end will result in an exception. #pod adding new content to its end will result in an exception.
# #pod
# =cut #pod =cut
sub scalar_ref { sub scalar_ref {
my ($self, $name) = @_; my ($self, $name) = @_;
...@@ -188,11 +188,11 @@ sub _tie_scalar_args { ...@@ -188,11 +188,11 @@ sub _tie_scalar_args {
return ('IO::TieCombine::Scalar', $self->_tie_args($name)); return ('IO::TieCombine::Scalar', $self->_tie_args($name));
} }
# =method callback #pod =method callback
# #pod
# my $code = $hub->callback( $slot_name ); #pod my $code = $hub->callback( $slot_name );
# #pod
# =cut #pod =cut
sub callback { sub callback {
my ($self, $name) = @_; my ($self, $name) = @_;
...@@ -219,7 +219,7 @@ IO::TieCombine - produce tied (and other) separate but combined variables ...@@ -219,7 +219,7 @@ IO::TieCombine - produce tied (and other) separate but combined variables
=head1 VERSION =head1 VERSION
version 1.004 version 1.005
=head1 SYNOPSIS =head1 SYNOPSIS
...@@ -310,7 +310,7 @@ Ricardo SIGNES <rjbs@cpan.org> ...@@ -310,7 +310,7 @@ Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE =head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Ricardo SIGNES. This software is copyright (c) 2015 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself. the same terms as the Perl 5 programming language system itself.
......
...@@ -2,7 +2,7 @@ use strict; ...@@ -2,7 +2,7 @@ use strict;
use warnings; use warnings;
package IO::TieCombine::Handle; package IO::TieCombine::Handle;
# ABSTRACT: tied filehandles for IO::TieCombine # ABSTRACT: tied filehandles for IO::TieCombine
$IO::TieCombine::Handle::VERSION = '1.004'; $IO::TieCombine::Handle::VERSION = '1.005';
use Carp (); use Carp ();
sub TIEHANDLE { sub TIEHANDLE {
...@@ -37,7 +37,7 @@ sub PRINTF { ...@@ -37,7 +37,7 @@ sub PRINTF {
sub OPEN { return $_[0] } sub OPEN { return $_[0] }
sub BINMODE { return 1; } sub BINMODE { return 1; }
sub FILENO { return 0 + $_[0] } sub FILENO { return 0 - $_[0] }
1; 1;
...@@ -53,7 +53,7 @@ IO::TieCombine::Handle - tied filehandles for IO::TieCombine ...@@ -53,7 +53,7 @@ IO::TieCombine::Handle - tied filehandles for IO::TieCombine
=head1 VERSION =head1 VERSION
version 1.004 version 1.005
=head1 AUTHOR =head1 AUTHOR
...@@ -61,7 +61,7 @@ Ricardo SIGNES <rjbs@cpan.org> ...@@ -61,7 +61,7 @@ Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE =head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Ricardo SIGNES. This software is copyright (c) 2015 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself. the same terms as the Perl 5 programming language system itself.
......
...@@ -2,7 +2,7 @@ use strict; ...@@ -2,7 +2,7 @@ use strict;
use warnings; use warnings;
package IO::TieCombine::Scalar; package IO::TieCombine::Scalar;
# ABSTRACT: tied scalars for IO::TieCombine # ABSTRACT: tied scalars for IO::TieCombine
$IO::TieCombine::Scalar::VERSION = '1.004'; $IO::TieCombine::Scalar::VERSION = '1.005';
use Carp (); use Carp ();
sub TIESCALAR { sub TIESCALAR {
...@@ -49,7 +49,7 @@ IO::TieCombine::Scalar - tied scalars for IO::TieCombine ...@@ -49,7 +49,7 @@ IO::TieCombine::Scalar - tied scalars for IO::TieCombine
=head1 VERSION =head1 VERSION
version 1.004 version 1.005
=head1 AUTHOR =head1 AUTHOR
...@@ -57,7 +57,7 @@ Ricardo SIGNES <rjbs@cpan.org> ...@@ -57,7 +57,7 @@ Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE =head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Ricardo SIGNES. This software is copyright (c) 2015 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself. the same terms as the Perl 5 programming language system itself.
......
do { my $x = {
'configure' => {
'requires' => {
'ExtUtils::MakeMaker' => '0'
}
},
'develop' => {
'requires' => {
'Test::More' => '0',
'Test::Pod' => '1.41'
}
},
'runtime' => {
'requires' => {
'Carp' => '0',
'Symbol' => '0',
'strict' => '0',
'warnings' => '0'
}
},
'test' => {
'recommends' => {
'CPAN::Meta' => '2.120900'
},
'requires' => {
'ExtUtils::MakeMaker' => '0',
'File::Spec' => '0',
'Test::More' => '0.96'
}
}
};
$x;
}
\ No newline at end of file
#!perl
use strict;
use warnings;
# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.021
use Test::More tests => 1;
use ExtUtils::MakeMaker;
use File::Spec;
# from $version::LAX
my $lax_version_re =
qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
|
(?:\.[0-9]+) (?:_[0-9]+)?
) | (?:
v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
|
(?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)?
)
)/x;
# hide optional CPAN::Meta modules from prereq scanner
# and check if they are available
my $cpan_meta = "CPAN::Meta";
my $cpan_meta_pre = "CPAN::Meta::Prereqs";
my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic
# Verify requirements?
my $DO_VERIFY_PREREQS = 1;
sub _max {
my $max = shift;
$max = ( $_ > $max ) ? $_ : $max for @_;
return $max;
}
sub _merge_prereqs {
my ($collector, $prereqs) = @_;
# CPAN::Meta::Prereqs object
if (ref $collector eq $cpan_meta_pre) {
return $collector->with_merged_prereqs(
CPAN::Meta::Prereqs->new( $prereqs )
);
}
# Raw hashrefs
for my $phase ( keys %$prereqs ) {
for my $type ( keys %{ $prereqs->{$phase} } ) {
for my $module ( keys %{ $prereqs->{$phase}{$type} } ) {
$collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module};
}
}
}
return $collector;
}
my @include = qw(
);
my @exclude = qw(
);
# Add static prereqs to the included modules list
my $static_prereqs = do 't/00-report-prereqs.dd';
# Merge all prereqs (either with ::Prereqs or a hashref)
my $full_prereqs = _merge_prereqs(
( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ),
$static_prereqs
);
# Add dynamic prereqs to the included modules list (if we can)
my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
if ( $source && $HAS_CPAN_META ) {
if ( my $meta = eval { CPAN::Meta->load_file($source) } ) {
$full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
}
}
else {
$source = 'static metadata';
}
my @full_reports;
my @dep_errors;
my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
# Add static includes into a fake section
for my $mod (@include) {
$req_hash->{other}{modules}{$mod} = 0;
}
for my $phase ( qw(configure build test runtime develop other) ) {
next unless $req_hash->{$phase};
next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});
for my $type ( qw(requires recommends suggests conflicts modules) ) {
next unless $req_hash->{$phase}{$type};
my $title = ucfirst($phase).' '.ucfirst($type);
my @reports = [qw/Module Want Have/];
for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
next if $mod eq 'perl';
next if grep { $_ eq $mod } @exclude;
my $file = $mod;
$file =~ s{::}{/}g;
$file .= ".pm";
my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;
my $want = $req_hash->{$phase}{$type}{$mod};
$want = "undef" unless defined $want;
$want = "any" if !$want && $want == 0;
my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";
if ($prefix) {
my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
$have = "undef" unless defined $have;
push @reports, [$mod, $want, $have];
if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
if ( $have !~ /\A$lax_version_re\z/ ) {
push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";
}
elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) {
push @dep_errors, "$mod version '$have' is not in required range '$want'";
}
}
}
else {
push @reports, [$mod, $want, "missing"];
if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
push @dep_errors, "$mod is not installed ($req_string)";
}
}
}
if ( @reports ) {
push @full_reports, "=== $title ===\n\n";
my $ml = _max( map { length $_->[0] } @reports );
my $wl = _max( map { length $_->[1] } @reports );
my $hl = _max( map { length $_->[2] } @reports );
if ($type eq 'modules') {
splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
}
else {
splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
}
push @full_reports, "\n";
}
}
}
if ( @full_reports ) {
diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
}
if ( @dep_errors ) {
diag join("\n",