Commit d2f36e20 authored by Alessandro Ghedini's avatar Alessandro Ghedini

Imported Upstream version 0.31

parent 033455f6
Revision history for Package-Stash Revision history for Package-Stash
0.31 2011-08-08
- fix ->add_symbol('$foo', qr/sdlfk/) on 5.12+
- fix ->add_symbol('$foo', \v1.2.3) on 5.10+
0.30 2011-07-21 0.30 2011-07-21
- fix compiler detection in Makefile.PL (ribasushi) - fix compiler detection in Makefile.PL (ribasushi)
......
...@@ -13,25 +13,28 @@ lib/Package/Stash.pm ...@@ -13,25 +13,28 @@ lib/Package/Stash.pm
lib/Package/Stash/Conflicts.pm lib/Package/Stash/Conflicts.pm
lib/Package/Stash/PP.pm lib/Package/Stash/PP.pm
t/00-compile.t t/00-compile.t
t/01-basic.t t/addsub.t
t/02-extension.t
t/03-io.t
t/04-get.t
t/05-isa.t
t/06-addsub.t
t/07-edge-cases.t
t/10-synopsis.t
t/author-20-leaks.t t/author-20-leaks.t
t/author-21-leaks-debug.t t/author-21-leaks-debug.t
t/impl-selection/01-choice.t t/basic.t
t/impl-selection/02-env.t t/compile-time.t
t/impl-selection/03-var.t t/edge-cases.t
t/impl-selection/10-basic-pp.t t/extension.t
t/impl-selection/11-basic-xs.t t/get.t
t/impl-selection/basic-pp.t
t/impl-selection/basic-xs.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/CompileTime.pm
t/lib/Package/Stash.pm t/lib/Package/Stash.pm
t/release-eol.t t/release-eol.t
t/release-no-tabs.t t/release-no-tabs.t
t/release-pod-coverage.t t/release-pod-coverage.t
t/release-pod-syntax.t t/release-pod-syntax.t
t/scalar-values.t
t/stash-deletion.t
t/synopsis.t
weaver.ini weaver.ini
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
"Package::Stash::XS" : "0.22" "Package::Stash::XS" : "0.22"
}, },
"requires" : { "requires" : {
"Dist::CheckConflicts" : "0.02",
"Package::DeprecationManager" : 0, "Package::DeprecationManager" : 0,
"Scalar::Util" : 0, "Scalar::Util" : 0,
"perl" : "v5.8.1" "perl" : "v5.8.1"
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
"web" : "http://github.com/doy/package-stash" "web" : "http://github.com/doy/package-stash"
} }
}, },
"version" : "0.30", "version" : "0.31",
"x_Dist_Zilla" : { "x_Dist_Zilla" : {
"plugins" : [ "plugins" : [
{ {
...@@ -262,7 +263,7 @@ ...@@ -262,7 +263,7 @@
{ {
"class" : "Dist::Zilla::Plugin::Conflicts", "class" : "Dist::Zilla::Plugin::Conflicts",
"name" : "Conflicts", "name" : "Conflicts",
"version" : "0.07" "version" : "0.08"
}, },
{ {
"class" : "Dist::Zilla::Plugin::FinderCode", "class" : "Dist::Zilla::Plugin::FinderCode",
......
...@@ -19,12 +19,13 @@ name: Package-Stash ...@@ -19,12 +19,13 @@ name: Package-Stash
recommends: recommends:
Package::Stash::XS: 0.22 Package::Stash::XS: 0.22
requires: requires:
Dist::CheckConflicts: 0.02
Package::DeprecationManager: 0 Package::DeprecationManager: 0
Scalar::Util: 0 Scalar::Util: 0
perl: 5.8.1 perl: 5.8.1
resources: resources:
repository: git://github.com/doy/package-stash.git repository: git://github.com/doy/package-stash.git
version: 0.30 version: 0.31
x_Dist_Zilla: x_Dist_Zilla:
plugins: plugins:
- -
...@@ -190,7 +191,7 @@ x_Dist_Zilla: ...@@ -190,7 +191,7 @@ x_Dist_Zilla:
- -
class: Dist::Zilla::Plugin::Conflicts class: Dist::Zilla::Plugin::Conflicts
name: Conflicts name: Conflicts
version: 0.07 version: 0.08
- -
class: Dist::Zilla::Plugin::FinderCode class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules' name: ':InstallModules'
......
...@@ -25,10 +25,11 @@ my %WriteMakefileArgs = ( ...@@ -25,10 +25,11 @@ my %WriteMakefileArgs = (
'LICENSE' => 'perl', 'LICENSE' => 'perl',
'NAME' => 'Package::Stash', 'NAME' => 'Package::Stash',
'PREREQ_PM' => { 'PREREQ_PM' => {
'Dist::CheckConflicts' => '0.02',
'Package::DeprecationManager' => '0', 'Package::DeprecationManager' => '0',
'Scalar::Util' => '0' 'Scalar::Util' => '0'
}, },
'VERSION' => '0.30', 'VERSION' => '0.31',
'test' => { 'test' => {
'TESTS' => 't/*.t t/impl-selection/*.t' 'TESTS' => 't/*.t t/impl-selection/*.t'
} }
......
This archive contains the distribution Package-Stash, This archive contains the distribution Package-Stash,
version 0.30: version 0.31:
routines for manipulating stashes routines for manipulating stashes
......
package Package::Stash; package Package::Stash;
BEGIN { BEGIN {
$Package::Stash::VERSION = '0.30'; $Package::Stash::VERSION = '0.31';
} }
use strict; use strict;
use warnings; use warnings;
...@@ -102,7 +102,7 @@ Package::Stash - routines for manipulating stashes ...@@ -102,7 +102,7 @@ Package::Stash - routines for manipulating stashes
=head1 VERSION =head1 VERSION
version 0.30 version 0.31
=head1 SYNOPSIS =head1 SYNOPSIS
......
...@@ -12,6 +12,7 @@ use Dist::CheckConflicts ...@@ -12,6 +12,7 @@ use Dist::CheckConflicts
'namespace::clean' => '0.18', 'namespace::clean' => '0.18',
}, },
-also => [ qw( -also => [ qw(
Dist::CheckConflicts
Package::DeprecationManager Package::DeprecationManager
Scalar::Util Scalar::Util
) ], ) ],
......
package Package::Stash::PP; package Package::Stash::PP;
BEGIN { BEGIN {
$Package::Stash::PP::VERSION = '0.30'; $Package::Stash::PP::VERSION = '0.31';
} }
use strict; use strict;
use warnings; use warnings;
...@@ -99,7 +99,7 @@ sub _valid_for_type { ...@@ -99,7 +99,7 @@ sub _valid_for_type {
} }
else { else {
my $ref = reftype($value); my $ref = reftype($value);
return !defined($ref) || $ref eq 'SCALAR' || $ref eq 'REF' || $ref eq 'LVALUE'; return !defined($ref) || $ref eq 'SCALAR' || $ref eq 'REF' || $ref eq 'LVALUE' || $ref eq 'REGEXP' || $ref eq 'VSTRING';
} }
} }
...@@ -354,7 +354,7 @@ Package::Stash::PP - pure perl implementation of the Package::Stash API ...@@ -354,7 +354,7 @@ Package::Stash::PP - pure perl implementation of the Package::Stash API
=head1 VERSION =head1 VERSION
version 0.30 version 0.31
=head1 SYNOPSIS =head1 SYNOPSIS
......
#!/usr/bin/env perl
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use_ok('CompileTime');
done_testing;
...@@ -53,32 +53,4 @@ is(ref($constant), 'CODE', "expanded a constant into a coderef"); ...@@ -53,32 +53,4 @@ is(ref($constant), 'CODE', "expanded a constant into a coderef");
is(ref($stash->get_symbol('$glob')), '', "nothing yet"); is(ref($stash->get_symbol('$glob')), '', "nothing yet");
is(ref($stash->get_or_add_symbol('$glob')), 'SCALAR', "got an empty scalar"); is(ref($stash->get_or_add_symbol('$glob')), 'SCALAR', "got an empty scalar");
my $Bar = Package::Stash->new('Bar');
my $foo = 3;
$foo =~ s/3/4/;
my $bar = 4.5;
$bar =~ s/4/5/;
is(exception { $Bar->add_symbol('$foo', \$foo) }, undef,
"can add PVIV values");
is(exception { $Bar->add_symbol('$bar', \$bar) }, undef,
"can add PVNV values");
use_ok('CompileTime');
{
package Gets::Deleted;
sub bar { }
}
{
my $delete = Package::Stash->new('Gets::Deleted');
ok($delete->has_symbol('&bar'), "sees the method");
{
no strict 'refs';
delete ${'main::Gets::'}{'Deleted::'};
}
ok(!$delete->has_symbol('&bar'), "method goes away when stash is deleted");
}
done_testing; done_testing;
#!/usr/bin/env perl
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Test::Fatal;
use B;
use Package::Stash;
use Scalar::Util qw(reftype);
use Symbol;
my $Bar = Package::Stash->new('Bar');
my $pviv = 3;
$pviv =~ s/3/4/;
isa_ok(B::svref_2object(\$pviv), 'B::PVIV');
is(exception { $Bar->add_symbol('$pviv', \$pviv) }, undef,
"can add PVIV values");
my $pvnv = 4.5;
$pvnv =~ s/4/5/;
isa_ok(B::svref_2object(\$pvnv), 'B::PVNV');
is(exception { $Bar->add_symbol('$pvnv', \$pvnv) }, undef,
"can add PVNV values");
my $pvmg = "foo";
bless \$pvmg, 'Foo';
isa_ok(B::svref_2object(\$pvmg), 'B::PVMG');
is(exception { $Bar->add_symbol('$pvmg', \$pvmg) }, undef,
"can add PVMG values");
my $regexp = qr/foo/;
isa_ok(B::svref_2object($regexp), ($] < 5.012 ? 'B::PVMG' : 'B::REGEXP'));
is(exception { $Bar->add_symbol('$regexp', $regexp) }, undef,
"can add REGEXP values");
my $pvgv = Symbol::gensym;
isa_ok(B::svref_2object($pvgv), 'B::GV');
isnt(exception { $Bar->add_symbol('$pvgv', $pvgv) }, undef,
"can't add PVGV values");
my $pvlv = "foo";
isa_ok(B::svref_2object(\substr($pvlv, 0, 1)), 'B::PVLV');
is(exception { $Bar->add_symbol('$pvlv', \substr($pvlv, 0, 1)) }, undef,
"can add PVLV values");
my $vstring = v1.2.3;
is(reftype(\$vstring), ($] < 5.010 ? 'SCALAR' : 'VSTRING'));
is(exception { $Bar->add_symbol('$vstring', \$vstring) }, undef,
"can add vstring values");
done_testing;
#!/usr/bin/env perl
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Package::Stash;
{
package Gets::Deleted;
sub bar { }
}
{
my $delete = Package::Stash->new('Gets::Deleted');
ok($delete->has_symbol('&bar'), "sees the method");
{
no strict 'refs';
delete ${'main::Gets::'}{'Deleted::'};
}
ok(!$delete->has_symbol('&bar'), "method goes away when stash is deleted");
}
done_testing;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment