packages feed

yesod-static 0.1.0 → 0.1.0.1

raw patch · 2 files changed

+12/−2 lines, 2 files

Files

Yesod/Helpers/Static.hs view
@@ -73,6 +73,8 @@ import Test.HUnit hiding (Test) #endif +import System.IO (withBinaryFile, IOMode (ReadMode))+ newtype Static = Static StaticSettings  -- | Default value of 'Static' for a given file folder.@@ -165,7 +167,8 @@         let name = mkName $ intercalate "_" $ map (adjust . map replace') f         f' <- [|map pack $(lift f)|]         let sr = ConE $ mkName "StaticRoute"-        hash <- qRunIO $ fmap base64md5 $ L.readFile $ fp ++ '/' : intercalate "/" f+        hash <- qRunIO . calcHash $ fp ++ '/' : intercalate "/" f+         pack' <- [|pack|]         qs <- [|[(pack $(lift hash), mempty)]|]         return@@ -204,3 +207,10 @@     go '+' = '-'     go '/' = '_'     go c   = c++calcHash :: FilePath -> IO String+calcHash fname =+    withBinaryFile fname ReadMode hashHandle+  where+    hashHandle h = do s <- L.hGetContents h+                      return $! base64md5 s
yesod-static.cabal view
@@ -1,5 +1,5 @@ name:            yesod-static-version:         0.1.0+version:         0.1.0.1 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>