This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "heist".
The branch, master has been updated
via 45b43591c0de602d82b723013cc90dcfd1516391 (commit)
from b6ac9f774fc181b6a9117e970d37383ae5881148 (commit)
Summary of changes:
src/Text/Templating/Heist.hs | 1 +
src/Text/Templating/Heist/Internal.hs | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 45b43591c0de602d82b723013cc90dcfd1516391
Author: Gregory Collins <[email protected]>
Date: Fri Jun 18 02:49:31 2010 -0400
Add 'hasTemplate'
diff --git a/src/Text/Templating/Heist.hs b/src/Text/Templating/Heist.hs
index 96a4ddd..8c0fbb3 100644
--- a/src/Text/Templating/Heist.hs
+++ b/src/Text/Templating/Heist.hs
@@ -77,6 +77,7 @@ module Text.Templating.Heist
, lookupSplice
, setTemplates
, loadTemplates
+ , hasTemplate
-- * Hook functions
-- $hookDoc
diff --git a/src/Text/Templating/Heist/Internal.hs
b/src/Text/Templating/Heist/Internal.hs
index a4db5cc..58efaf5 100644
--- a/src/Text/Templating/Heist/Internal.hs
+++ b/src/Text/Templating/Heist/Internal.hs
@@ -145,6 +145,15 @@ traversePath tm path name =
------------------------------------------------------------------------------
+-- | Returns 'True' if the given template can be found in the template state.
+hasTemplate :: Monad m =>
+ ByteString
+ -> TemplateState m
+ -> Bool
+hasTemplate nameStr ts = isJust $ lookupTemplate nameStr ts
+
+
+------------------------------------------------------------------------------
-- | Convenience function for looking up a template.
lookupTemplate :: Monad m =>
ByteString
-----------------------------------------------------------------------
hooks/post-receive
--
heist
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap