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 "snap".
The branch, master has been updated
via f62364d5fab2d4aca5fe360b91024c90f38638d4 (commit)
via 38911fbdcc017ed653b2391b54d143f83281541c (commit)
from 4de12c1af6b8e6c93f59c3528465e460f9b6198c (commit)
Summary of changes:
project_template/barebones/src/Main.hs | 2 +-
project_template/default/foo.cabal | 6 +++---
.../default/resources/templates/echo.tpl | 3 +--
.../default/resources/templates/index.tpl | 3 +--
project_template/default/src/Site.hs | 5 +++--
.../default/src/Snap/Extension/Timer.hs | 7 +++----
6 files changed, 12 insertions(+), 14 deletions(-)
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 f62364d5fab2d4aca5fe360b91024c90f38638d4
Merge: 38911fb 4de12c1
Author: Chris Smith <[email protected]>
Date: Sat Feb 5 14:53:43 2011 -0700
Merge branch 'master' of github.com:snapframework/snap
commit 38911fbdcc017ed653b2391b54d143f83281541c
Author: Chris Smith <[email protected]>
Date: Sat Feb 5 14:53:08 2011 -0700
Change default projects to build with 0.4 and new heist.
diff --git a/project_template/barebones/src/Main.hs
b/project_template/barebones/src/Main.hs
index e1c566b..b0c577b 100644
--- a/project_template/barebones/src/Main.hs
+++ b/project_template/barebones/src/Main.hs
@@ -12,7 +12,7 @@ main = quickHttpServe $
route [ ("foo", writeBS "bar")
, ("echo/:echoparam", echoHandler)
] <|>
- dir "static" (fileServe ".")
+ dir "static" (serveDirectory ".")
echoHandler :: Snap ()
echoHandler = do
diff --git a/project_template/default/foo.cabal
b/project_template/default/foo.cabal
index d8bf44c..5f8a96e 100644
--- a/project_template/default/foo.cabal
+++ b/project_template/default/foo.cabal
@@ -25,15 +25,15 @@ Executable projname
Build-depends:
base >= 4 && < 5,
bytestring >= 0.9.1 && < 0.10,
- heist >= 0.4 && < 0.5,
- hexpat >= 0.19 && < 0.20,
+ heist >= 0.5 && < 0.6,
MonadCatchIO-transformers >= 0.2.1 && < 0.3,
mtl >= 2 && < 3,
snap == 0.4.*,
snap-core == 0.4.*,
snap-server == 0.4.*,
text >= 0.11 && < 0.12,
- time >= 1.1 && < 1.3
+ time >= 1.1 && < 1.3,
+ xmlhtml == 0.1.*
extensions: TypeSynonymInstances MultiParamTypeClasses
diff --git a/project_template/default/resources/templates/echo.tpl
b/project_template/default/resources/templates/echo.tpl
index a9a3181..16f28c3 100644
--- a/project_template/default/resources/templates/echo.tpl
+++ b/project_template/default/resources/templates/echo.tpl
@@ -1,5 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html>
<head>
<title>Echo Page</title>
</head>
diff --git a/project_template/default/resources/templates/index.tpl
b/project_template/default/resources/templates/index.tpl
index 0296db3..2df8732 100644
--- a/project_template/default/resources/templates/index.tpl
+++ b/project_template/default/resources/templates/index.tpl
@@ -1,5 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html>
<head>
<title>Snap web server</title>
<link rel="stylesheet" type="text/css" href="screen.css"/>
diff --git a/project_template/default/src/Site.hs
b/project_template/default/src/Site.hs
index b59f647..fdc270a 100644
--- a/project_template/default/src/Site.hs
+++ b/project_template/default/src/Site.hs
@@ -13,6 +13,7 @@ module Site
import Control.Applicative
import Data.Maybe
+import qualified Data.Text.Encoding as T
import Snap.Extension.Heist
import Snap.Extension.Timer
import Snap.Util.FileServe
@@ -42,7 +43,7 @@ index = ifTop $ heistLocal (bindSplices indexSplices) $
render "index"
echo :: Application ()
echo = do
message <- decodedParam "stuff"
- heistLocal (bindString "message" message) $ render "echo"
+ heistLocal (bindString "message" (T.decodeUtf8 message)) $ render "echo"
where
decodedParam p = fromMaybe "" <$> getParam p
@@ -53,4 +54,4 @@ site :: Application ()
site = route [ ("/", index)
, ("/echo/:stuff", echo)
]
- <|> fileServe "resources/static"
+ <|> serveDirectory "resources/static"
diff --git a/project_template/default/src/Snap/Extension/Timer.hs
b/project_template/default/src/Snap/Extension/Timer.hs
index 75ea4ee..55e0ba0 100644
--- a/project_template/default/src/Snap/Extension/Timer.hs
+++ b/project_template/default/src/Snap/Extension/Timer.hs
@@ -25,10 +25,9 @@ module Snap.Extension.Timer
import Control.Monad.Trans
import Data.Time.Clock
import qualified Data.Text as T
-import Data.Text.Encoding
import Snap.Types
import Text.Templating.Heist
-import Text.XML.Expat.Tree hiding (Node)
+import Text.XmlHtml
------------------------------------------------------------------------------
@@ -43,7 +42,7 @@ class MonadSnap m => MonadTimer m where
startTimeSplice :: MonadTimer m => Splice m
startTimeSplice = do
time <- lift startTime
- return $ [mkText $ encodeUtf8 $ T.pack $ show $ time]
+ return $ [TextNode $ T.pack $ show $ time]
------------------------------------------------------------------------------
@@ -51,4 +50,4 @@ startTimeSplice = do
currentTimeSplice :: MonadTimer m => Splice m
currentTimeSplice = do
time <- lift $ liftIO getCurrentTime
- return $ [mkText $ encodeUtf8 $ T.pack $ show $ time]
+ return $ [TextNode $ T.pack $ show $ time]
-----------------------------------------------------------------------
hooks/post-receive
--
snap
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap