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  a278a5b9719523aeba65b32ea8c0b4a5bb8153e6 (commit)
      from  8b4b2309671fb2f841797501dfb0519cfe02ad1b (commit)


Summary of changes:
 heist.cabal                                        |    5 ++-
 src/Text/Templating/Heist.hs                       |    1 +
 src/Text/Templating/Heist/Internal.hs              |    9 ++++++
 .../Heist/Splices/{Bind.hs => BindStrict.hs}       |   27 +++++++------------
 test/heist-testsuite.cabal                         |    2 +-
 5 files changed, 24 insertions(+), 20 deletions(-)
 copy src/Text/Templating/Heist/Splices/{Bind.hs => BindStrict.hs} (60%)

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 a278a5b9719523aeba65b32ea8c0b4a5bb8153e6
Author: Mighty Byte <[email protected]>
Date:   Fri Jun 17 18:13:27 2011 -0400

    Add strict bind tag and addTemplatePathPrefix.

diff --git a/heist.cabal b/heist.cabal
index 4047a7d..4495ad6 100644
--- a/heist.cabal
+++ b/heist.cabal
@@ -1,5 +1,5 @@
 name:           heist
-version:        0.5.2
+version:        0.5.3
 synopsis:       An xhtml templating system
 description:    An xhtml templating system
 license:        BSD3
@@ -68,6 +68,7 @@ Library
     Text.Templating.Heist.Splices,
     Text.Templating.Heist.Splices.Apply,
     Text.Templating.Heist.Splices.Bind,
+    Text.Templating.Heist.Splices.BindStrict,
     Text.Templating.Heist.Splices.Cache,
     Text.Templating.Heist.Splices.Html,
     Text.Templating.Heist.Splices.Ignore,
@@ -80,7 +81,7 @@ Library
     Text.Templating.Heist.Types
 
   build-depends:
-    attoparsec >= 0.8.1 && < 0.9,
+    attoparsec >= 0.8.1 && < 0.10,
     attoparsec-text >= 0.8 && < 0.9,
     base >= 4 && < 5,
     blaze-builder >= 0.2 && <0.4,
diff --git a/src/Text/Templating/Heist.hs b/src/Text/Templating/Heist.hs
index fee8978..0e36be7 100644
--- a/src/Text/Templating/Heist.hs
+++ b/src/Text/Templating/Heist.hs
@@ -85,6 +85,7 @@ module Text.Templating.Heist
   , setTemplates
   , loadTemplates
   , hasTemplate
+  , addTemplatePathPrefix
 
     -- * Hook functions
     -- $hookDoc
diff --git a/src/Text/Templating/Heist/Internal.hs 
b/src/Text/Templating/Heist/Internal.hs
index 70c1a1c..720ad44 100644
--- a/src/Text/Templating/Heist/Internal.hs
+++ b/src/Text/Templating/Heist/Internal.hs
@@ -661,3 +661,12 @@ loadHook ts (tp, t) = do
     return $ insertTemplate tp t' ts
 
 
+------------------------------------------------------------------------------
+-- | 
+addTemplatePathPrefix :: ByteString
+                      -> TemplateState m -> TemplateState m
+addTemplatePathPrefix dir ts =
+    ts { _templateMap = Map.mapKeys f $ _templateMap ts }
+  where
+    f ps = ps ++ [dir]
+
diff --git a/src/Text/Templating/Heist/Splices/BindStrict.hs 
b/src/Text/Templating/Heist/Splices/BindStrict.hs
new file mode 100644
index 0000000..b442b90
--- /dev/null
+++ b/src/Text/Templating/Heist/Splices/BindStrict.hs
@@ -0,0 +1,32 @@
+module Text.Templating.Heist.Splices.BindStrict where
+
+------------------------------------------------------------------------------
+import           Data.Text (Text)
+import qualified Text.XmlHtml as X
+
+------------------------------------------------------------------------------
+import           Text.Templating.Heist.Internal
+import           Text.Templating.Heist.Splices.Apply
+import           Text.Templating.Heist.Splices.Bind
+import           Text.Templating.Heist.Types
+
+-- | Default name for the bind splice.
+bindStrictTag :: Text
+bindStrictTag = "bindStrict"
+
+
+------------------------------------------------------------------------------
+-- | Implementation of the bind splice.
+bindStrictImpl :: Monad m => Splice m
+bindStrictImpl = do
+    node <- getParamNode
+    cs <- runChildren
+    maybe (return ()) (add cs)
+          (X.getAttribute bindAttr node)
+    return []
+
+  where
+    add cs nm = modifyTS $ bindSplice nm $ do
+        caller <- getParamNode
+        ctx <- getContext
+        rawApply cs ctx (X.childNodes caller)
diff --git a/test/heist-testsuite.cabal b/test/heist-testsuite.cabal
index e66a8c6..e126323 100644
--- a/test/heist-testsuite.cabal
+++ b/test/heist-testsuite.cabal
@@ -9,7 +9,7 @@ Executable testsuite
 
   build-depends:
     QuickCheck >= 2,
-    attoparsec >= 0.8.1 && < 0.9,
+    attoparsec >= 0.8.1 && < 0.10,
     attoparsec-text >= 0.8 && < 0.9,
     base >= 4 && < 5,
     blaze-builder >= 0.2 && <0.4,
-----------------------------------------------------------------------


hooks/post-receive
-- 
heist
_______________________________________________
Snap mailing list
[email protected]
https://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to