Commit e1f93cb5 authored by gregor herrmann's avatar gregor herrmann

Imported Upstream version 0.37

parents 714d816f 5bad2ce4
Revision history for Package-Stash
0.37 2014-09-21
- fix spurious warning in taint mode (Niko Tyni, #12)
0.36 2013-09-03
- support building with PUREPERL_ONLY
......
This software is copyright (c) 2013 by Jesse Luehrs.
This software is copyright (c) 2014 by Jesse Luehrs.
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 Jesse Luehrs.
This software is Copyright (c) 2014 by Jesse Luehrs.
This is free software, licensed under:
......@@ -22,7 +22,7 @@ This is free software, licensed under:
Version 1, February 1989
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
of this license document, but changing it is not allowed.
......@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
This software is Copyright (c) 2013 by Jesse Luehrs.
This software is Copyright (c) 2014 by Jesse Luehrs.
This is free software, licensed under:
......
# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.020.
Changes
LICENSE
MANIFEST
......@@ -37,6 +38,7 @@ t/paamayim_nekdotayim.t
t/scalar-values.t
t/stash-deletion.t
t/synopsis.t
t/warnings-taint.t
t/warnings.t
xt/author/leaks-debug.t
xt/author/leaks.t
......
This diff is collapsed.
This diff is collapsed.
# This Makefile.PL for was generated by Dist::Zilla.
# Don't edit it but the dist.ini used to construct it.
BEGIN { require 5.008001; }
# This Makefile.PL for Package-Stash was generated by
# inc::MMPackageStash <self>
# and Dist::Zilla::Plugin::MakeMaker::Awesome 0.27.
# Don't edit it but the dist.ini and plugins used to construct it.
use strict;
use warnings;
use ExtUtils::MakeMaker 6.30;
use 5.008001;
use ExtUtils::MakeMaker;
check_conflicts();
my %WriteMakefileArgs = (
'ABSTRACT' => 'routines for manipulating stashes',
'AUTHOR' => 'Jesse Luehrs <doy@tozt.net>',
'BUILD_REQUIRES' => {
'File::Find' => '0',
'File::Temp' => '0',
'Test::Fatal' => '0',
'Test::More' => '0.88',
'Test::Requires' => '0',
'base' => '0',
'lib' => '0'
},
'CONFIGURE_REQUIRES' => {
'Config' => '0',
'Dist::CheckConflicts' => '0.02',
'ExtUtils::MakeMaker' => '6.30',
'File::Spec' => '0',
'Text::ParseWords' => '0'
"ABSTRACT" => "routines for manipulating stashes",
"AUTHOR" => "Jesse Luehrs <doy\@tozt.net>",
"CONFIGURE_REQUIRES" => {
"Config" => 0,
"Dist::CheckConflicts" => "0.02",
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"Text::ParseWords" => 0
},
'DISTNAME' => 'Package-Stash',
'EXE_FILES' => [
'bin/package-stash-conflicts'
"DISTNAME" => "Package-Stash",
"EXE_FILES" => [
"bin/package-stash-conflicts"
],
'LICENSE' => 'perl',
'NAME' => 'Package::Stash',
'PREREQ_PM' => {
'B' => '0',
'Carp' => '0',
'Dist::CheckConflicts' => '0.02',
'Getopt::Long' => '0',
'Module::Implementation' => '0.06',
'Scalar::Util' => '0',
'Symbol' => '0',
'constant' => '0',
'strict' => '0',
'warnings' => '0'
"LICENSE" => "perl",
"NAME" => "Package::Stash",
"PREREQ_PM" => {
"B" => 0,
"Carp" => 0,
"Dist::CheckConflicts" => "0.02",
"Getopt::Long" => 0,
"Module::Implementation" => "0.06",
"Scalar::Util" => 0,
"Symbol" => 0,
"constant" => 0,
"strict" => 0,
"warnings" => 0
},
'VERSION' => '0.36',
'test' => {
'TESTS' => 't/*.t t/impl-selection/*.t'
"TEST_REQUIRES" => {
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
"Test::Fatal" => 0,
"Test::More" => "0.88",
"Test::Requires" => 0,
"base" => 0,
"lib" => 0
},
"VERSION" => "0.37",
"test" => {
"TESTS" => "t/*.t t/impl-selection/*.t"
}
);
my %FallbackPrereqs = (
"B" => 0,
"Carp" => 0,
"Dist::CheckConflicts" => "0.02",
"File::Spec" => 0,
"Getopt::Long" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
"Module::Implementation" => "0.06",
"Scalar::Util" => 0,
"Symbol" => 0,
"Test::Fatal" => 0,
"Test::More" => "0.88",
"Test::Requires" => 0,
"base" => 0,
"constant" => 0,
"lib" => 0,
"strict" => 0,
"warnings" => 0
);
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};
}
}
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 Package-Stash,
version 0.36:
version 0.37:
routines for manipulating stashes
This software is copyright (c) 2013 by Jesse Luehrs.
This software is copyright (c) 2014 by Jesse Luehrs.
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.020.
......@@ -4,6 +4,8 @@ use strict;
use warnings;
# PODNAME: package-stash-conflicts
# this script was generated with Dist::Zilla::Plugin::Conflicts 0.16
use Getopt::Long;
use Package::Stash::Conflicts;
......@@ -23,13 +25,15 @@ __END__
=pod
=encoding UTF-8
=head1 NAME
package-stash-conflicts
=head1 VERSION
version 0.36
version 0.37
=head1 AUTHOR
......@@ -37,7 +41,7 @@ Jesse Luehrs <doy@tozt.net>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jesse Luehrs.
This software is copyright (c) 2014 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......
......@@ -3,6 +3,11 @@ author = Jesse Luehrs <doy@tozt.net>
license = Perl_5
copyright_holder = Jesse Luehrs
[FileFinder::Filter / WeaverFinder]
finder = :InstallModules
finder = :ExecFiles
skip = Conflicts.pm$
[@DOY]
:version = 0.14
dist = Package-Stash
......@@ -10,15 +15,21 @@ repository = github
awesome = =inc::MMPackageStash
dynamic_config = 1
CompileTests_skip = [Cc]onflicts$
Authority_finder = WeaverFinder
PodWeaver_finder = WeaverFinder
[AutoPrereqs]
skip = Variable::Magic
[Prereqs / RuntimeRecommends]
; XXX keep this in sync with inc/MMPackageStash.pm
Package::Stash::XS = 0.26
[Prereqs / DevelopRequires]
Test::LeakTrace = 0
; XXX can't just have a dep here because it won't install on 5.12 and below
; see .travis.yml
; Package::Anon = 0
[Conflicts]
-script = bin/package-stash-conflicts
......
......@@ -8,7 +8,8 @@ around _build_MakeFile_PL_template => sub {
my $orig = shift;
my $self = shift;
my $xs_version = $self->zilla->prereqs->requirements_for('runtime', 'recommends')->as_string_hash->{'Package::Stash::XS'};
# XXX keep this in sync with dist.ini
my $xs_version = 0.26;
# can_run and can_cc copied from M::I
my $helpers = <<'HELPERS';
......
......@@ -2,9 +2,7 @@ package Package::Stash;
BEGIN {
$Package::Stash::AUTHORITY = 'cpan:DOY';
}
{
$Package::Stash::VERSION = '0.36';
}
$Package::Stash::VERSION = '0.37';
use strict;
use warnings;
use 5.008001;
......@@ -44,13 +42,15 @@ __END__
=pod
=encoding UTF-8
=head1 NAME
Package::Stash - routines for manipulating stashes
=head1 VERSION
version 0.36
version 0.37
=head1 SYNOPSIS
......@@ -224,9 +224,8 @@ L<perlref/Making References> point 7 for more information.
=back
Please report any bugs through RT: email
C<bug-package-stash at rt.cpan.org>, or browse to
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Package-Stash>.
Please report any bugs to GitHub Issues at
L<https://github.com/doy/package-stash/issues>.
=head1 SEE ALSO
......@@ -277,7 +276,7 @@ Jesse Luehrs <doy@tozt.net>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jesse Luehrs.
This software is copyright (c) 2014 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
......
......@@ -4,6 +4,8 @@ package # hide from PAUSE
use strict;
use warnings;
# this module was generated with Dist::Zilla::Plugin::Conflicts 0.16
use Dist::CheckConflicts
-dist => 'Package::Stash',
-conflicts => {
......@@ -12,34 +14,22 @@ use Dist::CheckConflicts
'MooseX::Role::WithOverloading' => '0.08',
'namespace::clean' => '0.18',
},
-also => [ qw(
B
Carp
Dist::CheckConflicts
Getopt::Long
Module::Implementation
Scalar::Util
Symbol
constant
strict
warnings
) ],
;
1;
# ABSTRACT: Provide information on conflicts for Package::Stash
__END__
=pod
=head1 NAME
Package::Stash::Conflicts - Provide information on conflicts for Package::Stash
=head1 VERSION
version 0.36
=head1 AUTHOR
Jesse Luehrs <doy@tozt.net>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
# Dist::Zilla: -PodWeaver
......@@ -2,9 +2,7 @@ package Package::Stash::PP;
BEGIN {
$Package::Stash::PP::AUTHORITY = 'cpan:DOY';
}
{
$Package::Stash::PP::VERSION = '0.36';
}
$Package::Stash::PP::VERSION = '0.37';
use strict;
use warnings;
# ABSTRACT: pure perl implementation of the Package::Stash API
......@@ -190,6 +188,7 @@ sub add_symbol {
local *__ANON__:: = $namespace;
no strict 'refs';
no warnings 'void';
no warnings 'once';
*{"__ANON__::$name"};
}
......@@ -417,13 +416,15 @@ __END__
=pod
=encoding UTF-8
=head1 NAME
Package::Stash::PP - pure perl implementation of the Package::Stash API
=head1 VERSION
version 0.36
version 0.37
=head1 SYNOPSIS
......@@ -521,7 +522,7 @@ Jesse Luehrs <doy@tozt.net>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Jesse Luehrs.
This software is copyright (c) 2014 by Jesse Luehrs.
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 5.006;
use strict;
use warnings;
use Test::More;
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.043
use Test::More tests => 4 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
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',
my @module_files = (
'Package/Stash.pm',
'Package/Stash/Conflicts.pm',
'Package/Stash/PP.pm'
);
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 = (
'bin/package-stash-conflicts'
);
# no fake home requested
my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
my @scripts;
do { push @scripts, _find_scripts($_) if -d $_ }
for qw{ bin script scripts };
use File::Spec;
use IPC::Open3;
use IO::Handle;
my $plan = scalar(@modules) + scalar(@scripts);
$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
my @warnings;
for my $lib (@module_files)
{
# 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 $@;
foreach my $file ( @scripts ) {
my $script = $file;
$script =~ s!.*/!!;
script_compiles( $file, "$script script compiles" );
}
}
# see L<perlfaq8/How can I capture STDERR from an external command?>
my $stderr = IO::Handle->new;
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
if (@_warnings)
{
warn @_warnings;
push @warnings, @_warnings;
}
}
foreach my $file (@scripts)
{ SKIP: {
open my $fh, '<', $file or warn("Unable to open $file: $!"), next;
my $line = <$fh>;
close $fh and skip("$file isn't perl", 1) unless $line =~ /^#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my @flags = $1 ? split(' ', $1) : ();
my $stderr = IO::Handle->new;
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, @flags, '-c', $file);
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$file compiled ok");
# in older perls, -c output is simply the file portion of the path being tested
if (@_warnings = grep { !/\bsyntax OK$/ }
grep { chomp; $_ ne (File::Spec->splitpath($file))[2] } @_warnings)
{
warn @_warnings;
push @warnings, @_warnings;
}
} }
is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING};
......@@ -5,13 +5,16 @@ use lib 't/lib';
use Test::More;
use Test::Fatal;
use Test::Requires 'Package::Anon';
use Package::Stash;
use Symbol;
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
BEGIN {
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
}
use Test::Requires 'Package::Anon';
use Symbol;
my $Foo = Package::Anon->new('Foo');
$Foo->{SOME_CONSTANT} = \1;
......
......@@ -5,14 +5,16 @@ use Test::More;
use Test::Fatal;
use lib 't/lib';
use Test::Requires 'Package::Anon';
use Package::Stash;
use Symbol;
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
BEGIN {
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
}
use Test::Requires 'Package::Anon';
use Symbol;
my $anon = Package::Anon->new;
my $stash = Package::Stash->new($anon);
......
......@@ -6,13 +6,16 @@ use Test::More;
use Test::Fatal;
use Package::Stash;
use Symbol;
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
BEGIN {
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
plan skip_all => "This isn't really going to work yet, probably";
}
plan skip_all => "This isn't really going to work yet, probably";
use Symbol;
my $Foo = {};
$Foo->{SOME_CONSTANT} = \1;
......
......@@ -6,13 +6,16 @@ use Test::Fatal;
use lib 't/lib';
use Package::Stash;
use Symbol;
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
BEGIN {
plan skip_all => "Anonymous stashes in PP need at least perl 5.14"
if $] < 5.014
&& $Package::Stash::IMPLEMENTATION eq 'PP';
plan skip_all => "This isn't really going to work yet, probably";
}
plan skip_all => "This isn't really going to work yet, probably";
use Symbol;
my $anon = {};
my $stash = Package::Stash->new($anon);
......
$Package::Stash::IMPLEMENTATION = 'PP';
do 'lib/Package/Stash.pm';
do './lib/Package/Stash.pm' or die $@ || $!;
1;
#!/usr/bin/env perl -T
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Package::Stash;
my $warnings;
BEGIN {
$warnings = '';
$SIG{__WARN__} = sub { $warnings .= $_[0] };
}
BEGIN {
my $stash = Package::Stash->new('Foo');
$stash->get_or_add_symbol('$bar');
}
is($warnings, '');
done_testing;
#!/usr/bin/env perl
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Package::Stash;
......
use strict;
use warnings;
use Test::More;
eval 'use Test::NoTabs';
plan skip_all => 'Test::NoTabs required' if $@;
# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.08
all_perl_files_ok();
use Test::More 0.88;
use Test::NoTabs;
my @files = (
'bin/package-stash-conflicts',
'lib/Package/Stash.pm',
'lib/Package/Stash/Conflicts.pm',
'lib/Package/Stash/PP.pm',
't/00-compile.t',
't/addsub.t',
't/anon-basic.t',
't/anon.t',
't/bare-anon-basic.t',
't/bare-anon.t',
't/basic.t',
't/compile-time.t',
't/edge-cases.t',
't/extension.t',
't/get.t',
't/impl-selection/basic-pp.t',
't/impl-selection/basic-xs.t',
't/impl-selection/bug-rt-78272.t',
't/impl-selection/choice.t',
't/impl-selection/env.t',
't/impl-selection/var.t',
't/io.t',
't/isa.t',
't/lib/CompileTime.pm',
't/lib/Package/Stash.pm',
't/magic.t',
't/paamayim_nekdotayim.t',
't/scalar-values.t',
't/stash-deletion.t',
't/synopsis.t',
't/warnings-taint.t',
<