diff -Nru libautobox-transform-perl-1.034/Changes libautobox-transform-perl-1.035/Changes --- libautobox-transform-perl-1.034/Changes 2019-06-19 20:23:03.000000000 +0000 +++ libautobox-transform-perl-1.035/Changes 2020-07-27 15:00:30.000000000 +0000 @@ -1,5 +1,12 @@ # Revision history for Perl module autobox::Transform +1.035 2020-07-27T15:00:22Z + + * Fixed #7: removed dependency on "true", thanks TBSliver/Tom Bloor + * Fixed #6: improved pod, thanks manwar/Mohammad S Anwar + * POD polish + + 1.034 2019-06-19T20:22:58Z * Documentation improvements to go with new "reject", "reject_by", diff -Nru libautobox-transform-perl-1.034/cpanfile libautobox-transform-perl-1.035/cpanfile --- libautobox-transform-perl-1.034/cpanfile 2019-06-19 20:23:03.000000000 +0000 +++ libautobox-transform-perl-1.035/cpanfile 2020-07-27 15:00:31.000000000 +0000 @@ -2,7 +2,6 @@ requires 'autobox'; requires 'autobox::Core'; -requires 'true'; requires 'Carp'; requires 'parent'; requires 'Sort::Maker'; diff -Nru libautobox-transform-perl-1.034/debian/changelog libautobox-transform-perl-1.035/debian/changelog --- libautobox-transform-perl-1.034/debian/changelog 2020-06-13 01:20:45.000000000 +0000 +++ libautobox-transform-perl-1.035/debian/changelog 2020-07-30 16:47:42.000000000 +0000 @@ -1,3 +1,10 @@ +libautobox-transform-perl (1.035-1) unstable; urgency=medium + + * Import upstream version 1.035. + * Remove (build) dependency on libtrue-perl. + + -- gregor herrmann Thu, 30 Jul 2020 18:47:42 +0200 + libautobox-transform-perl (1.034-2) unstable; urgency=medium * Source-only no-change re-upload. diff -Nru libautobox-transform-perl-1.034/debian/control libautobox-transform-perl-1.035/debian/control --- libautobox-transform-perl-1.034/debian/control 2020-06-13 01:20:45.000000000 +0000 +++ libautobox-transform-perl-1.035/debian/control 2020-07-30 16:47:42.000000000 +0000 @@ -14,8 +14,7 @@ libsort-maker-perl , libtest-differences-perl , libtest-exception-perl , - libtest-simple-perl , - libtrue-perl + libtest-simple-perl Standards-Version: 4.5.0 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libautobox-transform-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libautobox-transform-perl.git @@ -29,8 +28,7 @@ libautobox-core-perl, libautobox-perl, liblist-moreutils-perl, - libsort-maker-perl, - libtrue-perl + libsort-maker-perl Description: set of autobox methods to transform arrays and hashes autobox provides the ability to call methods on native types, e.g. strings, arrays, and hashes as if they were objects. diff -Nru libautobox-transform-perl-1.034/lib/autobox/Transform.pm libautobox-transform-perl-1.035/lib/autobox/Transform.pm --- libautobox-transform-perl-1.034/lib/autobox/Transform.pm 2019-06-19 20:23:03.000000000 +0000 +++ libautobox-transform-perl-1.035/lib/autobox/Transform.pm 2020-07-27 15:00:31.000000000 +0000 @@ -5,7 +5,7 @@ use 5.010; use parent qw/autobox/; -our $VERSION = "1.034"; +our $VERSION = "1.035"; =head1 NAME @@ -76,17 +76,17 @@ @titles_books->to_hash; -=head2 Arrays with hashrefs/objects +=head2 Arrays where the items are hashrefs/objects # $books and $authors below are arrayrefs with either objects or # hashrefs (the call syntax is the same). These have methods/hash - # keys like C<$book->genre()>, C<$book->{is_sold_out}>, + # keys like C<$book->genre()>, C<$book->{is_in_stock}>, # C<$book->is_in_library($library)>, etc. $books->map_by("genre"); $books->map_by([ price_with_tax => $tax_pct ]); - $books->filter_by("is_sold_out"); + $books->filter_by("is_in_stock"); $books->filter_by([ is_in_library => $library ]); $books->filter_by([ price_with_tax => $rate ], sub { $_ > 56.00 }); $books->filter_by("price", sub { $_ > 56.00 }); @@ -94,7 +94,7 @@ $books->filter_by("author", qr/corey/i); # grep_by is an alias for filter_by - $books->grep_by("is_sold_out"); + $books->grep_by("is_in_stock"); # reject_by: the inverse of filter_by $books->reject_by("is_sold_out"); @@ -177,8 +177,8 @@ $genre_count->filter_each(sub { $_ > 5 }); # filter out each pair - # Genres with no more than five books - $genre_count->reject_each(sub { $_ > 5 }); + # Genres with more than five books + $genre_count->reject_each(sub { $_ <= 5 }); # Return reference, even in list context, e.g. in a parameter list @@ -211,7 +211,6 @@ -use true; use Carp; sub import { @@ -343,36 +342,6 @@ $books->map_by([ price_with_discount => 5.0 ]) # becomes $_->price_with_discount(5.0) -=head3 Deprecated syntax - -There is an older syntax for calling methods with arguments. It was -abandoned to open up more powerful ways to use grep/filter type -methods. Here it is for reference, in case you run into existing code. - - $array->filter_by($accessor, $args, $subref) - $books->filter_by("price_with_discount", [ 5.0 ], sub { $_ < 15.0 }) - -Call the method $accessor on each object using the arguments in the -$args arrayref like so: - - $object->$accessor(@$args) - -I, and planned for removal in version 2.000, -so if you have code with the old call style, please: - -=over 4 - -=item - -Replace your existing code with the new style as soon as possible. The -change is trivial and the code easily found by grep/ack. - -=item - -If need be, pin your version to < 2.000 in your cpanfile, dist.ini or -whatever you use to avoid upgrading modules to incompatible versions. - -=back =head2 Filter predicates @@ -466,7 +435,7 @@ =item * -which value to compare, using a regex or subref, e.g. by uc($_) +which value to compare, using a regex or subref, e.g. by C =back @@ -734,7 +703,7 @@ Examples: my @apples = $fruit->reject("apple"); - my @any_apple = $fruit->reject( qr/apple/i ); + my @no_apples = $fruit->reject( qr/apple/i ); my @publishers = $authors->reject( sub { $_->publisher->name =~ /Orbit/ }, ); @@ -1375,7 +1344,7 @@ is a string. Call the $C on each object in the list, or get the hash key -value on each hashref in the list. Return list of items wich have a +value on each hashref in the list. Return list of items which have a unique set of return values. The order is preserved. On duplicates, keep the first occurrence. @@ -2083,16 +2052,16 @@ ### filter_by - method call: $books are Book objects - my $sold_out_books = [ grep { $_->is_sold_out } @$books ]; - my $sold_out_books = $books->filter_by("is_sold_out"); - my $sold_out_books = $books->grep_by("is_sold_out"); + my $sold_out_books = [ grep { $_->is_in_stock } @$books ]; + my $sold_out_books = $books->filter_by("is_in_stock"); + my $sold_out_books = $books->grep_by("is_in_stock"); my $books_in_library = [ grep { $_->is_in_library($library) } @$books ]; my $books_in_library = $books->filter_by([ is_in_library => $library ]); - ### filter_by - hash key: $books are book hashrefs - my $sold_out_books = [ grep { $_->{is_sold_out} } @$books ]; - my $sold_out_books = $books->filter_by("is_sold_out"); + ### reject_by - hash key: $books are book hashrefs + my $sold_out_books = [ grep { ! $_->{is_in_stock} } @$books ]; + my $sold_out_books = $books->reject_by("is_in_stock"); @@ -2106,8 +2075,8 @@ #### flat - $author->books returns an arrayref of Books - my $author_books = [ map { @{$_->books} } @$authors ] - my $author_books = $authors->map_by("books")->flat + my $author_books = [ map { @{$_->books} } @$authors ]; + my $author_books = $authors->map_by("books")->flat; @@ -2139,3 +2108,5 @@ under the same terms as Perl itself. =cut + +1; diff -Nru libautobox-transform-perl-1.034/META.json libautobox-transform-perl-1.035/META.json --- libautobox-transform-perl-1.034/META.json 2019-06-19 20:23:03.000000000 +0000 +++ libautobox-transform-perl-1.035/META.json 2020-07-27 15:00:31.000000000 +0000 @@ -4,7 +4,7 @@ "- Johan Lindstrom, All Rights Reserved." ], "dynamic_config" : 0, - "generated_by" : "Minilla/v3.1.4", + "generated_by" : "Minilla/v3.1.10", "license" : [ "perl_5" ], @@ -35,7 +35,7 @@ "requires" : { "Test::CPAN::Meta" : "0", "Test::MinimumVersion::Fast" : "0.04", - "Test::PAUSE::Permissions" : "0.04", + "Test::PAUSE::Permissions" : "0.07", "Test::Pod" : "1.41", "Test::Spellunker" : "v0.2.7" } @@ -48,8 +48,7 @@ "autobox" : "0", "autobox::Core" : "0", "parent" : "0", - "perl" : "5.010", - "true" : "0" + "perl" : "5.010" } }, "test" : { @@ -64,7 +63,7 @@ "provides" : { "autobox::Transform" : { "file" : "lib/autobox/Transform.pm", - "version" : "1.034" + "version" : "1.035" } }, "release_status" : "stable", @@ -78,13 +77,14 @@ "web" : "https://github.com/jplindstrom/p5-autobox-Transform" } }, - "version" : "1.034", + "version" : "1.035", "x_authority" : "cpan:JOHANL", "x_contributors" : [ "Johan Lindstrom ", "Johan Lindstrom ", "Johan Lindstrom ", - "Mohammad S Anwar " + "Mohammad S Anwar ", + "Tom Bloor " ], "x_serialization_backend" : "JSON::PP version 2.27400_02", "x_static_install" : 1 diff -Nru libautobox-transform-perl-1.034/META.yml libautobox-transform-perl-1.035/META.yml --- libautobox-transform-perl-1.034/META.yml 2019-06-19 20:23:03.000000000 +0000 +++ libautobox-transform-perl-1.035/META.yml 2020-07-27 15:00:31.000000000 +0000 @@ -10,7 +10,7 @@ configure_requires: Module::Build::Tiny: '0.035' dynamic_config: 0 -generated_by: 'Minilla/v3.1.4, CPAN::Meta::Converter version 2.150010' +generated_by: 'Minilla/v3.1.10, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -29,7 +29,7 @@ provides: autobox::Transform: file: lib/autobox/Transform.pm - version: '1.034' + version: '1.035' requires: Carp: '0' List::MoreUtils: '0' @@ -38,17 +38,17 @@ autobox::Core: '0' parent: '0' perl: '5.010' - 'true': '0' resources: bugtracker: https://github.com/jplindstrom/p5-autobox-Transform/issues homepage: https://github.com/jplindstrom/p5-autobox-Transform repository: git://github.com/jplindstrom/p5-autobox-Transform.git -version: '1.034' +version: '1.035' x_authority: cpan:JOHANL x_contributors: - 'Johan Lindstrom ' - 'Johan Lindstrom ' - 'Johan Lindstrom ' - 'Mohammad S Anwar ' + - 'Tom Bloor ' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' x_static_install: 1 diff -Nru libautobox-transform-perl-1.034/README.md libautobox-transform-perl-1.035/README.md --- libautobox-transform-perl-1.034/README.md 2019-06-19 20:23:03.000000000 +0000 +++ libautobox-transform-perl-1.035/README.md 2020-07-27 15:00:31.000000000 +0000 @@ -7,7 +7,7 @@ [autobox](https://metacpan.org/pod/autobox) provides the ability to call methods on native types, e.g. strings, arrays, and hashes as if they were objects. -[autobox::Core](https://metacpan.org/pod/autobox::Core) provides the basic methods for Perl core functions +[autobox::Core](https://metacpan.org/pod/autobox%3A%3ACore) provides the basic methods for Perl core functions like `uc`, `map`, and `grep`. This module, `autobox::Transform`, provides higher level and more @@ -64,17 +64,17 @@ # Turn paired items into a hash @titles_books->to_hash; -## Arrays with hashrefs/objects +## Arrays where the items are hashrefs/objects # $books and $authors below are arrayrefs with either objects or # hashrefs (the call syntax is the same). These have methods/hash - # keys like C<$book->genre()>, C<$book->{is_sold_out}>, + # keys like C<$book->genre()>, C<$book->{is_in_stock}>, # C<$book->is_in_library($library)>, etc. $books->map_by("genre"); $books->map_by([ price_with_tax => $tax_pct ]); - $books->filter_by("is_sold_out"); + $books->filter_by("is_in_stock"); $books->filter_by([ is_in_library => $library ]); $books->filter_by([ price_with_tax => $rate ], sub { $_ > 56.00 }); $books->filter_by("price", sub { $_ > 56.00 }); @@ -82,7 +82,7 @@ $books->filter_by("author", qr/corey/i); # grep_by is an alias for filter_by - $books->grep_by("is_sold_out"); + $books->grep_by("is_in_stock"); # reject_by: the inverse of filter_by $books->reject_by("is_sold_out"); @@ -164,8 +164,8 @@ $genre_count->filter_each(sub { $_ > 5 }); # filter out each pair - # Genres with no more than five books - $genre_count->reject_each(sub { $_ > 5 }); + # Genres with more than five books + $genre_count->reject_each(sub { $_ <= 5 }); # Return reference, even in list context, e.g. in a parameter list @@ -234,28 +234,6 @@ $books->map_by([ price_with_discount => 5.0 ]) # becomes $_->price_with_discount(5.0) -### Deprecated syntax - -There is an older syntax for calling methods with arguments. It was -abandoned to open up more powerful ways to use grep/filter type -methods. Here it is for reference, in case you run into existing code. - - $array->filter_by($accessor, $args, $subref) - $books->filter_by("price_with_discount", [ 5.0 ], sub { $_ < 15.0 }) - -Call the method $accessor on each object using the arguments in the -$args arrayref like so: - - $object->$accessor(@$args) - -_This style is deprecated_, and planned for removal in version 2.000, -so if you have code with the old call style, please: - -- Replace your existing code with the new style as soon as possible. The -change is trivial and the code easily found by grep/ack. -- If need be, pin your version to < 2.000 in your cpanfile, dist.ini or -whatever you use to avoid upgrading modules to incompatible versions. - ## Filter predicates There are several methods that filter items, @@ -321,7 +299,7 @@ - Provide order options for how one value should be compared with the others: - how to compare (`cmp` or `<=>`) - which direction to sort (`asc`ending or `desc`ending) - - which value to compare, using a regex or subref, e.g. by uc($\_) + - which value to compare, using a regex or subref, e.g. by `uc($_)` - In case of a tie, provide another comparison # If the name is the same, compare age (oldest first) @@ -430,7 +408,7 @@ Almost all of the methods are context sensitive, i.e. they return a list in list context and an arrayref in scalar context, just like -[autobox::Core](https://metacpan.org/pod/autobox::Core). +[autobox::Core](https://metacpan.org/pod/autobox%3A%3ACore). **Beware**: _you might be in list context when you need an arrayref._ @@ -485,7 +463,7 @@ ### filter and grep -[autobox::Core](https://metacpan.org/pod/autobox::Core)'s `grep` method takes a subref, just like this +[autobox::Core](https://metacpan.org/pod/autobox%3A%3ACore)'s `grep` method takes a subref, just like this method. `filter` also supports the other predicate types, like string, regex, etc. @@ -503,7 +481,7 @@ Examples: my @apples = $fruit->reject("apple"); - my @any_apple = $fruit->reject( qr/apple/i ); + my @no_apples = $fruit->reject( qr/apple/i ); my @publishers = $authors->reject( sub { $_->publisher->name =~ /Orbit/ }, ); @@ -621,7 +599,7 @@ # ->books returns an arrayref of Book objects with a ->title $authors->map_by("books")->flat->map_by("title") -Note: This is different from [autobox::Core](https://metacpan.org/pod/autobox::Core)'s `->flatten`, +Note: This is different from [autobox::Core](https://metacpan.org/pod/autobox%3A%3ACore)'s `->flatten`, which reurns a list rather than an array and therefore can't be used in this way. @@ -754,7 +732,7 @@ is a string. Call the $`accessor` on each object in the list, or get the hash key -value on each hashref in the list. Return list of items wich have a +value on each hashref in the list. Return list of items which have a unique set of return values. The order is preserved. On duplicates, keep the first occurrence. @@ -1023,7 +1001,7 @@ ## Raison d'etre -[autobox::Core](https://metacpan.org/pod/autobox::Core) is awesome, for a variety of reasons. +[autobox::Core](https://metacpan.org/pod/autobox%3A%3ACore) is awesome, for a variety of reasons. - It cuts down on dereferencing punctuation clutter, both by using methods on references and by using ->elements to deref arrayrefs. @@ -1033,7 +1011,7 @@ to move the cursor around a lot just to fix dereferencing, order of operations etc. -On top of this, [autobox::Transform](https://metacpan.org/pod/autobox::Transform) provides a few higher level +On top of this, [autobox::Transform](https://metacpan.org/pod/autobox%3A%3ATransform) provides a few higher level methods for mapping, filtering and sorting common cases which are easier to read and write. @@ -1075,16 +1053,16 @@ ### filter_by - method call: $books are Book objects - my $sold_out_books = [ grep { $_->is_sold_out } @$books ]; - my $sold_out_books = $books->filter_by("is_sold_out"); - my $sold_out_books = $books->grep_by("is_sold_out"); + my $sold_out_books = [ grep { $_->is_in_stock } @$books ]; + my $sold_out_books = $books->filter_by("is_in_stock"); + my $sold_out_books = $books->grep_by("is_in_stock"); my $books_in_library = [ grep { $_->is_in_library($library) } @$books ]; my $books_in_library = $books->filter_by([ is_in_library => $library ]); - ### filter_by - hash key: $books are book hashrefs - my $sold_out_books = [ grep { $_->{is_sold_out} } @$books ]; - my $sold_out_books = $books->filter_by("is_sold_out"); + ### reject_by - hash key: $books are book hashrefs + my $sold_out_books = [ grep { ! $_->{is_in_stock} } @$books ]; + my $sold_out_books = $books->reject_by("is_in_stock"); @@ -1098,8 +1076,8 @@ #### flat - $author->books returns an arrayref of Books - my $author_books = [ map { @{$_->books} } @$authors ] - my $author_books = $authors->map_by("books")->flat + my $author_books = [ map { @{$_->books} } @$authors ]; + my $author_books = $authors->map_by("books")->flat; # DEVELOPMENT