summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2019-12-27 17:09:17 +0100
committergregor herrmann <gregoa@debian.org>2019-12-27 17:09:17 +0100
commit57e23ada047a72bf757174b2624966746abc4ad7 (patch)
tree79ff87f86a0502a4dfb541ffb47c9075431c8662
parent859d012ef4bf9217463786b7f7babe7e507fe7d8 (diff)
New upstream version 0.08
-rw-r--r--Changes8
-rw-r--r--MANIFEST4
-rw-r--r--META.json42
-rw-r--r--META.yml39
-rw-r--r--Makefile.PL1
-rw-r--r--lib/Package/New.pm6
-rw-r--r--lib/Package/New/Dump.pm13
-rw-r--r--perl-Package-New.spec8
-rw-r--r--t/001_load.t9
-rw-r--r--t/004_dump.t18
10 files changed, 115 insertions, 33 deletions
diff --git a/Changes b/Changes
index d6b45be..90b8913 100644
--- a/Changes
+++ b/Changes
@@ -1,8 +1,16 @@
Revision history for Perl module Package::New
+0.08 2019-12-14
+ - Updated t/001_load.t - Added test cases from cpancover.com
+ - Added t/004_dump.t - Added test cases from cpancover.com
+ - Updated lib/Package/New/Dump.pm - Slightly refactored dump method
+
0.07 2011-12-01
- Cleaned up for Fedora 16
+0.06 2011-08-01
+ - Abandoned Fork
+
0.05_2 2011-02-24
- Documentation
diff --git a/MANIFEST b/MANIFEST
index 532d7b7..8d10117 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -9,5 +9,7 @@ lib/Package/New/Dump.pm
t/001_load.t
t/002_base.t
t/003_dump.t
+t/004_dump.t
perl-Package-New.spec
-META.yml Module meta-data (added by MakeMaker)
+META.yml Module YAML meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by MakeMaker)
diff --git a/META.json b/META.json
new file mode 100644
index 0000000..f91496d
--- /dev/null
+++ b/META.json
@@ -0,0 +1,42 @@
+{
+ "abstract" : "Simple base package from which to inherit",
+ "author" : [
+ "Michael R. Davis (mdavis@stopllc.com)"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.120351",
+ "license" : [
+ "unknown"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "Package-New",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Devel::Hide" : "0",
+ "Test::Simple" : "0.44"
+ }
+ }
+ },
+ "release_status" : "stable",
+ "version" : "0.08"
+}
diff --git a/META.yml b/META.yml
index 2a86c58..34412c5 100644
--- a/META.yml
+++ b/META.yml
@@ -1,22 +1,23 @@
---- #YAML:1.0
-name: Package-New
-version: 0.07
-abstract: Simple base package from which to inherit
+---
+abstract: 'Simple base package from which to inherit'
author:
- - Michael R. Davis (mdavis@stopllc.com)
-license: unknown
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
+ - 'Michael R. Davis (mdavis@stopllc.com)'
build_requires:
- ExtUtils::MakeMaker: 0
-requires:
- Test::Simple: 0.44
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.57_05
+ ExtUtils::MakeMaker: 0
+configure_requires:
+ ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.120351'
+license: unknown
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Package-New
+no_index:
+ directory:
+ - t
+ - inc
+requires:
+ Devel::Hide: 0
+ Test::Simple: 0.44
+version: 0.08
diff --git a/Makefile.PL b/Makefile.PL
index 44aca37..a3fa73c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,5 +6,6 @@ WriteMakefile(
ABSTRACT_FROM=> 'lib/Package/New.pm',
PREREQ_PM => {
'Test::Simple' => 0.44,
+ 'Devel::Hide' => 0,
},
);
diff --git a/lib/Package/New.pm b/lib/Package/New.pm
index eb6d6e3..c98948d 100644
--- a/lib/Package/New.pm
+++ b/lib/Package/New.pm
@@ -2,7 +2,7 @@ package Package::New;
use strict;
use warnings;
-our $VERSION='0.07';
+our $VERSION='0.08';
=head1 NAME
@@ -113,11 +113,11 @@ L<base>, L<parent>
=head2 Other Light Weight Base Objects Similar to Package::New
-L<Package::Base>, L<Class::Base>, L<Class::Easy>, L<Object::Tiny>
+L<Package::Base>, L<Class::Base>, L<Class::Easy>, L<Object::Tiny>, L<Badger::Base>
=head2 Heavy Base Objects - Drink the Kool-Aid
-L<Moose>, (as well as Moose-alikes L<Moo>, L<Mouse>), L<Class::Accessor>, L<Class::Accessor::Fast>, L<Class::MethodMaker>, L<Class::Meta>
+L<VSO>, L<Class::Accessor::Fast>, L<Class::Accessor>, L<Moose>, (as well as Moose-alikes L<Moo>, L<Mouse>), L<Class::MethodMaker>, L<Class::Meta>
=head2 Even more
diff --git a/lib/Package/New/Dump.pm b/lib/Package/New/Dump.pm
index 38882c6..33cf00a 100644
--- a/lib/Package/New/Dump.pm
+++ b/lib/Package/New/Dump.pm
@@ -3,7 +3,7 @@ use base qw{Package::New};
use strict;
use warnings;
-our $VERSION='0.06';
+our $VERSION='0.08';
=head1 NAME
@@ -39,13 +39,16 @@ Returns the object serialized by L<Data::Dumper>
=cut
sub dump {
- my $self=shift();
+ my $self = shift;
+ my $depth = shift;
+ $depth = 2 unless defined $depth;
+ local $@;
eval 'use Data::Dumper qw{}';
- if ($@) {
+ my $error = $@;
+ if ($error) {
return wantarray ? () : '';
} else {
- my $depth=shift; $depth=2 unless defined $depth;
- my $d=Data::Dumper->new([$self]);
+ my $d = Data::Dumper->new([$self]);
$d->Maxdepth($depth);
return $d->Dump;
}
diff --git a/perl-Package-New.spec b/perl-Package-New.spec
index 2b63484..232a9e4 100644
--- a/perl-Package-New.spec
+++ b/perl-Package-New.spec
@@ -1,14 +1,15 @@
Name: perl-Package-New
-Version: 0.07
+Version: 0.08
Release: 1%{?dist}
Summary: Simple base package from which to inherit
License: BSD
Group: Development/Libraries
URL: http://search.cpan.org/dist/Package-New/
-Source0: http://www.cpan.org/modules/by-module/Package/Package-New-%{version}.tar.gz
+Source0: http://search.cpan.org/CPAN/authors/id/M/MR/MRDVT/Package-New-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: perl(ExtUtils::MakeMaker)
+BuildRequires: perl(Devel::Hide)
BuildRequires: perl(Test::Simple) >= 0.44
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
@@ -46,6 +47,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/*
%changelog
+*Thu Dec 03 2011 Michael R. Davis (mdavis@stopllc.com) 0.07-2
+-CPAN did not symlink the package into the by_module tree.
+
*Thu Dec 02 2011 Michael R. Davis (mdavis@stopllc.com) 0.07-1
-Updated for version 0.07
diff --git a/t/001_load.t b/t/001_load.t
index 98cf44b..b9535f2 100644
--- a/t/001_load.t
+++ b/t/001_load.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 11;
+use Test::More tests => 13;
BEGIN { use_ok( 'Package::New' ); }
BEGIN { use_ok( 'Package::New::Dump' ); }
@@ -10,13 +10,16 @@ BEGIN { use_ok( 'Package::New::Dump' ); }
my $obj1 = Package::New->new(x=>1, y=>"a");
isa_ok ($obj1, 'Package::New');
+isa_ok($obj1->new, 'Package::New');
+
can_ok($obj1, qw{new initialize});
is($obj1->{"x"}, "1", "args work");
is($obj1->{"y"}, "a", "args work");
my $obj2 = Package::New::Dump->new(x=>2, y=>"b");
-isa_ok ($obj2, 'Package::New::Dump');
-isa_ok ($obj2, 'Package::New');
+isa_ok($obj2, 'Package::New::Dump');
+isa_ok($obj2, 'Package::New');
+isa_ok($obj2->new, 'Package::New::Dump');
can_ok($obj2, qw{new initialize dump});
is($obj2->{"x"}, "2", "args work");
diff --git a/t/004_dump.t b/t/004_dump.t
new file mode 100644
index 0000000..9d7963b
--- /dev/null
+++ b/t/004_dump.t
@@ -0,0 +1,18 @@
+# -*- perl -*-
+
+use strict;
+use warnings;
+use Test::More tests => 5;
+use Devel::Hide qw(Data::Dumper);
+
+BEGIN { use_ok( 'Package::New::Dump' ); }
+
+my $object = Package::New::Dump->new(one=>{two=>{three=>{four=>{}}}});
+isa_ok($object, 'Package::New::Dump');
+isa_ok($object, 'Package::New');
+
+my $value = $object->dump;
+is($value, '', 'dump empty string');
+
+my @value = $object->dump;
+is(scalar(@value), 0, 'dump empty array');