updated yesod packages to export TH symbols and auto-spliced yesod-form

This commit is contained in:
Joey Hess 2013-04-15 17:42:46 -04:00
parent 737ece771b
commit 3deeb02430
10 changed files with 2262 additions and 11 deletions

View file

@ -0,0 +1,139 @@
From 2e6f4a373fc05968e6dadcc49185d64a69eeddf4 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 12:38:22 -0400
Subject: [PATCH] remove TH
---
Data/.FileEmbed.hs.swp | Bin 4096 -> 0 bytes
Data/FileEmbed.hs | 77 +------------------------------------------------
2 files changed, 1 insertion(+), 76 deletions(-)
delete mode 100644 Data/.FileEmbed.hs.swp
diff --git a/Data/.FileEmbed.hs.swp b/Data/.FileEmbed.hs.swp
deleted file mode 100644
index 7570045ca90875097c2d56ba885d26dcf344bc27..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4096
zcmYc?2=nw+FxN9?00IF9h8Ufkz&R6G7!1T17_#zHD?!49Kzd#&Athk>I*@_-X_+~x
zx~aKIsVTY!dIowXdgl5ri6x2pZa{HYkg#4xF;T{iDjE%e(GVau1WHTNbS-!pjExKp
sl$8_}goQ$h)j6teGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONV3>pe0P*q}cmMzZ
diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs
index 66f7004..b15e331 100644
--- a/Data/FileEmbed.hs
+++ b/Data/FileEmbed.hs
@@ -1,31 +1,12 @@
-{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE CPP #-}
module Data.FileEmbed
( -- * Embed at compile time
- embedFile
- , embedDir
- , getDir
+ getDir
-- * Inject into an executable
-#if MIN_VERSION_template_haskell(2,5,0)
- , dummySpace
-#endif
, inject
, injectFile
) where
-import Language.Haskell.TH.Syntax
- ( Exp (AppE, ListE, LitE, TupE, SigE)
-#if MIN_VERSION_template_haskell(2,5,0)
- , Lit (StringL, StringPrimL, IntegerL)
-#else
- , Lit (StringL, IntegerL)
-#endif
- , Q
- , runIO
-#if MIN_VERSION_template_haskell(2,7,0)
- , Quasi(qAddDependentFile)
-#endif
- )
import System.Directory (doesDirectoryExist, doesFileExist,
getDirectoryContents)
import Control.Monad (filterM)
@@ -37,51 +18,12 @@ import Data.ByteString.Unsafe (unsafePackAddressLen)
import System.IO.Unsafe (unsafePerformIO)
import System.FilePath ((</>))
--- | Embed a single file in your source code.
---
--- > import qualified Data.ByteString
--- >
--- > myFile :: Data.ByteString.ByteString
--- > myFile = $(embedFile "dirName/fileName")
-embedFile :: FilePath -> Q Exp
-embedFile fp =
-#if MIN_VERSION_template_haskell(2,7,0)
- qAddDependentFile fp >>
-#endif
- (runIO $ B.readFile fp) >>= bsToExp
-
--- | Embed a directory recusrively in your source code.
---
--- > import qualified Data.ByteString
--- >
--- > myDir :: [(FilePath, Data.ByteString.ByteString)]
--- > myDir = $(embedDir "dirName")
-embedDir :: FilePath -> Q Exp
-embedDir fp = do
- typ <- [t| [(FilePath, B.ByteString)] |]
- e <- ListE <$> ((runIO $ fileList fp) >>= mapM (pairToExp fp))
- return $ SigE e typ
-
-- | Get a directory tree in the IO monad.
--
-- This is the workhorse of 'embedDir'
getDir :: FilePath -> IO [(FilePath, B.ByteString)]
getDir = fileList
-pairToExp :: FilePath -> (FilePath, B.ByteString) -> Q Exp
-pairToExp _root (path, bs) = do
-#if MIN_VERSION_template_haskell(2,7,0)
- qAddDependentFile $ _root ++ '/' : path
-#endif
- exp' <- bsToExp bs
- return $! TupE [LitE $ StringL path, exp']
-
-bsToExp :: B.ByteString -> Q Exp
-bsToExp bs = do
- helper <- [| stringToBs |]
- let chars = B8.unpack bs
- return $! AppE helper $! LitE $! StringL chars
-
stringToBs :: String -> B.ByteString
stringToBs = B8.pack
@@ -123,23 +65,6 @@ padSize i =
let s = show i
in replicate (sizeLen - length s) '0' ++ s
-#if MIN_VERSION_template_haskell(2,5,0)
-dummySpace :: Int -> Q Exp
-dummySpace space = do
- let size = padSize space
- let start = magic ++ size
- let chars = LitE $ StringPrimL $
-#if MIN_VERSION_template_haskell(2,6,0)
- map (toEnum . fromEnum) $
-#endif
- start ++ replicate space '0'
- let len = LitE $ IntegerL $ fromIntegral $ length start + space
- upi <- [|unsafePerformIO|]
- pack <- [|unsafePackAddressLen|]
- getInner' <- [|getInner|]
- return $ getInner' `AppE` (upi `AppE` (pack `AppE` len `AppE` chars))
-#endif
-
inject :: B.ByteString -- ^ bs to inject
-> B.ByteString -- ^ original BS containing dummy
-> Maybe B.ByteString -- ^ new BS, or Nothing if there is insufficient dummy space
--
1.8.2.rc3

View file

@ -1,17 +1,19 @@
From 7be8bf3ba75acc5209066e6ba31ae589c541f344 Mon Sep 17 00:00:00 2001
From aa18210b7cc124e11fb71640d993de77492b63b1 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 28 Feb 2013 23:30:01 -0400
Subject: [PATCH] axe murdered
Date: Mon, 15 Apr 2013 15:08:31 -0400
Subject: [PATCH] remove TH
Export functions referred to by TH splices, as these will be needed when
using the Evil Splicer
---
Text/Hamlet.hs | 215 +-------------------------------------------------------
1 file changed, 2 insertions(+), 213 deletions(-)
Text/Hamlet.hs | 219 ++-------------------------------------------------------
1 file changed, 6 insertions(+), 213 deletions(-)
diff --git a/Text/Hamlet.hs b/Text/Hamlet.hs
index 4ac870a..bc8edd5 100644
index 4ac870a..63b8555 100644
--- a/Text/Hamlet.hs
+++ b/Text/Hamlet.hs
@@ -11,35 +11,22 @@
@@ -11,35 +11,26 @@
module Text.Hamlet
( -- * Plain HTML
Html
@ -46,10 +48,14 @@ index 4ac870a..bc8edd5 100644
, CloseStyle (..)
+ , condH
+ , maybeH
+
+ -- referred to in TH splices
+ , attrsToHtml
+ , asHtmlUrl
) where
import Text.Shakespeare.Base
@@ -90,14 +77,6 @@ type HtmlUrl url = Render url -> Html
@@ -90,14 +81,6 @@ type HtmlUrl url = Render url -> Html
-- | A function generating an 'Html' given a message translator and a URL rendering function.
type HtmlUrlI18n msg url = Translate msg -> Render url -> Html
@ -64,7 +70,7 @@ index 4ac870a..bc8edd5 100644
unIdent :: Ident -> String
unIdent (Ident s) = s
@@ -159,169 +138,9 @@ recordToFieldNames conStr = do
@@ -159,169 +142,9 @@ recordToFieldNames conStr = do
[fields] <- return [fields | RecC name fields <- cons, name == conName]
return [fieldName | (fieldName, _, _) <- fields]
@ -234,7 +240,7 @@ index 4ac870a..bc8edd5 100644
data HamletRules = HamletRules
{ hrFromHtml :: Exp
, hrWithEnv :: (Env -> Q Exp) -> Q Exp
@@ -333,36 +152,6 @@ data Env = Env
@@ -333,36 +156,6 @@ data Env = Env
, msgRender :: Maybe ((Exp -> Q Exp) -> Q Exp)
}
@ -272,5 +278,5 @@ index 4ac870a..bc8edd5 100644
varName _ "" = error "Illegal empty varName"
varName scope v@(_:_) = fromMaybe (strToExp v) $ lookup (Ident v) scope
--
1.7.10.4
1.8.2.rc3

View file

@ -0,0 +1,139 @@
From 3cb1056782c29b0b68bdcff8fa49d3ea92126956 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 16:46:15 -0400
Subject: [PATCH] export symbol used by TH splices
---
Text/.Shakespeare.hs.swp | Bin 24576 -> 0 bytes
Text/Shakespeare.hs | 2 ++
2 files changed, 2 insertions(+)
delete mode 100644 Text/.Shakespeare.hs.swp
diff --git a/Text/.Shakespeare.hs.swp b/Text/.Shakespeare.hs.swp
deleted file mode 100644
index 4d6cd6a0295fdfb59f32a66b4af556c0630dd5b0..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 24576
zcmeI4e~et$RmWd`KnqD)L_(BS5xTW4?M$;fu@g0M7u$*LtdmXsW9?l#wDxBEJo9Gf
z#WU|s-h1QO^^dk7RGJp46wwy`NCj0Y(S!!1AgEe}NKk}8ErJRNG@z(KqJ@T13Q|#9
zR6ghact2*x>kWSanvuTVnRm}U_uO;OJ@?*o&-2-xr{<5SdmDFqe16RHu3haOfAZ_E
z_a3<D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d-ZxA)it9iDq`snz&
zvDE4)lvrqlCfz*QCHtOE%zHp;hi=MF0UaUN$02Kt#j#D9Se{Ia4K=DUb#v3QB9oxP
zwzU1w@6WNRu*bx!Fm!?M5q`vZteUtpl5-)+%;rs24mL%JOcA9&qh!VLrXZ-fOO729
zKPK3rQ|qhji{p;jMqasN`rfA);}JIIeOp|cZr)uN8TD0FD!Q+0X5s+sdf+Oou)><h
z@^6Kg)7(m_yy$C1XT{;NAb4%c(0;9`ypg*;l3D_HPgH9qao@bzRy$*&a%wMunV*_c
zmoB*%A5@d;G*^Q@+GSJ180JQ6>pIJ;jMG|PctyQ!GSmbiv3Qr)u&ouEmum^pkkc@$
zw#m&VrMmx{u&J%gPF<Xum0rTGOo$t96J~@>TffSIcHAo>@*W5;6-uS6@+S&5%ay{F
cT45AdikYcun%oMsfwvWjb+Ig{u-NAPH%ay)TmS$7
diff --git a/Text/Shakespeare.hs b/Text/Shakespeare.hs
index d300951..fabbf66 100644
--- a/Text/Shakespeare.hs
+++ b/Text/Shakespeare.hs
@@ -22,6 +22,8 @@ module Text.Shakespeare
#ifdef TEST_EXPORT
, preFilter
#endif
+ -- used by TH splices
+ , pack'
) where
import Data.List (intersperse)
--
1.8.2.rc3

