HStringTemplate 0.6.9 → 0.6.10
raw patch · 3 files changed
+14/−4 lines, 3 filesdep +blaze-builderPVP ok
version bump matches the API change (PVP)
Dependencies added: blaze-builder
API changes (from Hackage documentation)
+ Text.StringTemplate.Classes: instance Stringable Builder
Files
HStringTemplate.cabal view
@@ -1,5 +1,5 @@ name: HStringTemplate-version: 0.6.9+version: 0.6.10 synopsis: StringTemplate implementation in Haskell. description: A port of the Java library by Terrence Parr. category: Text@@ -26,9 +26,9 @@ exposed-modules: Text.StringTemplate.QQ if flag(smaller-base)- build-depends: syb, base >= 4, base < 5, filepath, parsec < 4, containers, pretty, time, old-time, old-locale, bytestring, directory, array, text, deepseq, utf8-string+ build-depends: syb, base >= 4, base < 5, filepath, parsec < 4, containers, pretty, time, old-time, old-locale, bytestring, directory, array, text, deepseq, utf8-string, blaze-builder else- build-depends: base > 3, base < 4, filepath, parsec < 4, containers, pretty, time, old-time, old-locale, bytestring, directory, array, text, utf8-string+ build-depends: base > 3, base < 4, filepath, parsec < 4, containers, pretty, time, old-time, old-locale, bytestring, directory, array, text, utf8-string, blaze-builder exposed-modules: Text.StringTemplate Text.StringTemplate.Base
Text/StringTemplate/Classes.hs view
@@ -7,6 +7,8 @@ import qualified Data.Map as M import Data.List import Data.Monoid+import qualified Blaze.ByteString.Builder as BB+import qualified Blaze.ByteString.Builder.Char.Utf8 as BB import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as LB import qualified Data.Text as T@@ -126,6 +128,13 @@ stToString = LT.unpack smempty = LT.empty smappend = LT.append++instance Stringable BB.Builder where+ stFromString = BB.fromString+ stFromByteString = BB.fromLazyByteString+ stToString = LB.unpack . BB.toLazyByteString+ smappend = mappend+ smempty = mempty --add dlist instance instance Stringable (Endo String) where
Text/StringTemplate/Group.hs view
@@ -11,6 +11,7 @@ ) where import Control.Applicative import Control.Arrow+import qualified Control.Exception as CE import Control.Monad import Data.Monoid import Data.List@@ -151,7 +152,7 @@ -- by default, as it should prove useful for debugging and developing templates. unsafeVolatileDirectoryGroup :: Stringable a => FilePath -> Int -> IO (STGroup a) unsafeVolatileDirectoryGroup path m = return . flip addSubGroup extraTmpls $ cacheSTGroup stfg- where stfg = StFirst . Just . newSTMP . unsafePerformIO . flip catch+ where stfg = StFirst . Just . newSTMP . unsafePerformIO . flip CE.catch (return . (\e -> "IO Error: " ++ show (ioeGetFileName e) ++ " -- " ++ ioeGetErrorString e)) . U.readFile . (path </>) . (++".st") extraTmpls = addSubGroup (groupStringTemplates [("dumpAttribs", dumpAttribs)]) nullGroup