diff options
-rw-r--r-- | Changes | 25 | ||||
-rw-r--r-- | MANIFEST.SKIP | 5 | ||||
-rw-r--r-- | Makefile.PL | 9 | ||||
-rw-r--r-- | README.md (renamed from README.markdown) | 8 | ||||
-rw-r--r-- | lib/List/Breakdown.pm | 21 | ||||
-rw-r--r-- | perlcriticrc | 7 | ||||
-rw-r--r-- | t/errors.t | 2 | ||||
-rw-r--r-- | t/intervals.t | 2 | ||||
-rw-r--r-- | t/monitoring.t | 2 | ||||
-rw-r--r-- | t/records.t | 2 | ||||
-rw-r--r-- | t/words.t | 2 |
11 files changed, 59 insertions, 26 deletions
@@ -6,6 +6,31 @@ documented here anyway for comprehensiveness' sake. Entries with "No important changes" are likely to be trivial things like documentation fixes or Perl::Tidy runs. +0.26 2021-07-01 + + - Correct Changes file from previous release + +0.25 2021-07-01 + + - Correct Changes file from previous release + +0.24 2021-07-01 + + - Update URLs in Makefile.PL + +0.23 2021-01-02 + + - Internal refactoring for code quality + +0.22 2018-05-30 + + - Adjust Exporter syntax + +0.21 2018-02-21 + + - Update repository metadata + - Begin signing distributions with Module::Signature + 0.20 2017-10-07 - Add LICENSE to MANIFEST diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index dd6fd82..ac675da 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -1,9 +1,10 @@ -^\.git ^List-Breakdown-.* ^MANIFEST\.SKIP$ ^MYMETA\. ^Makefile$ ^Makefile\.old$ -^README\.markdown +^README\.md +^\.git ^blib +^perlcriticrc$ ^pm_to_blib$ diff --git a/Makefile.PL b/Makefile.PL index 9e2ccf8..f863b1d 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -4,6 +4,7 @@ use warnings; use ExtUtils::MakeMaker; WriteMakefile( + (MM->can('signature_target') ? (SIGN => 1) : ()), NAME => 'List::Breakdown', AUTHOR => 'Tom Ryder <tom@sanctum.geek.nz>', VERSION_FROM => 'lib/List/Breakdown.pm', @@ -25,16 +26,16 @@ WriteMakefile( 'meta-spec' => { version => 2 }, provides => { 'List::Breakdown' => { - version => '0.20', + version => '0.26', file => 'lib/List/Breakdown.pm', }, }, resources => { - homepage => 'https://sanctum.geek.nz/cgit/List-Breakdown.git/', + homepage => 'https://dev.sanctum.geek.nz/cgit/List-Breakdown.git/', repository => { type => 'git', - url => 'https://sanctum.geek.nz/code/List-Breakdown.git/', - web => 'https://sanctum.geek.nz/cgit/List-Breakdown.git/', + url => 'https://dev.sanctum.geek.nz/code/List-Breakdown.git/', + web => 'https://dev.sanctum.geek.nz/cgit/List-Breakdown.git/', }, }, }, diff --git a/README.markdown b/README.md index 1e7441e..283729f 100644 --- a/README.markdown +++ b/README.md @@ -4,7 +4,7 @@ List::Breakdown - Build sublist structures matching conditions # VERSION -Version 0.20 +Version 0.26 # SYNOPSIS @@ -44,15 +44,15 @@ This module assists you in making a _breakdown_ of a list, copying and filtering its items into a structured bucket layout according to your specifications. Think of it as a syntax for [`grep`](https://metacpan.org/pod/perlfunc#grep-BLOCK-LIST) that returns named and structured results from one list. -It differs from the excellent [List::Categorize](https://metacpan.org/pod/List::Categorize) in the use +It differs from the excellent [List::Categorize](https://metacpan.org/pod/List%3A%3ACategorize) in the use of references to define each category, and in not requiring only one final category for any given item; an item can end up in the result set for more than one filter. If you want to divide or _partition_ your list so that each item can only appear in one category, you may want either -[List::MoreUtils](https://metacpan.org/pod/List::MoreUtils#Partitioning) or possibly -[Set::Partition](https://metacpan.org/pod/Set::Partition) instead. +[List::MoreUtils](https://metacpan.org/pod/List%3A%3AMoreUtils#Partitioning) or possibly +[Set::Partition](https://metacpan.org/pod/Set%3A%3APartition) instead. # SUBROUTINES/METHODS diff --git a/lib/List/Breakdown.pm b/lib/List/Breakdown.pm index 054128c..319485e 100644 --- a/lib/List/Breakdown.pm +++ b/lib/List/Breakdown.pm @@ -1,4 +1,3 @@ -## no critic (RequirePODUseEncodingUTF8) package List::Breakdown; # Force me to write this properly @@ -14,10 +13,10 @@ use Carp; # Handle exporting in a way Perl v5.6 should tolerate use base qw(Exporter); ## no critic (ProhibitUseBase) -our @EXPORT_OK = 'breakdown'; +our @EXPORT_OK = qw(breakdown); # Specify package version -our $VERSION = '0.20'; +our $VERSION = '0.26'; # Dispatch table of functions to handle different ref types for the spec # hashref's values @@ -25,16 +24,16 @@ my %types = ( # If it's a hash, apply breakdown() again as if it were another root-level # spec - HASH => sub { + ref {} => sub { my $spec = shift; return { breakdown( $spec, @_ ) }; }, # If it's an array, we're doing numeric bounds checking [a,b) - ARRAY => sub { + ref [] => sub { my $bounds = shift; @{$bounds} == 2 - or croak 'ARRAY ref for bounds needs two items'; + or croak 'arrayref for bounds needs two items'; return [ grep { ( not defined $bounds->[0] or $_ >= $bounds->[0] ) @@ -45,14 +44,14 @@ my %types = ( # If it's a subroutine, return a arrayref of all elements for which it # returns true - CODE => sub { + ref sub { } => sub { my $sub = shift; return [ grep { $sub->() } @_ ]; }, # If it's a regular expression, return an arrayref of all elements it # matches - Regexp => sub { + ref qr//msx => sub { my $re = shift; return [ grep { $_ =~ $re } @_ ]; }, @@ -64,8 +63,8 @@ sub breakdown { my ( $spec, @items ) = @_; # Check the spec is a hashref - ref $spec eq 'HASH' - or croak 'HASH ref expected for first argument'; + ref $spec eq ref {} + or croak 'hashref expected for first argument'; # Start building a results hash my %results; @@ -104,7 +103,7 @@ List::Breakdown - Build sublist structures matching conditions =head1 VERSION -Version 0.20 +Version 0.26 =head1 SYNOPSIS diff --git a/perlcriticrc b/perlcriticrc new file mode 100644 index 0000000..db52151 --- /dev/null +++ b/perlcriticrc @@ -0,0 +1,7 @@ +severity = brutal +[-Compatibility::PodMinimumVersion] +[-Documentation::RequirePODUseEncodingUTF8] +[-Editor::RequireEmacsFileVariables] +[-ErrorHandling::RequireUseOfExceptions] +[-ValuesAndExpressions::RequireConstantOnLeftSideOfEquality] +[-Variables::ProhibitLocalVars] @@ -8,7 +8,7 @@ use Test::More tests => 7; use List::Breakdown 'breakdown'; -our $VERSION = '0.20'; +our $VERSION = '0.26'; my @t = 1 .. 3; diff --git a/t/intervals.t b/t/intervals.t index 5979d88..8d8c131 100644 --- a/t/intervals.t +++ b/t/intervals.t @@ -8,7 +8,7 @@ use Test::More tests => 1; use List::Breakdown 'breakdown'; -our $VERSION = '0.20'; +our $VERSION = '0.26'; ## no critic (ProhibitMagicNumbers,ProhibitLeadingZeros) my @numbers = ( 1, 32, 3718.4, 0x56, 0777, 3.14, -5, 1.2e5 ); diff --git a/t/monitoring.t b/t/monitoring.t index a7cb2ea..df979c2 100644 --- a/t/monitoring.t +++ b/t/monitoring.t @@ -8,7 +8,7 @@ use Test::More tests => 1; use List::Breakdown 'breakdown'; -our $VERSION = '0.20'; +our $VERSION = '0.26'; my @checks = ( { diff --git a/t/records.t b/t/records.t index 6b2ed96..8f2e367 100644 --- a/t/records.t +++ b/t/records.t @@ -8,7 +8,7 @@ use Test::More tests => 1; use List::Breakdown 'breakdown'; -our $VERSION = '0.20'; +our $VERSION = '0.26'; my @records = ( "NEW CUSTOMER John O''Connor\r 2017-01-01", @@ -8,7 +8,7 @@ use Test::More tests => 1; use List::Breakdown 'breakdown'; -our $VERSION = '0.20'; +our $VERSION = '0.26'; my @words = qw(foo bar baz quux wibble florb); my $filters = { |