[libmixin-extrafields-param-perl] 22/25: changes needed to become like the released dist
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 f30e57f60c513bf95b4602a4683216e1beacdfa0
Author: Ricardo SIGNES <rjbs at cpan.org>
Date: Sun Aug 12 10:30:54 2007 -0400
changes needed to become like the released dist
---
.cvsignore | 9 ---
MANIFEST | 4 +-
Makefile.PL | 17 +++--
lib/Mixin/Param.pm | 205 -----------------------------------------------------
t/00-load.t | 4 +-
t/basic.t | 3 +-
t/gc.t | 25 -------
t/multi.t | 14 ++--
t/pod-coverage.t | 14 ++--
9 files changed, 33 insertions(+), 262 deletions(-)
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 5a2d9c6..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,9 +0,0 @@
-blib*
-Makefile
-Makefile.old
-pm_to_blib*
-*.tar.gz
-.lwpcookies
-.releaserc
-Does-Param-*
-cover_db
diff --git a/MANIFEST b/MANIFEST
index c7c1027..f9bdf4e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,12 +1,10 @@
Changes
MANIFEST
-META.yml # Will be created by "make dist"
Makefile.PL
README
-lib/Mixin/Param.pm
+lib/Mixin/ExtraFields/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/Makefile.PL b/Makefile.PL
index 18f0447..00e0c34 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,18 +3,17 @@ use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
- NAME => 'Mixin::Param',
- AUTHOR => 'Ricardo Signes <rjbs at cpan.org>',
- VERSION_FROM => 'lib/Mixin/Param.pm',
- ABSTRACT_FROM => 'lib/Mixin/Param.pm',
+ NAME => 'Mixin::ExtraFields::Param',
+ AUTHOR => 'Ricardo SIGNES <rjbs at cpan.org>',
+ VERSION_FROM => 'lib/Mixin/ExtraFields/Param.pm',
+ ABSTRACT_FROM => 'lib/Mixin/ExtraFields/Param.pm',
LICENSE => 'perl',
PL_FILES => {},
PREREQ_PM => {
- 'Scalar::Util' => 0,
- 'Sub::Exporter' => 0.90,
- 'Test::More' => 0,
- 'Tie::RefHash:Weak' => 0.01,
+ 'Mixin::ExtraFields' => 0.002,
+ 'Sub::Exporter' => 0.90,
+ 'Test::More' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
- clean => { FILES => 'Mixin-Param-* cover_db' },
+ clean => { FILES => 'Mixin-ExtraFields-Param-* cover_db' },
);
diff --git a/lib/Mixin/Param.pm b/lib/Mixin/Param.pm
deleted file mode 100644
index 8d71e00..0000000
--- a/lib/Mixin/Param.pm
+++ /dev/null
@@ -1,205 +0,0 @@
-package Mixin::Param;
-
-use warnings;
-use strict;
-
-use Carp ();
-use Scalar::Util ();
-use Tie::RefHash::Weak;
-
-use Sub::Exporter -setup => {
- groups => {
- default => [ '-param' ],
- param => \&_param_gen,
- },
-};
-
-=head1 NAME
-
-Mixin::Param - make your class provide a familiar "param" method
-
-=head1 VERSION
-
-version 0.01
-
- $Id$
-
-=cut
-
-our $VERSION = '0.01';
-
-=head1 SYNOPSIS
-
- package Widget::Parametric;
- use Mixin::Param;
-
- ...
-
- my $widget = Widget::Parametric->new({ flavor => 'vanilla' });
-
- printf "%s: %s\n", $_, $widget->param($_) for $widget->param;
-
-=head1 DESCRIPTION
-
-This module mixes in to your class to provide a C<param> method like the ones
-provided by L<CGI>, L<CGI::Application>, and other classes. It doesn't store
-any information on your object, so it can work on any sort of object. It
-doesn't need a DESTROY method, so you don't need to worry about cleaning up
-your Mixin::Param values when your object is destroyed.
-
-By default, the methods provided are:
-
-=over
-
-=item * param
-
-=item * has_param
-
-=item * delete_param
-
-=back
-
-These are documented below. They are mixed in by default if you use
-Mixin::Param. You can also import them explicitly by importing the "param"
-group. These group can be passed a hashref of named arguments; see
-L<Sub::Exporter> for more information on how it works. One important argument
-is "noun", which changes the names of the methods by replacing "param" with the
-value of the "noun" argument.
-
-If the "param" group is imported multiple times with different noun values, the
-methods will operate on distinct sets of data.
-
-=head1 METHODS
-
-=cut
-
-sub _param_gen {
- my (undef, undef, $arg) = @_;
- my $P = $arg->{noun} || 'param';
-
- tie my %_params_for, 'Tie::RefHash::Weak';
-
- my %sub;
-
- $sub{"__$P\_storage_guts"} = sub { %_params_for };
-
-=head2 param
-
- my @params = $object->param; # get names of existing params
-
- my $value = $object->param('name'); # get value of a param
-
- my $value = $object->param(name => $value); # set a param's value
-
- my @values = $object->param(n1 => $v1, n2 => $v2, ...); # set many values
-
-This method sets or retrieves parameters.
-
-=cut
-
- $sub{$P} = sub {
- my $self = shift;
-
- Carp::croak "param is an instance method" unless Scalar::Util::blessed($self);
-
- my $stash = $_params_for{ $self } ||= {};
-
- return keys %$stash unless @_;
-
- @_ = %{$_[0]} if @_ == 1 and ref $_[0] eq 'HASH';
-
- Carp::croak "invalid call to param: odd, non-one number of params"
- if @_ > 1 and @_ % 2 == 1;
-
- if (@_ == 1) {
- my $key = $_[0];
- return unless exists $stash->{$key};
- return $stash->{$key};
- }
-
- my @assigned;
- while (@_) {
- # We don't put @_ into a hash because we guarantee processing (and more
- # importantly return) order. -- rjbs, 2006-03-14
- my ($key, $value) = splice @_, 0, 2;
- $stash->{$key} = $value;
- push @assigned, $value;
- }
- return wantarray ? @assigned : $assigned[0];
- };
-
-=head2 delete_param
-
- my $deleted = $object->delete_param('name'); # delete the param entirely
-
- my @deleted = $object->delete_param(@names); # delete several params
-
- my $deleted = $object->delete_param(@names); # returns the first deleted value
-
-This method deletes any entry for the named parameter(s).
-
-=cut
-
- $sub{"delete_$P"} = sub {
- my $self = shift;
- my (@keys) = @_;
-
- Carp::croak "delete_param is an instance method"
- unless Scalar::Util::blessed($self);
-
- my $stash = $_params_for{ $self } ||= {};
-
- my @deleted = map { scalar delete $stash->{$_} } @keys;
-
- return wantarray ? @deleted : $deleted[0];
- };
-
-=head2 C< has_param >
-
- if ($object->has_param($name) { ... }
-
-This method is true if the named parameter exists in the object's set of
-parameters, even if it is undefined.
-
-=cut
-
- $sub{"has_$P"} = sub {
- my ($self, $key) = @_;
-
- Carp::croak "has_param is an instance method"
- unless Scalar::Util::blessed($self);
-
- my $stash = $_params_for{ $self } ||= {};
-
- return exists $stash->{$key};
- };
-
- return \%sub;
-}
-
-=head1 AUTHOR
-
-Ricardo Signes, C<< <rjbs at cpan.org> >>
-
-=head2 THANKS
-
-Thanks to Yuval Kogman, not only for writing Tie::WeakRefHash, but for pointing
-it out to me when I said that someone should write it.
-
-=head1 BUGS
-
-Please report any bugs or feature requests to
-C<bug-mixin-param at rt.cpan.org>, or through the web interface at
-L<http://rt.cpan.org>. I will be notified, and then you'll automatically be
-notified of progress on your bug as I make changes.
-
-=head1 COPYRIGHT
-
-Copyright 2005-2006 Ricardo Signes, All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-=cut
-
-1;
diff --git a/t/00-load.t b/t/00-load.t
index 80df1ac..41b423e 100644
--- a/t/00-load.t
+++ b/t/00-load.t
@@ -1,7 +1,7 @@
use Test::More tests => 1;
BEGIN {
- use_ok('Mixin::Param');
+ use_ok('Mixin::ExtraFields::Param');
}
-diag( "Testing Mixin::Param $Mixin::Param::VERSION" );
+diag( "Testing Mixin::ExtraFields::Param $Mixin::ExtraFields::Param::VERSION" );
diff --git a/t/basic.t b/t/basic.t
index 57ca62b..7536ada 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -6,9 +6,10 @@ use Test::More tests => 11;
{
package Widget::Parameterized;
- use Mixin::Param;
+ use Mixin::ExtraFields::Param -fields => { driver => 'HashGuts' };
sub new { bless {} => shift; }
+ sub id { 0 + $_[0] }
}
my $widget = Widget::Parameterized->new;
diff --git a/t/gc.t b/t/gc.t
deleted file mode 100644
index be71e81..0000000
--- a/t/gc.t
+++ /dev/null
@@ -1,25 +0,0 @@
-#!perl -T
-use strict;
-use warnings;
-
-use Test::More tests => 3;
-
-{
- package Widget::Parameterized;
- use Mixin::Param;
-
- sub new { bless {} => shift; }
-}
-
-{
- my $widget = Widget::Parameterized->new;
- $widget->param(flavor => 'teaberry');
- $widget->param(size => 'big', limits => undef);
-
- 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->__param_storage_guts;
-ok(!(scalar %guts), "post GC, there are no params being stored universally");
diff --git a/t/multi.t b/t/multi.t
index b15fd70..4265288 100644
--- a/t/multi.t
+++ b/t/multi.t
@@ -6,12 +6,18 @@ use Test::More tests => 15;
{
package Widget::Parameterized;
- use Mixin::Param
- -param => undef,
- -param => { noun => 'field' },
- ;
+ use Mixin::ExtraFields::Param
+ -fields => { driver => 'HashGuts' },
+ -fields => {
+ moniker => 'field',
+ driver => {
+ class => 'HashGuts',
+ hash_key => 'field',
+ }
+ };
sub new { bless {} => shift; }
+ sub id { 0 + $_[0] }
}
my $widget = Widget::Parameterized->new;
diff --git a/t/pod-coverage.t b/t/pod-coverage.t
index bced814..24f1d1f 100644
--- a/t/pod-coverage.t
+++ b/t/pod-coverage.t
@@ -1,5 +1,11 @@
+#!perl -T
+
use Test::More;
-eval "use Test::Pod::Coverage 1.06";
-plan skip_all => "Test::Pod::Coverage 1.06 required for testing POD coverage"
- if $@;
-all_pod_coverage_ok();
+eval "use Test::Pod::Coverage 1.08";
+plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
+ if $@;
+
+all_pod_coverage_ok({
+ coverage_class => 'Pod::Coverage::CountParents',
+ trustme => [ ],
+});
--
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