summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2020-01-24 14:45:12 +0100
committergregor herrmann <gregoa@debian.org>2020-01-24 14:45:12 +0100
commit7bcf4a2e608bb08d285bed633cdb3d2d4a26f603 (patch)
tree4059da970cab0928c8b1e2ab6f57d529e4a047a1
parent2e3852a533b81e26978e3f6eb2a037eb53b46c59 (diff)
New upstream version 0.002011
-rw-r--r--Changes8
-rw-r--r--LICENSE8
-rw-r--r--MANIFEST8
-rw-r--r--META.json25
-rw-r--r--META.yml44
-rw-r--r--Makefile.PL15
-rw-r--r--README122
-rw-r--r--README.mkdn50
-rw-r--r--dist.ini10
-rw-r--r--lib/Data/Perl.pm38
-rw-r--r--lib/Data/Perl/Bool.pm6
-rw-r--r--lib/Data/Perl/Code.pm6
-rw-r--r--lib/Data/Perl/Collection/Array.pm6
-rw-r--r--lib/Data/Perl/Collection/Hash.pm6
-rw-r--r--lib/Data/Perl/Counter.pm6
-rw-r--r--lib/Data/Perl/Number.pm6
-rw-r--r--lib/Data/Perl/Role/Bool.pm6
-rw-r--r--lib/Data/Perl/Role/Code.pm6
-rw-r--r--lib/Data/Perl/Role/Collection/Array.pm43
-rw-r--r--lib/Data/Perl/Role/Collection/Hash.pm6
-rw-r--r--lib/Data/Perl/Role/Counter.pm6
-rw-r--r--lib/Data/Perl/Role/Number.pm6
-rw-r--r--lib/Data/Perl/Role/String.pm6
-rw-r--r--lib/Data/Perl/String.pm6
-rw-r--r--t/author-pod-coverage.t (renamed from t/release-pod-coverage.t)6
-rw-r--r--t/author-pod-syntax.t (renamed from t/release-pod-syntax.t)7
-rw-r--r--t/collection/array.t15
-rw-r--r--weaver.ini30
28 files changed, 268 insertions, 239 deletions
diff --git a/Changes b/Changes
index abdeee0..27aa792 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,11 @@
+0.002011 2020-01-22 13:33:30+00:00 Europe/London
+ - pod cleanups
+ - update Changes file which was missed out in last release
+
+0.002010 2020-01-22 13:28:03+00:00 Europe/London
+ - adds head and tail methods for Array
+ - @tobyink is now maintainer
+
0.002009 2014-06-26 21:04:12EDT-0400 America/Toronto
- fixes pod test failures. thanks gregor herrmann / Debian perl team!
diff --git a/LICENSE b/LICENSE
index a4a5cf1..941a952 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
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) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is Copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
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) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is Copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software, licensed under:
diff --git a/MANIFEST b/MANIFEST
index 6dcd33f..1e9c1a3 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,11 +1,10 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.019.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012.
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
-README
README.mkdn
dist.ini
lib/Data/Perl.pm
@@ -23,6 +22,8 @@ lib/Data/Perl/Role/Counter.pm
lib/Data/Perl/Role/Number.pm
lib/Data/Perl/Role/String.pm
lib/Data/Perl/String.pm
+t/author-pod-coverage.t
+t/author-pod-syntax.t
t/bool.t
t/code.t
t/collection/array.t
@@ -31,6 +32,5 @@ t/collection/subclassing.t
t/counter.t
t/helpers.t
t/number.t
-t/release-pod-coverage.t
-t/release-pod-syntax.t
t/string.t
+weaver.ini
diff --git a/META.json b/META.json
index d8bf3fb..c2325be 100644
--- a/META.json
+++ b/META.json
@@ -4,19 +4,19 @@
"Matthew Phillips <mattp@cpan.org>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.141520",
+ "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
+ "version" : 2
},
"name" : "Data-Perl",
"prereqs" : {
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "6.30"
+ "ExtUtils::MakeMaker" : "0"
}
},
"develop" : {
@@ -49,15 +49,24 @@
"release_status" : "stable",
"resources" : {
"bugtracker" : {
- "web" : "https://github.com/mattp-/Data-Perl/issues"
+ "web" : "https://github.com/tobyink/Data-Perl/issues"
},
- "homepage" : "https://github.com/mattp-/Data-Perl",
+ "homepage" : "https://github.com/tobyink/Data-Perl",
"repository" : {
"type" : "git",
- "url" : "https://github.com/mattp-/Data-Perl.git",
- "web" : "https://github.com/mattp-/Data-Perl"
+ "url" : "https://github.com/tobyink/Data-Perl.git",
+ "web" : "https://github.com/tobyink/Data-Perl"
}
},
- "version" : "0.002009"
+ "version" : "0.002011",
+ "x_contributors" : [
+ "Graham Knop <haarg@haarg.org>",
+ "Jon Portnoy <avenj@cobaltirc.org>",
+ "kristof.pap@gmail.com <kristof.pap@gmail.com>",
+ "Matt Phillips <mattp@cpan.org>",
+ "Toby Inkster <tobyink@cpan.org>"
+ ],
+ "x_generated_by_perl" : "v5.26.2",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.02"
}
diff --git a/META.yml b/META.yml
index d06422b..9ee170b 100644
--- a/META.yml
+++ b/META.yml
@@ -3,29 +3,37 @@ abstract: 'Base classes wrapping fundamental Perl data types.'
author:
- 'Matthew Phillips <mattp@cpan.org>'
build_requires:
- Test::Deep: 0
- Test::Fatal: 0
- Test::Output: 0
+ Test::Deep: '0'
+ Test::Fatal: '0'
+ Test::Output: '0'
configure_requires:
- ExtUtils::MakeMaker: 6.30
+ ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.141520'
+generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: Data-Perl
requires:
- Class::Method::Modifiers: 0
- List::MoreUtils: 0
- List::Util: 0
- Module::Runtime: 0
- Role::Tiny: 0
- Scalar::Util: 0
- parent: 0
- strictures: 0
+ Class::Method::Modifiers: '0'
+ List::MoreUtils: '0'
+ List::Util: '0'
+ Module::Runtime: '0'
+ Role::Tiny: '0'
+ Scalar::Util: '0'
+ parent: '0'
+ strictures: '0'
resources:
- bugtracker: https://github.com/mattp-/Data-Perl/issues
- homepage: https://github.com/mattp-/Data-Perl
- repository: https://github.com/mattp-/Data-Perl.git
-version: 0.002009
+ bugtracker: https://github.com/tobyink/Data-Perl/issues
+ homepage: https://github.com/tobyink/Data-Perl
+ repository: https://github.com/tobyink/Data-Perl.git
+version: '0.002011'
+x_contributors:
+ - 'Graham Knop <haarg@haarg.org>'
+ - 'Jon Portnoy <avenj@cobaltirc.org>'
+ - 'kristof.pap@gmail.com <kristof.pap@gmail.com>'
+ - 'Matt Phillips <mattp@cpan.org>'
+ - 'Toby Inkster <tobyink@cpan.org>'
+x_generated_by_perl: v5.26.2
+x_serialization_backend: 'YAML::Tiny version 1.73'
diff --git a/Makefile.PL b/Makefile.PL
index 9621c30..bab7ea1 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,22 +1,18 @@
-
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.019.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012.
use strict;
use warnings;
-use ExtUtils::MakeMaker 6.30;
-
-
+use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "Base classes wrapping fundamental Perl data types.",
"AUTHOR" => "Matthew Phillips <mattp\@cpan.org>",
"CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.30"
+ "ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "Data-Perl",
- "EXE_FILES" => [],
"LICENSE" => "perl",
"NAME" => "Data::Perl",
"PREREQ_PM" => {
@@ -34,7 +30,7 @@ my %WriteMakefileArgs = (
"Test::Fatal" => 0,
"Test::Output" => 0
},
- "VERSION" => "0.002009",
+ "VERSION" => "0.002011",
"test" => {
"TESTS" => "t/*.t t/collection/*.t"
}
@@ -66,6 +62,3 @@ delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
-
-
-
diff --git a/README b/README
deleted file mode 100644
index 86ad5c0..0000000
--- a/README
+++ /dev/null
@@ -1,122 +0,0 @@
-NAME
- Data::Perl - Base classes wrapping fundamental Perl data types.
-
-VERSION
- version 0.002009
-
-SYNOPSIS
- use Data::Perl;
-
- my $array = array(1,2,3, qw/a b c/);
-
- $array->count; # 6
-
- my @elements = $array->grep(sub {/b/}); # (b)
-
- my $hash = hash(a => 1, b => 2);
-
- $hash->keys; # ('a', 'b');
-
- my $number = number(5);
-
- $number->add(10); # 15
-
- my $string = string("foo\n");
-
- $string->chomp; # return 1, chomps string
-
- my $counter = counter();
-
- $counter->inc; # counter is now 1
-
- my $sub = code(sub { 'foo' });
-
- $sub->execute; # returns 'foo'
-
- $foo
-
-DESCRIPTION
- Data::Perl is a collection of classes that wrap fundamental data types
- that exist in Perl. These classes and methods as they exist today are an
- attempt to mirror functionality provided by Moose's Native Traits. One
- important thing to note is all classes currently do no validation on
- constructor input.
-
- Data::Perl is a container class for the following classes:
-
- * Data::Perl::Collection::Hash
-
- * Data::Perl::Collection::Array
-
- * Data::Perl::String
-
- * Data::Perl::Number
-
- * Data::Perl::Counter
-
- * Data::Perl::Bool
-
- * Data::Perl::Code
-
-ALPHA API
- The API provided by these modules is as of now considered alpha and
- undecided. The API WILL change. If you are writing code that you will
- not touch again for years, do not use this until this warning is
- removed.
-
-PROVIDED FUNCTIONS
- Data::Perl exports helper constructor functions to interface with the
- above classes:
-
- * hash(key, value, ...)
-
- Returns a Data::Perl::Collection::Hash object initialized with the
- optionally passed in key/value args.
-
- * array(@args)
-
- Returns a Data::Perl::Collection::Array object initialized with the
- optionally passed in values.
-
- * string($arg)
-
- Returns a Data::Perl::String object initialized with the optionally
- passed in scalar arg.
-
- * number($arg)
-
- Returns a Data::Perl::Number object initialized with the optionally
- passed in scalar arg.
-
- * counter($arg)
-
- Returns a Data::Perl::Counter object initialized with the optionally
- passed in scalar arg.
-
- * bool($arg)
-
- Returns a Data::Perl::Bool object initialized with the truth value
- of the passed in scalar arg.
-
- * code($arg)
-
- Returns a Data::Perl::Code object initialized with the optionally
- passed in scalar coderef as an arg.
-
-THANKS
- Much thanks to the Moose team for their work with native traits, for
- which much of this work is based.
-
-SEE ALSO
- * MooX::HandlesVia
-
-AUTHOR
- Matthew Phillips <mattp@cpan.org>
-
-COPYRIGHT AND LICENSE
- This software is copyright (c) 2014 by Matthew Phillips
- <mattp@cpan.org>.
-
- This is free software; you can redistribute it and/or modify it under
- the same terms as the Perl 5 programming language system itself.
-
diff --git a/README.mkdn b/README.mkdn
index eb090b8..1ad6a9f 100644
--- a/README.mkdn
+++ b/README.mkdn
@@ -4,7 +4,7 @@ Data::Perl - Base classes wrapping fundamental Perl data types.
# VERSION
-version 0.002009
+version 0.002011
# SYNOPSIS
@@ -47,68 +47,80 @@ note is all classes currently do no validation on constructor input.
Data::Perl is a container class for the following classes:
-- [Data::Perl::Collection::Hash](http://search.cpan.org/perldoc?Data::Perl::Collection::Hash)
-- [Data::Perl::Collection::Array](http://search.cpan.org/perldoc?Data::Perl::Collection::Array)
-- [Data::Perl::String](http://search.cpan.org/perldoc?Data::Perl::String)
-- [Data::Perl::Number](http://search.cpan.org/perldoc?Data::Perl::Number)
-- [Data::Perl::Counter](http://search.cpan.org/perldoc?Data::Perl::Counter)
-- [Data::Perl::Bool](http://search.cpan.org/perldoc?Data::Perl::Bool)
-- [Data::Perl::Code](http://search.cpan.org/perldoc?Data::Perl::Code)
+- [Data::Perl::Collection::Hash](https://metacpan.org/pod/Data::Perl::Collection::Hash)
+- [Data::Perl::Collection::Array](https://metacpan.org/pod/Data::Perl::Collection::Array)
+- [Data::Perl::String](https://metacpan.org/pod/Data::Perl::String)
+- [Data::Perl::Number](https://metacpan.org/pod/Data::Perl::Number)
+- [Data::Perl::Counter](https://metacpan.org/pod/Data::Perl::Counter)
+- [Data::Perl::Bool](https://metacpan.org/pod/Data::Perl::Bool)
+- [Data::Perl::Code](https://metacpan.org/pod/Data::Perl::Code)
# ALPHA API
The API provided by these modules is as of now considered alpha and undecided.
-The API __WILL__ change. If you are writing code that you will not touch again
+The API **WILL** change. If you are writing code that you will not touch again
for years, do not use this until this warning is removed.
# PROVIDED FUNCTIONS
Data::Perl exports helper constructor functions to interface with the above classes:
-- __hash(key, value, ...)__
+- **hash(key, value, ...)**
Returns a Data::Perl::Collection::Hash object initialized with the optionally passed in key/value args.
-- __array(@args)__
+- **array(@args)**
Returns a Data::Perl::Collection::Array object initialized with the optionally passed in values.
-- __string($arg)__
+- **string($arg)**
Returns a Data::Perl::String object initialized with the optionally passed in scalar arg.
-- __number($arg)__
+- **number($arg)**
Returns a Data::Perl::Number object initialized with the optionally passed in scalar arg.
-- __counter($arg)__
+- **counter($arg)**
Returns a Data::Perl::Counter object initialized with the optionally passed in scalar arg.
-- __bool($arg)__
+- **bool($arg)**
Returns a Data::Perl::Bool object initialized with the truth value of the passed in scalar arg.
-- __code($arg)__
+- **code($arg)**
Returns a Data::Perl::Code object initialized with the optionally passed in scalar coderef as an arg.
# THANKS
-Much thanks to the [Moose](http://search.cpan.org/perldoc?Moose) team for their work with native traits, for which
+Much thanks to the [Moose](https://metacpan.org/pod/Moose) team for their work with native traits, for which
much of this work is based.
# SEE ALSO
-- [MooX::HandlesVia](http://search.cpan.org/perldoc?MooX::HandlesVia)
+- [MooX::HandlesVia](https://metacpan.org/pod/MooX::HandlesVia)
# AUTHOR
Matthew Phillips <mattp@cpan.org>
+# MAINTAINER
+
+Toby Inkster <tobyink@cpan.org> since version 0.002010.
+
+# CONTRIBUTORS
+
+- Graham Knop <haarg@haarg.org>
+- Jon Portnoy <avenj@cobaltirc.org>
+- kristof.pap@gmail.com <kristof.pap@gmail.com>
+- Matt Phillips <mattp@cpan.org>
+- Toby Inkster <tobyink@cpan.org>
+
# COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/dist.ini b/dist.ini
index 1385e7e..6e12067 100644
--- a/dist.ini
+++ b/dist.ini
@@ -2,10 +2,14 @@ name = Data-Perl
author = Matthew Phillips <mattp@cpan.org>
license = Perl_5
copyright_holder = Matthew Phillips <mattp@cpan.org>
-version = 0.002009
+version = 0.002011
[@Basic]
+[Git::Contributors]
+include_authors=1
+include_releaser=1
+
[MetaJSON]
[NextRelease]
[@Git]
@@ -15,8 +19,10 @@ allow_dirty = README.mkdn
add_files_in = Changes
add_files_in = dist.ini
add_files_in = README.mkdn
-[PodWeaver]
+[PodWeaver]
+[%PodWeaver]
+Contributors.head = 1
[GithubMeta]
issues = 1
diff --git a/lib/Data/Perl.pm b/lib/Data/Perl.pm
index bddb868..91246ed 100644
--- a/lib/Data/Perl.pm
+++ b/lib/Data/Perl.pm
@@ -1,5 +1,5 @@
package Data::Perl;
-$Data::Perl::VERSION = '0.002009';
+$Data::Perl::VERSION = '0.002011';
# ABSTRACT: Base classes wrapping fundamental Perl data types.
BEGIN {
@@ -44,7 +44,7 @@ Data::Perl - Base classes wrapping fundamental Perl data types.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -164,9 +164,41 @@ much of this work is based.
Matthew Phillips <mattp@cpan.org>
+=head1 MAINTAINER
+
+Toby Inkster <tobyink@cpan.org> since version 0.002010.
+
+=head1 CONTRIBUTORS
+
+=for stopwords Graham Knop Jon Portnoy kristof.pap@gmail.com Matt Phillips Toby Inkster
+
+=over 4
+
+=item *
+
+Graham Knop <haarg@haarg.org>
+
+=item *
+
+Jon Portnoy <avenj@cobaltirc.org>
+
+=item *
+
+kristof.pap@gmail.com <kristof.pap@gmail.com>
+
+=item *
+
+Matt Phillips <mattp@cpan.org>
+
+=item *
+
+Toby Inkster <tobyink@cpan.org>
+
+=back
+
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Bool.pm b/lib/Data/Perl/Bool.pm
index 169b333..fba2e3b 100644
--- a/lib/Data/Perl/Bool.pm
+++ b/lib/Data/Perl/Bool.pm
@@ -1,5 +1,5 @@
package Data::Perl::Bool;
-$Data::Perl::Bool::VERSION = '0.002009';
+$Data::Perl::Bool::VERSION = '0.002011';
# ABSTRACT: Wrapping class for boolean values.
use strictures 1;
@@ -20,7 +20,7 @@ Data::Perl::Bool - Wrapping class for boolean values.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -43,7 +43,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Code.pm b/lib/Data/Perl/Code.pm
index 2b73e7c..e9b8595 100644
--- a/lib/Data/Perl/Code.pm
+++ b/lib/Data/Perl/Code.pm
@@ -1,5 +1,5 @@
package Data::Perl::Code;
-$Data::Perl::Code::VERSION = '0.002009';
+$Data::Perl::Code::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl coderefs.
use strictures 1;
@@ -20,7 +20,7 @@ Data::Perl::Code - Wrapping class for Perl coderefs.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -41,7 +41,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Collection/Array.pm b/lib/Data/Perl/Collection/Array.pm
index 47daf36..1b38d5b 100644
--- a/lib/Data/Perl/Collection/Array.pm
+++ b/lib/Data/Perl/Collection/Array.pm
@@ -1,5 +1,5 @@
package Data::Perl::Collection::Array;
-$Data::Perl::Collection::Array::VERSION = '0.002009';
+$Data::Perl::Collection::Array::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl's built in array structure.
use strictures 1;
@@ -20,7 +20,7 @@ Data::Perl::Collection::Array - Wrapping class for Perl's built in array structu
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -44,7 +44,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Collection/Hash.pm b/lib/Data/Perl/Collection/Hash.pm
index 513325e..cbbbce7 100644
--- a/lib/Data/Perl/Collection/Hash.pm
+++ b/lib/Data/Perl/Collection/Hash.pm
@@ -1,5 +1,5 @@
package Data::Perl::Collection::Hash;
-$Data::Perl::Collection::Hash::VERSION = '0.002009';
+$Data::Perl::Collection::Hash::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl's built in hash structure.
use strictures 1;
@@ -20,7 +20,7 @@ Data::Perl::Collection::Hash - Wrapping class for Perl's built in hash structure
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -46,7 +46,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Counter.pm b/lib/Data/Perl/Counter.pm
index 9037507..118a228 100644
--- a/lib/Data/Perl/Counter.pm
+++ b/lib/Data/Perl/Counter.pm
@@ -1,5 +1,5 @@
package Data::Perl::Counter;
-$Data::Perl::Counter::VERSION = '0.002009';
+$Data::Perl::Counter::VERSION = '0.002011';
# ABSTRACT: Wrapping class for a simple numeric counter.
use strictures 1;
@@ -20,7 +20,7 @@ Data::Perl::Counter - Wrapping class for a simple numeric counter.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -43,7 +43,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Number.pm b/lib/Data/Perl/Number.pm
index 6747b51..3855290 100644
--- a/lib/Data/Perl/Number.pm
+++ b/lib/Data/Perl/Number.pm
@@ -1,5 +1,5 @@
package Data::Perl::Number;
-$Data::Perl::Number::VERSION = '0.002009';
+$Data::Perl::Number::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl scalar numbers.
use strictures 1;
@@ -20,7 +20,7 @@ Data::Perl::Number - Wrapping class for Perl scalar numbers.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -43,7 +43,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Role/Bool.pm b/lib/Data/Perl/Role/Bool.pm
index 6606b20..c489997 100644
--- a/lib/Data/Perl/Role/Bool.pm
+++ b/lib/Data/Perl/Role/Bool.pm
@@ -1,5 +1,5 @@
package Data::Perl::Role::Bool;
-$Data::Perl::Role::Bool::VERSION = '0.002009';
+$Data::Perl::Role::Bool::VERSION = '0.002011';
# ABSTRACT: Wrapping class for boolean values.
use strictures 1;
@@ -28,7 +28,7 @@ Data::Perl::Role::Bool - Wrapping class for boolean values.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -91,7 +91,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Role/Code.pm b/lib/Data/Perl/Role/Code.pm
index 6e9d203..deef377 100644
--- a/lib/Data/Perl/Role/Code.pm
+++ b/lib/Data/Perl/Role/Code.pm
@@ -1,5 +1,5 @@
package Data::Perl::Role::Code;
-$Data::Perl::Role::Code::VERSION = '0.002009';
+$Data::Perl::Role::Code::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl coderefs.
use strictures 1;
@@ -25,7 +25,7 @@ Data::Perl::Role::Code - Wrapping class for Perl coderefs.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -76,7 +76,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Role/Collection/Array.pm b/lib/Data/Perl/Role/Collection/Array.pm
index fe1dee4..cb97e79 100644
--- a/lib/Data/Perl/Role/Collection/Array.pm
+++ b/lib/Data/Perl/Role/Collection/Array.pm
@@ -1,5 +1,5 @@
package Data::Perl::Role::Collection::Array;
-$Data::Perl::Role::Collection::Array::VERSION = '0.002009';
+$Data::Perl::Role::Collection::Array::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl's built in array structure.
use strictures 1;
@@ -186,6 +186,29 @@ sub print {
print { $fh || *STDOUT } CORE::join((defined $arg ? $arg : ','), @$self);
}
+sub head {
+ my ($self, $count) = @_;
+
+ $count = $self->count if $count > $self->count;
+ $count = $self->count - -$count if $count < 0;
+
+ my @res = ($self->elements)[0 .. $count - 1];
+
+ blessed($self) ? blessed($self)->new(@res) : @res;
+}
+
+sub tail {
+ my ($self, $count) = @_;
+
+ $count = $self->count if $count > $self->count;
+ $count = $self->count - -$count if $count < 0;
+ my $start = $self->count - $count;
+
+ my @res = ($self->elements)[$start .. $self->count - 1];
+
+ blessed($self) ? blessed($self)->new(@res) : @res;
+}
+
1;
=pod
@@ -198,7 +221,7 @@ Data::Perl::Role::Collection::Array - Wrapping class for Perl's built in array s
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -409,6 +432,20 @@ L<List::MoreUtils>. The returned list is provided as a Collection::Array object.
This method does not accept any arguments.
+=item B<head($count)>
+
+Returns the first C<$count> elements of the array. If C<$count> is greater
+than the number of elements in the array, the array (without spurious C<undef>s)
+is returned. Negative C<$count> means "all but the last C<$count> elements". The
+returned list is provided as a Collection::Array object.
+
+=item B<tail($count)>
+
+Returns the last C<$count> elements of the array. If C<$count> is greater
+than the number of elements in the array, the array (without spurious C<undef>s)
+is returned. Negative C<$count> means "all but the first C<$count> elements". The
+returned list is provided as a Collection::Array object.
+
=item B<join($str)>
Joins every element of the array using the separator given as argument, just
@@ -521,7 +558,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Role/Collection/Hash.pm b/lib/Data/Perl/Role/Collection/Hash.pm
index 967a997..e8d0260 100644
--- a/lib/Data/Perl/Role/Collection/Hash.pm
+++ b/lib/Data/Perl/Role/Collection/Hash.pm
@@ -1,5 +1,5 @@
package Data::Perl::Role::Collection::Hash;
-$Data::Perl::Role::Collection::Hash::VERSION = '0.002009';
+$Data::Perl::Role::Collection::Hash::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl's built in hash structure.
use strictures 1;
@@ -116,7 +116,7 @@ Data::Perl::Role::Collection::Hash - Wrapping class for Perl's built in hash str
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -266,7 +266,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Role/Counter.pm b/lib/Data/Perl/Role/Counter.pm
index dbbdd46..b36622f 100644
--- a/lib/Data/Perl/Role/Counter.pm
+++ b/lib/Data/Perl/Role/Counter.pm
@@ -1,5 +1,5 @@
package Data::Perl::Role::Counter;
-$Data::Perl::Role::Counter::VERSION = '0.002009';
+$Data::Perl::Role::Counter::VERSION = '0.002011';
# ABSTRACT: Wrapping class for a simple numeric counter.
use strictures 1;
@@ -26,7 +26,7 @@ Data::Perl::Role::Counter - Wrapping class for a simple numeric counter.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -98,7 +98,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Role/Number.pm b/lib/Data/Perl/Role/Number.pm
index 66e670c..c828413 100644
--- a/lib/Data/Perl/Role/Number.pm
+++ b/lib/Data/Perl/Role/Number.pm
@@ -1,5 +1,5 @@
package Data::Perl::Role::Number;
-$Data::Perl::Role::Number::VERSION = '0.002009';
+$Data::Perl::Role::Number::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl scalar numbers.
use strictures 1;
@@ -32,7 +32,7 @@ Data::Perl::Role::Number - Wrapping class for Perl scalar numbers.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -102,7 +102,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/Role/String.pm b/lib/Data/Perl/Role/String.pm
index 64e4790..b34b828 100644
--- a/lib/Data/Perl/Role/String.pm
+++ b/lib/Data/Perl/Role/String.pm
@@ -1,5 +1,5 @@
package Data::Perl::Role::String;
-$Data::Perl::Role::String::VERSION = '0.002009';
+$Data::Perl::Role::String::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl scalar strings.
use strictures 1;
@@ -60,7 +60,7 @@ Data::Perl::Role::String - Wrapping class for Perl scalar strings.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -168,7 +168,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/lib/Data/Perl/String.pm b/lib/Data/Perl/String.pm
index 8cd3713..37584d8 100644
--- a/lib/Data/Perl/String.pm
+++ b/lib/Data/Perl/String.pm
@@ -1,5 +1,5 @@
package Data::Perl::String;
-$Data::Perl::String::VERSION = '0.002009';
+$Data::Perl::String::VERSION = '0.002011';
# ABSTRACT: Wrapping class for Perl scalar strings.
use strictures 1;
@@ -20,7 +20,7 @@ Data::Perl::String - Wrapping class for Perl scalar strings.
=head1 VERSION
-version 0.002009
+version 0.002011
=head1 SYNOPSIS
@@ -41,7 +41,7 @@ Matthew Phillips <mattp@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2014 by Matthew Phillips <mattp@cpan.org>.
+This software is copyright (c) 2020 by Matthew Phillips <mattp@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
diff --git a/t/release-pod-coverage.t b/t/author-pod-coverage.t
index 18a8274..243340f 100644
--- a/t/release-pod-coverage.t
+++ b/t/author-pod-coverage.t
@@ -1,9 +1,9 @@
#!perl
BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ unless ($ENV{AUTHOR_TESTING}) {
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
}
}
diff --git a/t/release-pod-syntax.t b/t/author-pod-syntax.t
index cdd6a6c..2233af0 100644
--- a/t/release-pod-syntax.t
+++ b/t/author-pod-syntax.t
@@ -1,13 +1,14 @@
#!perl
BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
+ unless ($ENV{AUTHOR_TESTING}) {
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
}
}
# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
+use strict; use warnings;
use Test::More;
use Test::Pod 1.41;
diff --git a/t/collection/array.t b/t/collection/array.t
index b6dc116..cd943f1 100644
--- a/t/collection/array.t
+++ b/t/collection/array.t
@@ -251,4 +251,19 @@ is $collection->pluck('reverse'), "3\n2\n1\n6\n5\n4\n9\n8\n7", 'right result';
is $collection->pluck(join => '-'), "1-2-3\n4-5-6\n7-8-9", 'right result';
=cut
+# head
+$collection = array(qw{a b c d e f});
+is_deeply [$collection->head(0)->all], [], 'right result';
+is_deeply [$collection->head(3)->all], [qw{a b c}], 'right result';
+is_deeply [$collection->head(30)->all], [qw{a b c d e f}], 'right result';
+is_deeply [$collection->head(-2)->all], [qw{a b c d}], 'right result';
+is_deeply [$collection->head(-30)->all], [], 'right result';
+
+# tail
+is_deeply [$collection->tail(0)->all], [], 'right result';
+is_deeply [$collection->tail(3)->all], [qw{d e f}], 'right result';
+is_deeply [$collection->tail(30)->all], [qw{a b c d e f}], 'right result';
+is_deeply [$collection->tail(-2)->all], [qw{c d e f}], 'right result';
+is_deeply [$collection->tail(-30)->all], [], 'right result';
+
done_testing();
diff --git a/weaver.ini b/weaver.ini
new file mode 100644
index 0000000..27f9017
--- /dev/null
+++ b/weaver.ini
@@ -0,0 +1,30 @@
+[@CorePrep]
+
+[-SingleEncoding]
+
+[Name]
+[Version]
+
+[Region / prelude]
+
+[Generic / SYNOPSIS]
+[Generic / DESCRIPTION]
+[Generic / OVERVIEW]
+
+[Collect / ATTRIBUTES]
+command = attr
+
+[Collect / METHODS]
+command = method
+
+[Collect / FUNCTIONS]
+command = func
+
+[Leftovers]
+
+[Region / postlude]
+
+[Authors]
+[Generic / MAINTAINER]
+[Contributors]
+[Legal]