[interchange] strip_path filter
Mark Johnson
interchange-cvs at icdevgroup.org
Sun Jan 19 04:00:58 UTC 2014
commit d1558823a7a5d8ea7c1b946cfd566d697c98c5ad
Author: Mark Johnson <mark at endpoint.com>
Date: Sat Jan 18 22:59:39 2014 -0500
strip_path filter
* Filter to strip any arbitrary path elements down to just
the filename, Win or Unix.
code/Filter/strip_path.filter | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/code/Filter/strip_path.filter b/code/Filter/strip_path.filter
new file mode 100644
index 0000000..3def6a4
--- /dev/null
+++ b/code/Filter/strip_path.filter
@@ -0,0 +1,17 @@
+# Copyright 2002-2014 Interchange Development Group and others
+# Copyright 1996-2002 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version. See the LICENSE file for details.
+
+CodeDef strip_path Filter
+CodeDef strip_path Description Strip all path segments, leaving file name
+CodeDef strip_path Routine <<EOR
+sub {
+ local $_ = shift;
+ s{.*[/\\]}{}s;
+ return $_;
+}
+EOR
More information about the interchange-cvs
mailing list