yesod-static 0.0.0.1 → 0.1.0
raw patch · 2 files changed
+11/−8 lines, 2 filesdep +textdep −web-routesdep ~wai-app-staticdep ~yesod-core
Dependencies added: text
Dependencies removed: web-routes
Dependency ranges changed: wai-app-static, yesod-core
Files
- Yesod/Helpers/Static.hs +6/−3
- yesod-static.cabal +5/−5
Yesod/Helpers/Static.hs view
@@ -59,6 +59,8 @@ import qualified Data.ByteString.Base64 import qualified Data.ByteString.Char8 as S8 import qualified Data.Serialize+import Data.Text (Text, pack)+import Data.Monoid (mempty) import Network.Wai.Application.Static ( defaultMimeTypeByExt, StaticSettings (..), staticAppPieces@@ -88,7 +90,7 @@ -- would generate a url such as 'http://site.com/static/thumb001.jpg?foo=5&bar=choc' -- The StaticRoute constructor can be used when url's cannot be statically generated at compile-time. -- E.g. When generating image galleries.-data StaticRoute = StaticRoute [String] [(String, String)]+data StaticRoute = StaticRoute [Text] [(Text, Text)] deriving (Eq, Show, Read) type instance Route Static = StaticRoute@@ -161,10 +163,11 @@ | isUpper x = toLower x : xs | otherwise = str let name = mkName $ intercalate "_" $ map (adjust . map replace') f- f' <- lift f+ f' <- [|map pack $(lift f)|] let sr = ConE $ mkName "StaticRoute" hash <- qRunIO $ fmap base64md5 $ L.readFile $ fp ++ '/' : intercalate "/" f- let qs = ListE [TupE [LitE $ StringL hash, ListE []]]+ pack' <- [|pack|]+ qs <- [|[(pack $(lift hash), mempty)]|] return [ SigD name $ ConT ''Route `AppT` ConT ''Static , FunD name
yesod-static.cabal view
@@ -1,5 +1,5 @@ name: yesod-static-version: 0.0.0.1+version: 0.1.0 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -9,7 +9,7 @@ stability: Stable cabal-version: >= 1.6 build-type: Simple-homepage: http://docs.yesodweb.com/+homepage: http://www.yesodweb.com/ flag test description: Build the executable to run unit tests@@ -17,16 +17,16 @@ library build-depends: base >= 4 && < 5- , yesod-core >= 0.7 && < 0.8+ , yesod-core >= 0.8 && < 0.9 , base64-bytestring >= 0.1.0.1 && < 0.2 , pureMD5 >= 2.1.0.3 && < 2.2 , cereal >= 0.3 && < 0.4 , bytestring >= 0.9 && < 0.10- , web-routes >= 0.23 && < 0.24 , template-haskell , directory >= 1.0 && < 1.2 , transformers >= 0.2 && < 0.3- , wai-app-static >= 0.0.1 && < 0.1+ , wai-app-static >= 0.1 && < 0.2+ , text >= 0.5 && < 1.0 exposed-modules: Yesod.Helpers.Static ghc-options: -Wall