[libmixin-extrafields-param-perl] 14/25: r20939 at knave: rjbs | 2006-04-12 22:46:42 -0400 more isolation of stuff

Florian Schlichting fsfs at moszumanska.debian.org
Wed Jan 29 21:00:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

fsfs pushed a commit to annotated tag 0.001
in repository libmixin-extrafields-param-perl.

commit 968f7f83992669f0d245efc9ed8cf82a96aaf38d
Author: Ricardo SIGNES <rjbs at codesimply.com>
Date:   Thu Apr 13 02:47:31 2006 +0000

     r20939 at knave:  rjbs | 2006-04-12 22:46:42 -0400
     more isolation of stuff
---
 MANIFEST           |  3 +++
 lib/Mixin/Param.pm | 11 +++++++----
 t/basic.t          |  2 +-
 t/gc.t             |  6 +++---
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/MANIFEST b/MANIFEST
index b768fda..c4fa0dd 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5,5 +5,8 @@ Makefile.PL
 README
 lib/Mixin/Param.pm
 t/00-load.t
+t/basic.t
+t/gc.t
+t/multi.t
 t/pod-coverage.t
 t/pod.t
diff --git a/lib/Mixin/Param.pm b/lib/Mixin/Param.pm
index 187ae20..10c7bdb 100644
--- a/lib/Mixin/Param.pm
+++ b/lib/Mixin/Param.pm
@@ -65,13 +65,16 @@ provided by L<CGI>, L<CGI::Application>, and other classes.
 #sub __params_storage_guts { %_params_for }
 
 sub _param_gen {
+  my (undef, undef, $arg) = @_;
+  my $P = $arg->{noun} || 'param';
+
   tie my %_params_for, 'Tie::RefHash::Weak';
 
   my %sub;
 
-  $sub{__params_storage_guts} = sub { %_params_for };
+  $sub{"__$P\_storage_guts"} = sub { %_params_for };
 
-  $sub{param} = sub {
+  $sub{$P} = sub {
     my $self = shift;
     
     Carp::croak "param is an instance method" unless Scalar::Util::blessed($self);
@@ -112,7 +115,7 @@ sub _param_gen {
 
 =cut
 
-  $sub{delete_param} = sub {
+  $sub{"delete_$P"} = sub {
     my $self = shift;
     my (@keys) = @_;
     
@@ -132,7 +135,7 @@ sub _param_gen {
 
 =cut
 
-  $sub{has_param} = sub {
+  $sub{"has_$P"} = sub {
     my ($self, $key) = @_;
     
     Carp::croak "delete_param is an instance method"
diff --git a/t/basic.t b/t/basic.t
index b23cc96..57ca62b 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More 'no_plan';
+use Test::More tests => 11;
 
 {
   package Widget::Parameterized;
diff --git a/t/gc.t b/t/gc.t
index 8a72e1a..be71e81 100644
--- a/t/gc.t
+++ b/t/gc.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More 'no_plan';
+use Test::More tests => 3;
 
 {
   package Widget::Parameterized;
@@ -16,10 +16,10 @@ use Test::More 'no_plan';
   $widget->param(flavor => 'teaberry');
   $widget->param(size => 'big', limits => undef);
 
-  my %guts = Widget::Parameterized->__params_storage_guts;
+  my %guts = Widget::Parameterized->__param_storage_guts;
   ok(scalar %guts, "there are some params being stored universally (duh)");
   ok($guts{$widget}, "the widget has some params");
 }
 
-my %guts = Widget::Parameterized->__params_storage_guts;
+my %guts = Widget::Parameterized->__param_storage_guts;
 ok(!(scalar %guts), "post GC, there are no params being stored universally");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmixin-extrafields-param-perl.git



More information about the Pkg-perl-cvs-commits mailing list