View file

@ -0,0 +1,26 @@
From 23e96f0d948e7a26febf1745a4c373faf579c8ee Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 16:32:31 -0400
Subject: [PATCH] expose modules used by TH
---
shakespeare-css.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shakespeare-css.cabal b/shakespeare-css.cabal
index de2497b..468353a 100644
--- a/shakespeare-css.cabal
+++ b/shakespeare-css.cabal
@@ -39,8 +39,8 @@ library
exposed-modules: Text.Cassius
Text.Lucius
- other-modules: Text.MkSizeType
Text.Css
+ other-modules: Text.MkSizeType
Text.IndentToBrace
Text.CssCommon
ghc-options: -Wall
--
1.8.2.rc3

View file

@ -0,0 +1,36 @@
From c18ae75852b1340ca502528138bf421659f61a3d Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 12:44:15 -0400
Subject: [PATCH] remove TH
Should not need these icons in git-annex, so not worth using the Evil
Splicer.
---
Network/Wai/Application/Static.hs | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Network/Wai/Application/Static.hs b/Network/Wai/Application/Static.hs
index 3195fbb..b48aa01 100644
--- a/Network/Wai/Application/Static.hs
+++ b/Network/Wai/Application/Static.hs
@@ -33,8 +33,6 @@ import Control.Monad.IO.Class (liftIO)
import Blaze.ByteString.Builder (toByteString)
-import Data.FileEmbed (embedFile)
-
import Data.Text (Text)
import qualified Data.Text as T
@@ -198,8 +196,6 @@ staticAppPieces _ _ req
H.status405
[("Content-Type", "text/plain")]
"Only GET is supported"
-staticAppPieces _ [".hidden", "folder.png"] _ = return $ W.responseLBS H.status200 [("Content-Type", "image/png")] $ L.fromChunks [$(embedFile "images/folder.png")]
-staticAppPieces _ [".hidden", "haskell.png"] _ = return $ W.responseLBS H.status200 [("Content-Type", "image/png")] $ L.fromChunks [$(embedFile "images/haskell.png")]
staticAppPieces ss rawPieces req = liftIO $ do
case toPieces rawPieces of
Just pieces -> checkPieces ss pieces req >>= response
--
1.8.2.rc3

