Commit 25ae4831 authored by Florian Schlichting's avatar Florian Schlichting

Imported Upstream version 1.004

parent 175566ae
Revision history for IO-TieCombine
1.004 2014-02-01 19:15:17-05:00 America/New_York
- update bugtracker link
1.003 2013-09-21 15:11:30 Asia/Tokyo
- "say" to a tied fh on 5.12, 5.14, and 5.16 is broken, too;
we'll test it, but leave the test broken, for now
......
This software is copyright (c) 2013 by Ricardo SIGNES.
This software is copyright (c) 2014 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2013 by Ricardo SIGNES.
This software is Copyright (c) 2014 by Ricardo SIGNES.
This is free software, licensed under:
......@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
This software is Copyright (c) 2013 by Ricardo SIGNES.
This software is Copyright (c) 2014 by Ricardo SIGNES.
This is free software, licensed under:
......
# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.012.
Changes
LICENSE
MANIFEST
......@@ -9,7 +10,6 @@ dist.ini
lib/IO/TieCombine.pm
lib/IO/TieCombine/Handle.pm
lib/IO/TieCombine/Scalar.pm
t/00-compile.t
t/000-report-versions-tiny.t
t/basic.t
xt/release/changes_has_content.t
......
This diff is collapsed.
......@@ -3,13 +3,11 @@ abstract: 'produce tied (and other) separate but combined variables'
author:
- 'Ricardo SIGNES <rjbs@cpan.org>'
build_requires:
File::Find: 0
File::Temp: 0
Test::More: 0.96
configure_requires:
ExtUtils::MakeMaker: 6.30
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.300030, CPAN::Meta::Converter version 2.120921'
generated_by: 'Dist::Zilla version 5.012, CPAN::Meta::Converter version 2.133380'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -21,97 +19,121 @@ requires:
strict: 0
warnings: 0
resources:
bugtracker: https://github.com/rjbs/IO-TieCombine/issues
homepage: https://github.com/rjbs/IO-TieCombine
repository: https://github.com/rjbs/IO-TieCombine.git
version: 1.003
version: 1.004
x_Dist_Zilla:
perl:
version: 5.016003
version: 5.018002
plugins:
-
class: Dist::Zilla::Plugin::Git::GatherDir
name: '@RJBS/Git::GatherDir'
version: 2.009
version: 2.019
-
class: Dist::Zilla::Plugin::CheckPrereqsIndexed
name: '@RJBS/CheckPrereqsIndexed'
version: 0.008
version: 0.010
-
class: Dist::Zilla::Plugin::CheckExtraTests
name: '@RJBS/CheckExtraTests'
version: 0.011
version: 0.016
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 0
check_all_prereqs: 0
modules:
- Dist::Zilla::PluginBundle::RJBS
phase: build
skip: []
name: '@RJBS/RJBS-Outdated'
version: 0.015
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 1
check_all_prereqs: 0
modules: []
phase: release
skip: []
name: '@RJBS/CPAN-Outdated'
version: 0.015
-
class: Dist::Zilla::Plugin::PruneCruft
name: '@RJBS/@Filter/PruneCruft'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::ManifestSkip
name: '@RJBS/@Filter/ManifestSkip'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@RJBS/@Filter/MetaYAML'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::License
name: '@RJBS/@Filter/License'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::Readme
name: '@RJBS/@Filter/Readme'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::ExecDir
name: '@RJBS/@Filter/ExecDir'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::ShareDir
name: '@RJBS/@Filter/ShareDir'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::MakeMaker
name: '@RJBS/@Filter/MakeMaker'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::Manifest
name: '@RJBS/@Filter/Manifest'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::TestRelease
name: '@RJBS/@Filter/TestRelease'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::ConfirmRelease
name: '@RJBS/@Filter/ConfirmRelease'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@RJBS/@Filter/UploadToCPAN'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: '@RJBS/AutoPrereqs'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::Git::NextVersion
name: '@RJBS/Git::NextVersion'
version: 2.009
version: 2.019
-
class: Dist::Zilla::Plugin::PkgVersion
name: '@RJBS/PkgVersion'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@RJBS/MetaConfig'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@RJBS/MetaJSON'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::NextRelease
name: '@RJBS/NextRelease'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::Test::ChangesHasContent
name: '@RJBS/Test::ChangesHasContent'
......@@ -119,15 +141,11 @@ x_Dist_Zilla:
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@RJBS/PodSyntaxTests'
version: 4.300030
-
class: Dist::Zilla::Plugin::Test::Compile
name: '@RJBS/Test::Compile'
version: 2.001
version: 5.012
-
class: Dist::Zilla::Plugin::ReportVersions::Tiny
name: '@RJBS/ReportVersions::Tiny'
version: 1.08
version: 1.10
-
class: Dist::Zilla::Plugin::Prereqs
config:
......@@ -135,57 +153,145 @@ x_Dist_Zilla:
phase: test
type: requires
name: '@RJBS/TestMoreWithSubtests'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::PodWeaver
config:
Dist::Zilla::Plugin::PodWeaver:
config_plugins:
- '@RJBS'
finder:
- ':InstallModules'
- ':ExecFiles'
plugins:
-
class: Pod::Weaver::Plugin::EnsurePod5
name: '@CorePrep/EnsurePod5'
version: 4.006
-
class: Pod::Weaver::Plugin::H1Nester
name: '@CorePrep/H1Nester'
version: 4.006
-
class: Pod::Weaver::Plugin::SingleEncoding
name: '@RJBS/SingleEncoding'
version: 4.006
-
class: Pod::Weaver::Section::Name
name: '@RJBS/Name'
version: 4.006
-
class: Pod::Weaver::Section::Version
name: '@RJBS/Version'
version: 4.006
-
class: Pod::Weaver::Section::Region
name: '@RJBS/Prelude'
version: 4.006
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Synopsis'
version: 4.006
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Description'
version: 4.006
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Overview'
version: 4.006
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Stability'
version: 4.006
-
class: Pod::Weaver::Section::Collect
name: Attributes
version: 4.006
-
class: Pod::Weaver::Section::Collect
name: Methods
version: 4.006
-
class: Pod::Weaver::Section::Collect
name: Functions
version: 4.006
-
class: Pod::Weaver::Section::Leftovers
name: '@RJBS/Leftovers'
version: 4.006
-
class: Pod::Weaver::Section::Region
name: '@RJBS/postlude'
version: 4.006
-
class: Pod::Weaver::Section::Authors
name: '@RJBS/Authors'
version: 4.006
-
class: Pod::Weaver::Section::Legal
name: '@RJBS/Legal'
version: 4.006
-
class: Pod::Weaver::Plugin::Transformer
name: '@RJBS/List'
version: 4.006
name: '@RJBS/PodWeaver'
version: 3.101641
version: 4.005
-
class: Dist::Zilla::Plugin::GithubMeta
name: '@RJBS/GithubMeta'
version: 0.28
version: 0.42
-
class: Dist::Zilla::Plugin::Git::Check
name: '@RJBS/@Git/Check'
version: 2.009
version: 2.019
-
class: Dist::Zilla::Plugin::Git::Commit
name: '@RJBS/@Git/Commit'
version: 2.009
version: 2.019
-
class: Dist::Zilla::Plugin::Git::Tag
name: '@RJBS/@Git/Tag'
version: 2.009
version: 2.019
-
class: Dist::Zilla::Plugin::Git::Push
name: '@RJBS/@Git/Push'
version: 2.009
version: 2.019
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
version: 4.300030
version: 5.012
-
class: Dist::Zilla::Plugin::FinderCode
name: ':AllFiles'
version: 5.012
-
class: Dist::Zilla::Plugin::FinderCode
name: ':NoFiles'
version: 5.012
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: 0
version: 4.300030
version: 5.012
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.012.
use strict;
use warnings;
......@@ -11,11 +12,7 @@ use ExtUtils::MakeMaker 6.30;
my %WriteMakefileArgs = (
"ABSTRACT" => "produce tied (and other) separate but combined variables",
"AUTHOR" => "Ricardo SIGNES <rjbs\@cpan.org>",
"BUILD_REQUIRES" => {
"File::Find" => 0,
"File::Temp" => 0,
"Test::More" => "0.96"
},
"BUILD_REQUIRES" => {},
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.30"
},
......@@ -29,24 +26,29 @@ my %WriteMakefileArgs = (
"strict" => 0,
"warnings" => 0
},
"VERSION" => "1.003",
"TEST_REQUIRES" => {
"Test::More" => "0.96"
},
"VERSION" => "1.004",
"test" => {
"TESTS" => "t/*.t"
}
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
my $pp = $WriteMakefileArgs{PREREQ_PM};
for my $mod ( keys %$br ) {
if ( exists $pp->{$mod} ) {
$pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
}
else {
$pp->{$mod} = $br->{$mod};
}
}
my %FallbackPrereqs = (
"Carp" => 0,
"Symbol" => 0,
"Test::More" => "0.96",
"strict" => 0,
"warnings" => 0
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
......
This archive contains the distribution IO-TieCombine,
version 1.003:
version 1.004:
produce tied (and other) separate but combined variables
This software is copyright (c) 2013 by Ricardo SIGNES.
This software is copyright (c) 2014 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
This README file was generated by Dist::Zilla::Plugin::Readme v5.012.
use strict;
use warnings;
package IO::TieCombine;
{
$IO::TieCombine::VERSION = '1.003';
}
# ABSTRACT: produce tied (and other) separate but combined variables
$IO::TieCombine::VERSION = '1.004';
use Carp ();
use IO::TieCombine::Handle;
use IO::TieCombine::Scalar;
use Symbol ();
# =head1 SYNOPSIS
#
# First, we set up a bunch of access points:
#
# my $hub = IO::TieCombine->new;
#
# my $str_ref = $hub->scalar_ref('x');
# my $fh = $hub->fh('x');
# my $callback = $hub->callback('x');
#
# tie my $scalar, $hub, 'x';
# tie local *STDOUT, $hub, 'x';
#
# tie local *STDERR, $hub, 'err';
#
# Then we write to things:
#
# $$str_ref .= 'And ';
# print $fh "now ";
# $callback->('for ');
# $scalar .= 'something ';
# print "completely ";
# warn "different.\n";
#
# And then:
#
# $hub->combined_contents; # And now for something completely different.
# $hub->slot_contents('x'); # And now for something completely
# $hub->slot_contents('err'); # different.
#
# 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
# later is needed. Since 5.10.0 is broken in so many other ways, you should
# really upgrade anyway.
#
# 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
# 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
# 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.
#
# =cut
# =method new
#
# The constructor takes no arguments.
#
# =cut
sub new {
my ($class) = @_;
......@@ -24,12 +69,24 @@ sub new {
bless $self => $class;
}
# =method combined_contents
#
# This method returns the contents of all collected data.
#
# =cut
sub combined_contents {
my ($self) = @_;
return ${ $self->{combined} };
}
# =method slot_contents
#
# my $str = $hub->slot_contents( $slot_name );
#
# This method returns the contents of all collected data for the named slot.
#
# =cut
sub slot_contents {
my ($self, $name) = @_;
......@@ -58,6 +115,13 @@ sub _tie_args {
};
}
# =method clear_slot
#
# $hub->clear_slot( $slot_name );
#
# This sets the slot back to an empty string.
#
# =cut
sub clear_slot {
my ($self, $slot_name) = @_;
......@@ -65,6 +129,14 @@ sub clear_slot {
return;
}
# =method fh
#
# my $fh = $hub->fh( $slot_name );
#
# This method returns a reference to a tied filehandle. When printed to, output
# is collected in the named slot.
#
# =cut
sub fh {
my ($self, $name) = @_;
......@@ -87,6 +159,15 @@ sub _tie_fh_args {
return ('IO::TieCombine::Handle', $self->_tie_args($name));
}
# =method scalar_ref
#
# my $str_ref = $hub->scalar_ref( $slot_name );
#
# 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
# adding new content to its end will result in an exception.
#
# =cut
sub scalar_ref {
my ($self, $name) = @_;
......@@ -107,6 +188,11 @@ sub _tie_scalar_args {
return ('IO::TieCombine::Scalar', $self->_tie_args($name));
}
# =method callback
#
# my $code = $hub->callback( $slot_name );
#
# =cut
sub callback {
my ($self, $name) = @_;
......@@ -125,13 +211,15 @@ __END__
=pod
=encoding UTF-8
=head1 NAME
IO::TieCombine - produce tied (and other) separate but combined variables
=head1 VERSION
version 1.003
version 1.004
=head1 SYNOPSIS
......@@ -222,7 +310,7 @@ Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Ricardo SIGNES.
This software is copyright (c) 2014 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......
use strict;
use warnings;
package IO::TieCombine::Handle;
{
$IO::TieCombine::Handle::VERSION = '1.003';
}
# ABSTRACT: tied filehandles for IO::TieCombine
$IO::TieCombine::Handle::VERSION = '1.004';
use Carp ();
sub TIEHANDLE {
......@@ -48,13 +45,15 @@ __END__
=pod
=encoding UTF-8
=head1 NAME
IO::TieCombine::Handle - tied filehandles for IO::TieCombine
=head1 VERSION
version 1.003
version 1.004
=head1 AUTHOR
......@@ -62,7 +61,7 @@ Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Ricardo SIGNES.
This software is copyright (c) 2014 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......
use strict;
use warnings;
package IO::TieCombine::Scalar;
{
$IO::TieCombine::Scalar::VERSION = '1.003';
}
# ABSTRACT: tied scalars for IO::TieCombine
$IO::TieCombine::Scalar::VERSION = '1.004';
use Carp ();
sub TIESCALAR {
......@@ -44,13 +41,15 @@ __END__
=pod
=encoding UTF-8
=head1 NAME
IO::TieCombine::Scalar - tied scalars for IO::TieCombine
=head1 VERSION
version 1.003
version 1.004
=head1 AUTHOR
......@@ -58,7 +57,7 @@ Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Ricardo SIGNES.
This software is copyright (c) 2014 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......
#!perl
use strict;
use warnings;
use Test::More;
use File::Find;
use File::Temp qw{ tempdir };
my @modules;
find(
sub {
return if $File::Find::name !~ /\.pm\z/;
my $found = $File::Find::name;
$found =~ s{^lib/}{};
$found =~ s{[/\\]}{::}g;
$found =~ s/\.pm$//;
# nothing to skip
push @modules, $found;
},
'lib',
);
sub _find_scripts {
my $dir = shift @_;
my @found_scripts = ();
find(
sub {
return unless -f;
my $found = $File::Find::name;
# nothing to skip
open my $FH, '<', $_ or do {
note( "Unable to open $found in ( $! ), skipping" );
return;
};
my $shebang = <$FH>;
return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
push @found_scripts, $found;
},
$dir,
);
return @found_scripts;
}
my @scripts;
do { push @scripts, _find_scripts($_) if -d $_ }
for qw{ bin script scripts };
my $plan = scalar(@modules) + scalar(@scripts);
$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
{
# fake home for cpan-testers
# no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 );
like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
for sort @modules;
SKIP: {
eval "use Test::Script 1.05; 1;";
skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;