Commit 9f866cf3 authored by gregor herrmann's avatar gregor herrmann

Imported Upstream version 1.001

parent 7ba2a744
Revision history for IO-TieCombine
1.001 2011-12-09 10:52:01 America/New_York
TieCombine filehandles now respect $\ so that "say $tied" will work;
this fixes [rt.cpan.org #73131]
1.000 2008-10-16
first release
This software is copyright (c) 2008 by Ricardo SIGNES.
This software is copyright (c) 2011 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as perl itself.
the same terms as the Perl 5 programming language system itself.
Terms of Perl itself
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
......@@ -12,21 +12,22 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2008 by Ricardo SIGNES.
This software is Copyright (c) 2011 by Ricardo SIGNES.
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
51 Franklin St, Suite 500, Boston, MA 02110-1335 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
......@@ -67,7 +68,7 @@ authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
......@@ -185,7 +186,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
......@@ -207,9 +208,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
......@@ -235,8 +236,9 @@ the exclusion of warranty; and each file should have at least the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
......@@ -270,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
This software is Copyright (c) 2008 by Ricardo SIGNES.
This software is Copyright (c) 2011 by Ricardo SIGNES.
This is free software, licensed under:
......
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/IO/TieCombine.pm
lib/IO/TieCombine/Handle.pm
lib/IO/TieCombine/Scalar.pm
t/basic.t
\ No newline at end of file
t/basic.t
t/release-pod-syntax.t
{
"abstract" : "produce tied (and other) separate but combined variables",
"author" : [
"Ricardo SIGNES <rjbs@cpan.org>"
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 4.300003, CPAN::Meta::Converter version 2.112621",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "IO-TieCombine",
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.30"
}
},
"runtime" : {
"requires" : {
"Carp" : 0,
"Symbol" : 0,
"strict" : 0,
"warnings" : 0
}
},
"test" : {
"requires" : {
"Test::More" : "0.96"
}
}
},
"release_status" : "stable",
"resources" : {
"homepage" : "https://github.com/rjbs/io-tiecombine",
"repository" : {
"type" : "git",
"url" : "https://github.com/rjbs/io-tiecombine.git",
"web" : "https://github.com/rjbs/io-tiecombine"
}
},
"version" : "1.001",
"x_Dist_Zilla" : {
"plugins" : [
{
"class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
"name" : "@RJBS/CheckPrereqsIndexed",
"version" : "0.007"
},
{
"class" : "Dist::Zilla::Plugin::GatherDir",
"name" : "@RJBS/@Basic/GatherDir",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::PruneCruft",
"name" : "@RJBS/@Basic/PruneCruft",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::ManifestSkip",
"name" : "@RJBS/@Basic/ManifestSkip",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::MetaYAML",
"name" : "@RJBS/@Basic/MetaYAML",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::License",
"name" : "@RJBS/@Basic/License",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::Readme",
"name" : "@RJBS/@Basic/Readme",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::ExtraTests",
"name" : "@RJBS/@Basic/ExtraTests",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
"name" : "@RJBS/@Basic/ExecDir",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::ShareDir",
"name" : "@RJBS/@Basic/ShareDir",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
"name" : "@RJBS/@Basic/MakeMaker",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::Manifest",
"name" : "@RJBS/@Basic/Manifest",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::TestRelease",
"name" : "@RJBS/@Basic/TestRelease",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::ConfirmRelease",
"name" : "@RJBS/@Basic/ConfirmRelease",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::UploadToCPAN",
"name" : "@RJBS/@Basic/UploadToCPAN",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::AutoPrereqs",
"name" : "@RJBS/AutoPrereqs",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::Git::NextVersion",
"name" : "@RJBS/Git::NextVersion",
"version" : "1.113220"
},
{
"class" : "Dist::Zilla::Plugin::PkgVersion",
"name" : "@RJBS/PkgVersion",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::MetaConfig",
"name" : "@RJBS/MetaConfig",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::MetaJSON",
"name" : "@RJBS/MetaJSON",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::NextRelease",
"name" : "@RJBS/NextRelease",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::PodSyntaxTests",
"name" : "@RJBS/PodSyntaxTests",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::Repository",
"name" : "@RJBS/Repository",
"version" : "0.18"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
"config" : {
"Dist::Zilla::Plugin::Prereqs" : {
"phase" : "test",
"type" : "requires"
}
},
"name" : "@RJBS/TestMoreWithSubtests",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::PodWeaver",
"name" : "@RJBS/PodWeaver",
"version" : "3.101641"
},
{
"class" : "Dist::Zilla::Plugin::GithubMeta",
"name" : "@RJBS/GithubMeta",
"version" : "0.28"
},
{
"class" : "Dist::Zilla::Plugin::Git::Check",
"name" : "@RJBS/@Git/Check",
"version" : "1.113220"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"name" : "@RJBS/@Git/Commit",
"version" : "1.113220"
},
{
"class" : "Dist::Zilla::Plugin::Git::Tag",
"name" : "@RJBS/@Git/Tag",
"version" : "1.113220"
},
{
"class" : "Dist::Zilla::Plugin::Git::Push",
"name" : "@RJBS/@Git/Push",
"version" : "1.113220"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":InstallModules",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":IncModules",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":TestFiles",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExecFiles",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ShareFiles",
"version" : "4.300003"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":MainModule",
"version" : "4.300003"
}
],
"zilla" : {
"class" : "Dist::Zilla::Dist::Builder",
"config" : {
"is_trial" : "0"
},
"version" : "4.300003"
}
}
}
---
abstract: produce tied (and other) separate but combined variables
author:
- Ricardo SIGNES <rjbs@cpan.org>
generated_by: Dist::Zilla::Plugin::MetaYaml version 1.002
---
abstract: 'produce tied (and other) separate but combined variables'
author:
- 'Ricardo SIGNES <rjbs@cpan.org>'
build_requires:
Test::More: 0.96
configure_requires:
ExtUtils::MakeMaker: 6.30
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.300003, CPAN::Meta::Converter version 2.112621'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: IO-TieCombine
requires: {}
version: 1.000
requires:
Carp: 0
Symbol: 0
strict: 0
warnings: 0
resources:
homepage: https://github.com/rjbs/io-tiecombine
repository: https://github.com/rjbs/io-tiecombine.git
version: 1.001
x_Dist_Zilla:
plugins:
-
class: Dist::Zilla::Plugin::CheckPrereqsIndexed
name: '@RJBS/CheckPrereqsIndexed'
version: 0.007
-
class: Dist::Zilla::Plugin::GatherDir
name: '@RJBS/@Basic/GatherDir'
version: 4.300003
-
class: Dist::Zilla::Plugin::PruneCruft
name: '@RJBS/@Basic/PruneCruft'
version: 4.300003
-
class: Dist::Zilla::Plugin::ManifestSkip
name: '@RJBS/@Basic/ManifestSkip'
version: 4.300003
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@RJBS/@Basic/MetaYAML'
version: 4.300003
-
class: Dist::Zilla::Plugin::License
name: '@RJBS/@Basic/License'
version: 4.300003
-
class: Dist::Zilla::Plugin::Readme
name: '@RJBS/@Basic/Readme'
version: 4.300003
-
class: Dist::Zilla::Plugin::ExtraTests
name: '@RJBS/@Basic/ExtraTests'
version: 4.300003
-
class: Dist::Zilla::Plugin::ExecDir
name: '@RJBS/@Basic/ExecDir'
version: 4.300003
-
class: Dist::Zilla::Plugin::ShareDir
name: '@RJBS/@Basic/ShareDir'
version: 4.300003
-
class: Dist::Zilla::Plugin::MakeMaker
name: '@RJBS/@Basic/MakeMaker'
version: 4.300003
-
class: Dist::Zilla::Plugin::Manifest
name: '@RJBS/@Basic/Manifest'
version: 4.300003
-
class: Dist::Zilla::Plugin::TestRelease
name: '@RJBS/@Basic/TestRelease'
version: 4.300003
-
class: Dist::Zilla::Plugin::ConfirmRelease
name: '@RJBS/@Basic/ConfirmRelease'
version: 4.300003
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@RJBS/@Basic/UploadToCPAN'
version: 4.300003
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: '@RJBS/AutoPrereqs'
version: 4.300003
-
class: Dist::Zilla::Plugin::Git::NextVersion
name: '@RJBS/Git::NextVersion'
version: 1.113220
-
class: Dist::Zilla::Plugin::PkgVersion
name: '@RJBS/PkgVersion'
version: 4.300003
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@RJBS/MetaConfig'
version: 4.300003
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@RJBS/MetaJSON'
version: 4.300003
-
class: Dist::Zilla::Plugin::NextRelease
name: '@RJBS/NextRelease'
version: 4.300003
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@RJBS/PodSyntaxTests'
version: 4.300003
-
class: Dist::Zilla::Plugin::Repository
name: '@RJBS/Repository'
version: 0.18
-
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
phase: test
type: requires
name: '@RJBS/TestMoreWithSubtests'
version: 4.300003
-
class: Dist::Zilla::Plugin::PodWeaver
name: '@RJBS/PodWeaver'
version: 3.101641
-
class: Dist::Zilla::Plugin::GithubMeta
name: '@RJBS/GithubMeta'
version: 0.28
-
class: Dist::Zilla::Plugin::Git::Check
name: '@RJBS/@Git/Check'
version: 1.113220
-
class: Dist::Zilla::Plugin::Git::Commit
name: '@RJBS/@Git/Commit'
version: 1.113220
-
class: Dist::Zilla::Plugin::Git::Tag
name: '@RJBS/@Git/Tag'
version: 1.113220
-
class: Dist::Zilla::Plugin::Git::Push
name: '@RJBS/@Git/Push'
version: 1.113220
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
version: 4.300003
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
version: 4.300003
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
version: 4.300003
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
version: 4.300003
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
version: 4.300003
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
version: 4.300003
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: 0
version: 4.300003
......@@ -2,17 +2,55 @@
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
DISTNAME => 'IO-TieCombine',
NAME => 'IO::TieCombine',
AUTHOR => 'Ricardo\ SIGNES\ \<rjbs\@cpan\.org\>',
ABSTRACT => 'produce tied (and other) separate but combined variables',
VERSION => '1.000',
EXE_FILES => [ qw() ],
(eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
PREREQ_PM => {
use ExtUtils::MakeMaker 6.30;
my %WriteMakefileArgs = (
"ABSTRACT" => "produce tied (and other) separate but combined variables",
"AUTHOR" => "Ricardo SIGNES <rjbs\@cpan.org>",
"BUILD_REQUIRES" => {
"Test::More" => "0.96"
},
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.30"
},
"DISTNAME" => "IO-TieCombine",
"EXE_FILES" => [],
"LICENSE" => "perl",
"NAME" => "IO::TieCombine",
"PREREQ_PM" => {
"Carp" => 0,
"Symbol" => 0,
"strict" => 0,
"warnings" => 0
},
"VERSION" => "1.001",
"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};
}
}
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
This archive contains the distribution IO-TieCombine, version
1.000:
This archive contains the distribution IO-TieCombine,
version 1.001:
produce tied (and other) separate but combined variables
This software is copyright (c) 2008 by Ricardo SIGNES.
This software is copyright (c) 2011 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as perl itself.
the same terms as the Perl 5 programming language system itself.
name = IO-TieCombine
author = Ricardo SIGNES <rjbs@cpan.org>
license = Perl_5
copyright_holder = Ricardo SIGNES
[@RJBS]
use strict;
use warnings;
package IO::TieCombine;
our $VERSION = '1.000';
{
$IO::TieCombine::VERSION = '1.001';
}
# ABSTRACT: produce tied (and other) separate but combined variables
use Carp ();
......@@ -58,6 +59,13 @@ sub _tie_args {
}
sub clear_slot {
my ($self, $slot_name) = @_;
${ $self->_slot_ref($slot_name) } = '';
return;
}
sub fh {
my ($self, $name) = @_;
......@@ -114,7 +122,6 @@ sub callback {
1;
__END__
=pod
=head1 NAME
......@@ -123,37 +130,37 @@ IO::TieCombine - produce tied (and other) separate but combined variables
=head1 VERSION
version 1.000
version 1.001
=head1 SYNOPSIS
First, we set up a bunch of access points:
my $hub = IO::TieCombine->new;
my $hub = IO::TieCombine->new;
my $str_ref = $hub->scalar_ref('x');
my $fh = $hub->fh('x');
my $callback = $hub->callback('x');
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 my $scalar, $hub, 'x';
tie local *STDOUT, $hub, 'x';
tie local *STDERR, $hub, 'err';
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";
$$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.
$hub->combined_contents; # And now for something completely different.
$hub->slot_contents('x'); # And now for something completely
$hub->slot_contents('err'); # different.
=head1 METHODS
......@@ -167,20 +174,26 @@ This method returns the contents of all collected data.
=head2 slot_contents
my $str = $hub->slot_contents( $slot_name );
my $str = $hub->slot_contents( $slot_name );
This method returns the contents of all collected data for the named slot.
=head2 clear_slot
$hub->clear_slot( $slot_name );
This sets the slot back to an empty string.
=head2 fh
my $fh = $hub->fh( $slot_name );
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.
=head2 scalar_ref
my $str_ref = $hub->scalar_ref( $slot_name );
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
......@@ -188,19 +201,18 @@ adding new content to its end will result in an exception.
=head2 callback
my $code = $hub->callback( $slot_name );
my $code = $hub->callback( $slot_name );
=head1 AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE