[interchange-cvs] interchange - jon modified lib/Vend/Interpolate.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Wed Feb 1 10:37:48 EST 2006


User:      jon
Date:      2006-02-01 15:37:48 GMT
Modified:  lib/Vend Interpolate.pm
Log:
Add "env" base to conditionals, allowing [if env HTTPS], etc.

Revision  Changes    Path
2.266     +16 -3     interchange/lib/Vend/Interpolate.pm


rev 2.266, prev_rev 2.265
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.265
retrieving revision 2.266
diff -u -u -r2.265 -r2.266
--- Interpolate.pm	12 Dec 2005 18:15:29 -0000	2.265
+++ Interpolate.pm	1 Feb 2006 15:37:47 -0000	2.266
@@ -1,8 +1,8 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.265 2005/12/12 18:15:29 mheins Exp $
+# $Id: Interpolate.pm,v 2.266 2006/02/01 15:37:47 jon Exp $
 #
-# Copyright (C) 2002-2005 Interchange Development Group
+# Copyright (C) 2002-2006 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
 #
 # This program was originally based on Vend 0.2 and 0.3
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.265 $, 10);
+$VERSION = substr(q$Revision: 2.266 $, 10);
 
 @EXPORT = qw (
 
@@ -1152,6 +1152,19 @@
 			$op .= qq% $operator $comp%
 				if defined $comp;
 		}
+	}
+	elsif($base eq 'env') {
+		my $env;
+		if (my $h = ::http()) {
+			$env = $h->{env};
+		}
+		else {
+			$env = \%ENV;
+		}
+		$op = qq%$env->{$term}%;
+		$op = "q{$op}" unless defined $noop;
+		$op .= qq% $operator $comp%
+			if defined $comp;
 	}
 	else {
 		$op =	qq%$term%;








More information about the interchange-cvs mailing list