[libcatmandu-perl] 23/46: support any executables as fixes (issue #68)

Jonas Smedegaard dr at jones.dk
Tue Oct 14 13:52:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9205
in repository libcatmandu-perl.

commit b88acd992f3398f8e63e3e2e145a036f46f63221
Author: Jakob Voss <voss at gbv.de>
Date:   Mon Sep 22 20:59:51 2014 +0200

    support any executables as fixes (issue #68)
---
 bin/catmandu        | 5 +++--
 lib/Catmandu/Fix.pm | 9 ++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/catmandu b/bin/catmandu
index fc88d1c..6fc453d 100755
--- a/bin/catmandu
+++ b/bin/catmandu
@@ -258,8 +258,9 @@ use:
 
 =item --fix FILE
 
-When exporting or storing apply a fix EXPRESSION or all the fixes in FILE on each
-item. This option is repeatable.
+When exporting or storing apply a fix EXPRESSION or all the fixes in FILE on
+each item. This option is repeatable. FILE can also be an arbitrary executable
+if Catmandu::Fix::cmd is installed.
 
 =item --start NUM
 
diff --git a/lib/Catmandu/Fix.pm b/lib/Catmandu/Fix.pm
index 99305ed..2e3f487 100644
--- a/lib/Catmandu/Fix.pm
+++ b/lib/Catmandu/Fix.pm
@@ -41,6 +41,8 @@ sub _trigger_fixes {
     for my $fix (@$fixes) {
         if (ref $fix) {
             push @$parsed_fixes, $fix;
+        } elsif(-X $fix) {
+            push @$parsed_fixes, require_package('Catmandu::Fix::cmd')->new($fix);
         } else {
             push @$parsed_fixes, @{$self->parser->parse($fix)};
         }
@@ -674,9 +676,10 @@ Read more about the Fix language at our Wiki: L<https://github.com/LibreCat/Catm
 
 =head2 new(fixes => [ FIX , ...])
 
-Create a new Catmandu::Fix which will execute every FIX into a consecutive order. A
-FIX can be the name of a Catmandu::Fix::* routine or the path to a plain text file
-containing all the fixes to be executed.
+Create a new Catmandu::Fix which will execute every FIX into a consecutive
+order. A FIX can be the name of a Catmandu::Fix::* routine, or the path to a
+plain text file containing all the fixes to be executed or a path to any
+executable if L<Catmandu::Fix::cmd> is installed.
 
 =head2 fix(HASH)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-perl.git



More information about the Pkg-perl-cvs-commits mailing list