View file

@ -5,6 +5,9 @@ Subject: [PATCH 2/2] replaced TH in Yesod.Internal.Core
Done by running a build with -ddump-splices and manually pasting in the
spliced code, and then modifying it until it compiles.
(This predated the Evil Splicer, and both this and the previous patch need
to be redone to use it.)
---
Yesod/Internal/Core.hs | 211 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 201 insertions(+), 10 deletions(-)

View file

@ -0,0 +1,26 @@
From b7e01a2fded6575678db234e1f2de1f104f11376 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 15:25:07 -0400
Subject: [PATCH 3/3] exports for TH splices
---
Yesod/Widget.hs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Yesod/Widget.hs b/Yesod/Widget.hs
index bf79150..01ae294 100644
--- a/Yesod/Widget.hs
+++ b/Yesod/Widget.hs
@@ -52,6 +52,9 @@ module Yesod.Widget
, addScriptEither
-- * Internal
, unGWidget
+
+ -- used by TH code
+ , liftW
) where
import Data.Monoid
--
1.8.2.rc3

View file

@ -0,0 +1,83 @@
From a603bac40f0a0f6232fbfb056a778860270101de Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 15:59:56 -0400
Subject: [PATCH 1/2] prepare for Evil Splicer
---
Yesod/Form/Functions.hs | 3 +--
evilsplicer-headers.hs | 9 +++++++++
yesod-form.cabal | 5 +++--
3 files changed, 13 insertions(+), 4 deletions(-)
create mode 100644 evilsplicer-headers.hs
diff --git a/Yesod/Form/Functions.hs b/Yesod/Form/Functions.hs
index db3e493..89eb1e8 100644
--- a/Yesod/Form/Functions.hs
+++ b/Yesod/Form/Functions.hs
@@ -54,10 +54,9 @@ import Text.Blaze (Markup, toMarkup)
#define toHtml toMarkup
import Yesod.Handler (GHandler, getRequest, runRequestBody, newIdent, getYesod)
import Yesod.Core (RenderMessage, SomeMessage (..))
-import Yesod.Widget (GWidget, whamlet)
+import Yesod.Widget (GWidget)
import Yesod.Request (reqToken, reqWaiRequest, reqGetParams, languages)
import Network.Wai (requestMethod)
-import Text.Hamlet (shamlet)
import Data.Monoid (mempty)
import Data.Maybe (listToMaybe, fromMaybe)
import Yesod.Message (RenderMessage (..))
diff --git a/evilsplicer-headers.hs b/evilsplicer-headers.hs
new file mode 100644
index 0000000..865d043
--- /dev/null
+++ b/evilsplicer-headers.hs
@@ -0,0 +1,9 @@
+import qualified Data.Text.Lazy.Builder
+import qualified Text.Shakespeare
+import qualified Text.Hamlet
+import qualified Data.Monoid
+import qualified Text.Julius
+import qualified "blaze-markup" Text.Blaze.Internal
+import qualified "blaze-markup" Text.Blaze as Text.Blaze.Markup
+import qualified Yesod.Widget
+import qualified Data.Foldable
diff --git a/yesod-form.cabal b/yesod-form.cabal
index a0d2a80..ae99ddc 100644
--- a/yesod-form.cabal
+++ b/yesod-form.cabal
@@ -18,7 +18,7 @@ library
, yesod-persistent >= 1.1 && < 1.2
, time >= 1.1.4
, hamlet >= 1.1 && < 1.2
- , shakespeare-css >= 1.0 && < 1.1
+ , shakespeare-css == 1.0.2
, shakespeare-js >= 1.0.2 && < 1.2
, persistent >= 1.0 && < 1.2
, template-haskell
@@ -37,6 +37,7 @@ library
, attoparsec >= 0.10 && < 0.11
, crypto-api >= 0.8 && < 0.11
, aeson
+ , shakespeare
exposed-modules: Yesod.Form
Yesod.Form.Class
@@ -45,7 +46,6 @@ library
Yesod.Form.Input
Yesod.Form.Fields
Yesod.Form.Jquery
- Yesod.Form.Nic
Yesod.Form.MassInput
Yesod.Form.I18n.English
Yesod.Form.I18n.Portuguese
@@ -56,6 +56,7 @@ library
Yesod.Form.I18n.Japanese
-- FIXME Yesod.Helpers.Crud
ghc-options: -Wall
+ Extensions: PackageImports
test-suite test
type: exitcode-stdio-1.0
--
1.8.2.rc3

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,187 @@
From 476414b04064bb66fc25ba9ca426c309fe5c156e Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 12:48:13 -0400
Subject: [PATCH] remove TH
---
Yesod/Static.hs | 121 ----------------------------------------------
dist/package.conf.inplace | 3 +-
2 files changed, 2 insertions(+), 122 deletions(-)
diff --git a/Yesod/Static.hs b/Yesod/Static.hs
index e8ca09f..193b1f0 100644
--- a/Yesod/Static.hs
+++ b/Yesod/Static.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE QuasiQuotes #-}
-{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
@@ -34,11 +32,6 @@ module Yesod.Static
-- * Smart constructor
, static
, staticDevel
- , embed
- -- * Template Haskell helpers
- , staticFiles
- , staticFilesList
- , publicFiles
-- * Hashing
, base64md5
#ifdef TEST_EXPORT
@@ -50,7 +43,6 @@ import Prelude hiding (FilePath)
import qualified Prelude
import System.Directory
import Control.Monad
-import Data.FileEmbed (embedDir)
import Yesod.Core hiding (lift)
@@ -111,18 +103,6 @@ staticDevel dir = do
hashLookup <- cachedETagLookupDevel dir
return $ Static $ webAppSettingsWithLookup (F.decodeString dir) hashLookup
--- | Produce a 'Static' based on embedding all of the static
--- files' contents in the executable at compile time.
--- Nota Bene: if you replace the scaffolded 'static' call in Settings/StaticFiles.hs
--- you will need to change the scaffolded addStaticContent. Otherwise, some of your
--- assets will be 404'ed. This is because by default yesod will generate compile those
--- assets to @static/tmp@ which for 'static' is fine since they are served out of the
--- directory itself. With embedded static, that will not work.
--- You can easily change @addStaticContent@ to @\_ _ _ -> return Nothing@ as a workaround.
--- This will cause yesod to embed those assets into the generated HTML file itself.
-embed :: Prelude.FilePath -> Q Exp
-embed fp = [|Static (embeddedSettings $(embedDir fp))|]
-
instance RenderRoute Static where
-- | A route on the static subsite (see also 'staticFiles').
--
@@ -167,59 +147,6 @@ getFileListPieces = flip go id
dirs' <- mapM (\f -> go (fullPath f) (front . (:) f)) dirs
return $ concat $ files' : dirs'
--- | Template Haskell function that automatically creates routes
--- for all of your static files.
---
--- For example, if you used
---
--- > staticFiles "static/"
---
--- and you had files @\"static\/style.css\"@ and
--- @\"static\/js\/script.js\"@, then the following top-level
--- definitions would be created:
---
--- > style_css = StaticRoute ["style.css"] []
--- > js_script_js = StaticRoute ["js/script.js"] []
---
--- Note that dots (@.@), dashes (@-@) and slashes (@\/@) are
--- replaced by underscores (@\_@) to create valid Haskell
--- identifiers.
-staticFiles :: Prelude.FilePath -> Q [Dec]
-staticFiles dir = mkStaticFiles dir
-
--- | Same as 'staticFiles', but takes an explicit list of files
--- to create identifiers for. The files path given are relative
--- to the static folder. For example, to create routes for the
--- files @\"static\/js\/jquery.js\"@ and
--- @\"static\/css\/normalize.css\"@, you would use:
---
--- > staticFilesList \"static\" [\"js\/jquery.js\", \"css\/normalize.css\"]
---
--- This can be useful when you have a very large number of static
--- files, but only need to refer to a few of them from Haskell.
-staticFilesList :: Prelude.FilePath -> [Prelude.FilePath] -> Q [Dec]
-staticFilesList dir fs =
- mkStaticFilesList dir (map split fs) "StaticRoute" True
- where
- split :: Prelude.FilePath -> [String]
- split [] = []
- split x =
- let (a, b) = break (== '/') x
- in a : split (drop 1 b)
-
--- | Same as 'staticFiles', but doesn't append an ETag to the
--- query string.
---
--- Using 'publicFiles' will speed up the compilation, since there
--- won't be any need for hashing files during compile-time.
--- However, since the ETag ceases to be part of the URL, the
--- 'Static' subsite won't be able to set the expire date too far
--- on the future. Browsers still will be able to cache the
--- contents, however they'll need send a request to the server to
--- see if their copy is up-to-date.
-publicFiles :: Prelude.FilePath -> Q [Dec]
-publicFiles dir = mkStaticFiles' dir "StaticRoute" False
-
mkHashMap :: Prelude.FilePath -> IO (M.Map F.FilePath S8.ByteString)
mkHashMap dir = do
@@ -262,54 +189,6 @@ cachedETagLookup dir = do
etags <- mkHashMap dir
return $ (\f -> return $ M.lookup f etags)
-mkStaticFiles :: Prelude.FilePath -> Q [Dec]
-mkStaticFiles fp = mkStaticFiles' fp "StaticRoute" True
-
-mkStaticFiles' :: Prelude.FilePath -- ^ static directory
- -> String -- ^ route constructor "StaticRoute"
- -> Bool -- ^ append checksum query parameter
- -> Q [Dec]
-mkStaticFiles' fp routeConName makeHash = do
- fs <- qRunIO $ getFileListPieces fp
- mkStaticFilesList fp fs routeConName makeHash
-
-mkStaticFilesList
- :: Prelude.FilePath -- ^ static directory
- -> [[String]] -- ^ list of files to create identifiers for
- -> String -- ^ route constructor "StaticRoute"
- -> Bool -- ^ append checksum query parameter
- -> Q [Dec]
-mkStaticFilesList fp fs routeConName makeHash = do
- concat `fmap` mapM mkRoute fs
- where
- replace' c
- | 'A' <= c && c <= 'Z' = c
- | 'a' <= c && c <= 'z' = c
- | '0' <= c && c <= '9' = c
- | otherwise = '_'
- mkRoute f = do
- let name' = intercalate "_" $ map (map replace') f
- routeName = mkName $
- case () of
- ()
- | null name' -> error "null-named file"
- | isDigit (head name') -> '_' : name'
- | isLower (head name') -> name'
- | otherwise -> '_' : name'
- f' <- [|map pack $(lift f)|]
- let route = mkName routeConName
- pack' <- [|pack|]
- qs <- if makeHash
- then do hash <- qRunIO $ base64md5File $ pathFromRawPieces fp f
- [|[(pack "etag", pack $(lift hash))]|]
- else return $ ListE []
- return
- [ SigD routeName $ ConT route
- , FunD routeName
- [ Clause [] (NormalB $ (ConE route) `AppE` f' `AppE` qs) []
- ]
- ]
-
base64md5File :: Prelude.FilePath -> IO String
base64md5File = fmap (base64 . encode) . hashFile
where encode d = Data.Serialize.encode (d :: MD5)
diff --git a/dist/package.conf.inplace b/dist/package.conf.inplace
index 0637a08..eeff311 100644
--- a/dist/package.conf.inplace
+++ b/dist/package.conf.inplace
@@ -1 +1,2 @@
-[]
\ No newline at end of file
+[InstalledPackageInfo {installedPackageId = InstalledPackageId "yesod-static-1.1.2-inplace", sourcePackageId = PackageIdentifier {pkgName = PackageName "yesod-static", pkgVersion = Version {versionBranch = [1,1,2], versionTags = []}}, license = MIT, copyright = "", maintainer = "Michael Snoyman <michael@snoyman.com>, Greg Weber <greg@gregweber.info>", author = "Michael Snoyman <michael@snoyman.com>", stability = "Stable", homepage = "http://www.yesodweb.com/", pkgUrl = "", synopsis = "Static file serving subsite for Yesod Web Framework.", description = "Static file serving subsite for Yesod Web Framework.", category = "Web, Yesod", exposed = True, exposedModules = ["Yesod.Static"], hiddenModules = [], trusted = False, importDirs = ["/home/joey/yesod-static-1.1.2/dist/build"], libraryDirs = ["/home/joey/yesod-static-1.1.2/dist/build"], hsLibraries = ["HSyesod-static-1.1.2"], extraLibraries = [], extraGHCiLibraries = [], includeDirs = [], includes = [], depends = [InstalledPackageId "base-4.7.0.0-460992ac16ead97d88c73f4125e796d4",InstalledPackageId "base64-bytestring-1.0.0.1-8f54bb73ec493a5130061ebca542c11e",InstalledPackageId "bytestring-0.10.3.0-9c590669208a87636c23a3d3510a31ff",InstalledPackageId "cereal-0.3.5.2-f30c5cc09d1cc15977a64fe292c53513",InstalledPackageId "conduit-0.5.6-3168abc5ff00ded4bbc15f5915ad8633",InstalledPackageId "containers-0.5.0.0-eaa71ab98116fcd2d322913214739de5",InstalledPackageId "crypto-conduit-0.4.3-7a2968522a5c4748ce5988a2a466061e",InstalledPackageId "cryptohash-0.8.3-0aac68aa3a568ebeb89a354c921feb58",InstalledPackageId "directory-1.2.0.1-ca44c33c2fac281048d0dd7cd29e86c3",InstalledPackageId "file-embed-0.0.4.7-70a8411da82b83a0bbea9ecb291922ca",InstalledPackageId "http-types-0.7.3.0.1-09ea63b109c64a8370a96ee561c3ab2a",InstalledPackageId "old-time-1.1.0.1-9c370bbecb794b4c05408eb17a0038f1",InstalledPackageId "system-filepath-0.4.7-9506cbec38ccb0e49fd3a1dcce66306e",InstalledPackageId "template-haskell-2.9.0.0-60ba2293ffcafe171e54a808fdce5a7c",InstalledPackageId "text-0.11.2.3-948bb4afd264a1a5c0cca04031b4151c",InstalledPackageId "transformers-0.3.0.0-bae5adc5a648f25bafc73de9dc6a08a0",InstalledPackageId "unix-compat-0.4.1.0-0019b5bc860083c9a153099b086619ed",InstalledPackageId "wai-1.3.0.2-0f2b7cd8b8b0d8a776528af2b9f1f4f9",InstalledPackageId "wai-app-static-1.3.1-a32981caae981238524cee9823ccc666",InstalledPackageId "yesod-core-1.1.8-c0a15bfed9cb8f978bdf71ddd343ea18"], hugsOptions = [], ccOptions = [], ldOptions = [], frameworkDirs = [], frameworks = [], haddockInterfaces = ["/home/joey/yesod-static-1.1.2/dist/doc/html/yesod-static/yesod-static.haddock"], haddockHTMLs = ["/home/joey/yesod-static-1.1.2/dist/doc/html/yesod-static"]}
+]
\ No newline at end of file
--
1.8.2.rc3