[libcatmandu-mab2-perl] 01/35: Upgrading Catmandu using new group binds for mab_each
Jonas Smedegaard
dr at jones.dk
Fri Oct 27 17:54:40 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/0.21-1
in repository libcatmandu-mab2-perl.
commit 89cf2a2b2abcf1bf9930ddd494c2fd6cac639590
Author: Johann Rolschewski <jorol at cpan.org>
Date: Fri Jun 30 16:32:16 2017 +0200
Upgrading Catmandu using new group binds for mab_each
---
cpanfile | 2 +-
lib/Catmandu/Fix/Bind/mab_each.pm | 6 +++---
t/07-mab-each.t | 5 -----
3 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/cpanfile b/cpanfile
index 092a919..7932851 100644
--- a/cpanfile
+++ b/cpanfile
@@ -1,6 +1,6 @@
requires 'perl', 'v5.10.1';
-requires 'Catmandu', '0.9504';
+requires 'Catmandu', '1.0601';
requires 'Catmandu::SRU', '>= 0.032';
requires 'Readonly';
diff --git a/lib/Catmandu/Fix/Bind/mab_each.pm b/lib/Catmandu/Fix/Bind/mab_each.pm
index c5516f5..31b5e49 100644
--- a/lib/Catmandu/Fix/Bind/mab_each.pm
+++ b/lib/Catmandu/Fix/Bind/mab_each.pm
@@ -5,7 +5,7 @@ our $VERSION = '0.14';
use Moo;
use Catmandu::Util;
-with 'Catmandu::Fix::Bind';
+with 'Catmandu::Fix::Bind', 'Catmandu::Fix::Bind::Group';
has done => (is => 'ro');
@@ -16,7 +16,7 @@ sub unit {
}
sub bind {
- my ($self,$mvar,$func,$name,$fixer) = @_;
+ my ($self,$mvar,$code) = @_;
return $mvar if $self->done;
@@ -28,7 +28,7 @@ sub bind {
$mvar->{record} = [$row];
- my $fixed = $fixer->fix($mvar);
+ my $fixed = $code->($mvar);
push @new , @{$fixed->{record}} if defined($fixed) && exists $fixed->{record};
}
diff --git a/t/07-mab-each.t b/t/07-mab-each.t
index 9ad52c4..0e9310e 100644
--- a/t/07-mab-each.t
+++ b/t/07-mab-each.t
@@ -22,11 +22,7 @@ my $fixer = Catmandu::Fix->new(fixes => [q|
if mab_match("03.",'ger')
add_field(is_ger,true)
end
- if mab_match("542",'.*')
- reject()
- end
end
- mab_map("542",test)
|]);
my $importer = Catmandu::Importer::MAB2->new( file => './t/mab2.xml', type => "XML" );
@@ -34,6 +30,5 @@ my $record = $fixer->fix($importer->first);
ok exists $record->{record}, 'created a MAB2 record';
is $record->{is_ger}, 'true', 'created is_ger tag';
-ok ! exists $record->{test} , 'fields 542 deleted';
done_testing;
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-mab2-perl.git
More information about the Pkg-perl-cvs-commits
mailing list