conduit 0.5
This commit is contained in:
parent
0e0880dfe4
commit
ebc737a5cb
@ -1,5 +1,5 @@
|
|||||||
name: yesod-auth
|
name: yesod-auth
|
||||||
version: 1.0.2.1
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman, Patrick Brisbin
|
author: Michael Snoyman, Patrick Brisbin
|
||||||
@ -12,44 +12,34 @@ build-type: Simple
|
|||||||
homepage: http://www.yesodweb.com/
|
homepage: http://www.yesodweb.com/
|
||||||
description: Authentication for Yesod.
|
description: Authentication for Yesod.
|
||||||
|
|
||||||
flag blaze_html_0_5
|
|
||||||
description: use blaze-html 0.5 and blaze-markup 0.5
|
|
||||||
default: True
|
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, authenticate >= 1.2.1 && < 1.3
|
, authenticate >= 1.3 && < 1.4
|
||||||
, bytestring >= 0.9.1.4
|
, bytestring >= 0.9.1.4
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, template-haskell
|
, template-haskell
|
||||||
, pureMD5 >= 2.0 && < 2.2
|
, pureMD5 >= 2.0 && < 2.2
|
||||||
, random >= 1.0.0.2 && < 1.1
|
, random >= 1.0.0.2 && < 1.1
|
||||||
, text >= 0.7 && < 0.12
|
, text >= 0.7 && < 0.12
|
||||||
, mime-mail >= 0.3 && < 0.5
|
, mime-mail >= 0.3 && < 0.5
|
||||||
, yesod-persistent >= 1.0 && < 1.1
|
, yesod-persistent >= 1.1 && < 1.2
|
||||||
, hamlet >= 1.0 && < 1.1
|
, hamlet >= 1.0 && < 1.1
|
||||||
, shakespeare-css >= 1.0 && < 1.1
|
, shakespeare-css >= 1.0 && < 1.1
|
||||||
, yesod-json >= 1.0 && < 1.1
|
, yesod-json >= 1.1 && < 1.2
|
||||||
, containers
|
, containers
|
||||||
, unordered-containers
|
, unordered-containers
|
||||||
, yesod-form >= 1.0 && < 1.1
|
, yesod-form >= 1.1 && < 1.2
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
, persistent >= 0.9 && < 0.10
|
, persistent >= 1.0 && < 1.1
|
||||||
, persistent-template >= 0.9 && < 0.10
|
, persistent-template >= 1.0 && < 1.1
|
||||||
, SHA >= 1.4.1.3 && < 1.6
|
, SHA >= 1.4.1.3 && < 1.6
|
||||||
, http-conduit >= 1.4.1.1 && < 1.5
|
, http-conduit >= 1.5 && < 1.6
|
||||||
, aeson >= 0.5
|
, aeson >= 0.5
|
||||||
, pwstore-fast >= 2.2 && < 3
|
, pwstore-fast >= 2.2 && < 3
|
||||||
, lifted-base >= 0.1 && < 0.2
|
, lifted-base >= 0.1 && < 0.2
|
||||||
|
, blaze-html >= 0.5 && < 0.6
|
||||||
if flag(blaze_html_0_5)
|
, blaze-markup >= 0.5.1 && < 0.6
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.5 && < 0.6
|
|
||||||
, blaze-markup >= 0.5.1 && < 0.6
|
|
||||||
else
|
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.4 && < 0.5
|
|
||||||
|
|
||||||
exposed-modules: Yesod.Auth
|
exposed-modules: Yesod.Auth
|
||||||
Yesod.Auth.BrowserId
|
Yesod.Auth.BrowserId
|
||||||
|
|||||||
@ -60,7 +60,7 @@ type Texts = [Text]
|
|||||||
-- is used for creating sites, /not/ subsites. See 'mkYesodSub' for the latter.
|
-- is used for creating sites, /not/ subsites. See 'mkYesodSub' for the latter.
|
||||||
-- Use 'parseRoutes' to create the 'Resource's.
|
-- Use 'parseRoutes' to create the 'Resource's.
|
||||||
mkYesod :: String -- ^ name of the argument datatype
|
mkYesod :: String -- ^ name of the argument datatype
|
||||||
-> [Resource String]
|
-> [ResourceTree String]
|
||||||
-> Q [Dec]
|
-> Q [Dec]
|
||||||
mkYesod name = fmap (uncurry (++)) . mkYesodGeneral name [] [] False
|
mkYesod name = fmap (uncurry (++)) . mkYesodGeneral name [] [] False
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ mkYesod name = fmap (uncurry (++)) . mkYesodGeneral name [] [] False
|
|||||||
-- be embedded in other sites.
|
-- be embedded in other sites.
|
||||||
mkYesodSub :: String -- ^ name of the argument datatype
|
mkYesodSub :: String -- ^ name of the argument datatype
|
||||||
-> Cxt
|
-> Cxt
|
||||||
-> [Resource String]
|
-> [ResourceTree String]
|
||||||
-> Q [Dec]
|
-> Q [Dec]
|
||||||
mkYesodSub name clazzes =
|
mkYesodSub name clazzes =
|
||||||
fmap (uncurry (++)) . mkYesodGeneral name' rest clazzes True
|
fmap (uncurry (++)) . mkYesodGeneral name' rest clazzes True
|
||||||
@ -82,28 +82,28 @@ mkYesodSub name clazzes =
|
|||||||
-- your handlers elsewhere. For example, this is the only way to break up a
|
-- your handlers elsewhere. For example, this is the only way to break up a
|
||||||
-- monolithic file into smaller parts. Use this function, paired with
|
-- monolithic file into smaller parts. Use this function, paired with
|
||||||
-- 'mkYesodDispatch', to do just that.
|
-- 'mkYesodDispatch', to do just that.
|
||||||
mkYesodData :: String -> [Resource String] -> Q [Dec]
|
mkYesodData :: String -> [ResourceTree String] -> Q [Dec]
|
||||||
mkYesodData name res = mkYesodDataGeneral name [] False res
|
mkYesodData name res = mkYesodDataGeneral name [] False res
|
||||||
|
|
||||||
mkYesodSubData :: String -> Cxt -> [Resource String] -> Q [Dec]
|
mkYesodSubData :: String -> Cxt -> [ResourceTree String] -> Q [Dec]
|
||||||
mkYesodSubData name clazzes res = mkYesodDataGeneral name clazzes True res
|
mkYesodSubData name clazzes res = mkYesodDataGeneral name clazzes True res
|
||||||
|
|
||||||
mkYesodDataGeneral :: String -> Cxt -> Bool -> [Resource String] -> Q [Dec]
|
mkYesodDataGeneral :: String -> Cxt -> Bool -> [ResourceTree String] -> Q [Dec]
|
||||||
mkYesodDataGeneral name clazzes isSub res = do
|
mkYesodDataGeneral name clazzes isSub res = do
|
||||||
let (name':rest) = words name
|
let (name':rest) = words name
|
||||||
(x, _) <- mkYesodGeneral name' rest clazzes isSub res
|
(x, _) <- mkYesodGeneral name' rest clazzes isSub res
|
||||||
let rname = mkName $ "resources" ++ name
|
let rname = mkName $ "resources" ++ name
|
||||||
eres <- lift res
|
eres <- lift res
|
||||||
let y = [ SigD rname $ ListT `AppT` (ConT ''Resource `AppT` ConT ''String)
|
let y = [ SigD rname $ ListT `AppT` (ConT ''ResourceTree `AppT` ConT ''String)
|
||||||
, FunD rname [Clause [] (NormalB eres) []]
|
, FunD rname [Clause [] (NormalB eres) []]
|
||||||
]
|
]
|
||||||
return $ x ++ y
|
return $ x ++ y
|
||||||
|
|
||||||
-- | See 'mkYesodData'.
|
-- | See 'mkYesodData'.
|
||||||
mkYesodDispatch :: String -> [Resource String] -> Q [Dec]
|
mkYesodDispatch :: String -> [ResourceTree String] -> Q [Dec]
|
||||||
mkYesodDispatch name = fmap snd . mkYesodGeneral name [] [] False
|
mkYesodDispatch name = fmap snd . mkYesodGeneral name [] [] False
|
||||||
|
|
||||||
mkYesodSubDispatch :: String -> Cxt -> [Resource String] -> Q [Dec]
|
mkYesodSubDispatch :: String -> Cxt -> [ResourceTree String] -> Q [Dec]
|
||||||
mkYesodSubDispatch name clazzes = fmap snd . mkYesodGeneral name' rest clazzes True
|
mkYesodSubDispatch name clazzes = fmap snd . mkYesodGeneral name' rest clazzes True
|
||||||
where (name':rest) = words name
|
where (name':rest) = words name
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ mkYesodGeneral :: String -- ^ foundation type
|
|||||||
-> [String]
|
-> [String]
|
||||||
-> Cxt -- ^ classes
|
-> Cxt -- ^ classes
|
||||||
-> Bool -- ^ is subsite?
|
-> Bool -- ^ is subsite?
|
||||||
-> [Resource String]
|
-> [ResourceTree String]
|
||||||
-> Q ([Dec], [Dec])
|
-> Q ([Dec], [Dec])
|
||||||
mkYesodGeneral name args clazzes isSub resS = do
|
mkYesodGeneral name args clazzes isSub resS = do
|
||||||
let args' = map mkName args
|
let args' = map mkName args
|
||||||
@ -130,7 +130,7 @@ mkYesodGeneral name args clazzes isSub resS = do
|
|||||||
let yesodDispatch' =
|
let yesodDispatch' =
|
||||||
InstanceD ctx ytyp [FunD (mkName "yesodDispatch") [disp]]
|
InstanceD ctx ytyp [FunD (mkName "yesodDispatch") [disp]]
|
||||||
|
|
||||||
return (renderRouteDec : masterTypSyns, [yesodDispatch'])
|
return (renderRouteDec ++ masterTypSyns, [yesodDispatch'])
|
||||||
where
|
where
|
||||||
name' = mkName name
|
name' = mkName name
|
||||||
masterTypSyns
|
masterTypSyns
|
||||||
|
|||||||
@ -333,7 +333,7 @@ runRequestBody = do
|
|||||||
|
|
||||||
rbHelper :: W.Request -> ResourceT IO RequestBodyContents
|
rbHelper :: W.Request -> ResourceT IO RequestBodyContents
|
||||||
rbHelper req =
|
rbHelper req =
|
||||||
(map fix1 *** map fix2) <$> (NWP.parseRequestBody NWP.lbsBackEnd req)
|
(map fix1 *** map fix2) <$> (NWP.parseRequestBody NWP.lbsSink req) -- FIXME allow control over which backend to use
|
||||||
where
|
where
|
||||||
fix1 = go *** go
|
fix1 = go *** go
|
||||||
fix2 (x, NWP.FileInfo a b c) =
|
fix2 (x, NWP.FileInfo a b c) =
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-core
|
name: yesod-core
|
||||||
version: 1.0.1.2
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -40,10 +40,6 @@ flag test
|
|||||||
description: Build the executable to run unit tests
|
description: Build the executable to run unit tests
|
||||||
default: False
|
default: False
|
||||||
|
|
||||||
flag blaze_html_0_5
|
|
||||||
description: use blaze-html 0.5 and blaze-markup 0.5
|
|
||||||
default: True
|
|
||||||
|
|
||||||
library
|
library
|
||||||
-- Work around a bug in cabal. Without this, wai-test doesn't get built and
|
-- Work around a bug in cabal. Without this, wai-test doesn't get built and
|
||||||
-- we have a missing dependency during --enable-tests builds.
|
-- we have a missing dependency during --enable-tests builds.
|
||||||
@ -52,9 +48,9 @@ library
|
|||||||
|
|
||||||
build-depends: base >= 4.3 && < 5
|
build-depends: base >= 4.3 && < 5
|
||||||
, time >= 1.1.4
|
, time >= 1.1.4
|
||||||
, yesod-routes >= 1.0 && < 1.1
|
, yesod-routes >= 1.1 && < 1.2
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, wai-extra >= 1.2 && < 1.3
|
, wai-extra >= 1.3 && < 1.4
|
||||||
, bytestring >= 0.9.1.4
|
, bytestring >= 0.9.1.4
|
||||||
, text >= 0.7 && < 0.12
|
, text >= 0.7 && < 0.12
|
||||||
, template-haskell
|
, template-haskell
|
||||||
@ -83,17 +79,11 @@ library
|
|||||||
, aeson >= 0.5
|
, aeson >= 0.5
|
||||||
, fast-logger >= 0.0.2
|
, fast-logger >= 0.0.2
|
||||||
, wai-logger >= 0.0.1
|
, wai-logger >= 0.0.1
|
||||||
, conduit >= 0.4 && < 0.5
|
, conduit >= 0.5 && < 0.6
|
||||||
, resourcet >= 0.3 && < 0.4
|
, resourcet >= 0.3 && < 0.4
|
||||||
, lifted-base >= 0.1 && < 0.2
|
, lifted-base >= 0.1 && < 0.2
|
||||||
|
, blaze-html >= 0.5 && < 0.6
|
||||||
if flag(blaze_html_0_5)
|
, blaze-markup >= 0.5.1 && < 0.6
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.5 && < 0.6
|
|
||||||
, blaze-markup >= 0.5.1 && < 0.6
|
|
||||||
else
|
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.4 && < 0.5
|
|
||||||
|
|
||||||
exposed-modules: Yesod.Content
|
exposed-modules: Yesod.Content
|
||||||
Yesod.Core
|
Yesod.Core
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-default
|
name: yesod-default
|
||||||
version: 1.0.1.1
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Patrick Brisbin
|
author: Patrick Brisbin
|
||||||
@ -18,10 +18,10 @@ library
|
|||||||
cpp-options: -DWINDOWS
|
cpp-options: -DWINDOWS
|
||||||
|
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, warp >= 1.2 && < 1.3
|
, warp >= 1.3 && < 1.4
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, wai-extra >= 1.2 && < 1.3
|
, wai-extra >= 1.3 && < 1.4
|
||||||
, bytestring >= 0.9.1.4
|
, bytestring >= 0.9.1.4
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
, text >= 0.9
|
, text >= 0.9
|
||||||
@ -29,8 +29,8 @@ library
|
|||||||
, shakespeare-css >= 1.0 && < 1.1
|
, shakespeare-css >= 1.0 && < 1.1
|
||||||
, shakespeare-js >= 1.0 && < 1.1
|
, shakespeare-js >= 1.0 && < 1.1
|
||||||
, template-haskell
|
, template-haskell
|
||||||
, yaml >= 0.7 && < 0.8
|
, yaml >= 0.8 && < 0.9
|
||||||
, network-conduit >= 0.4 && < 0.5
|
, network-conduit >= 0.5 && < 0.6
|
||||||
, unordered-containers
|
, unordered-containers
|
||||||
|
|
||||||
if !os(windows)
|
if !os(windows)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-form
|
name: yesod-form
|
||||||
version: 1.0.0.4
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -12,19 +12,15 @@ build-type: Simple
|
|||||||
homepage: http://www.yesodweb.com/
|
homepage: http://www.yesodweb.com/
|
||||||
description: Form handling support for Yesod Web Framework
|
description: Form handling support for Yesod Web Framework
|
||||||
|
|
||||||
flag blaze_html_0_5
|
|
||||||
description: use blaze-html 0.5 and blaze-markup 0.5
|
|
||||||
default: True
|
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, yesod-persistent >= 1.0 && < 1.1
|
, yesod-persistent >= 1.1 && < 1.2
|
||||||
, time >= 1.1.4
|
, time >= 1.1.4
|
||||||
, hamlet >= 1.0 && < 1.1
|
, hamlet >= 1.0 && < 1.1
|
||||||
, shakespeare-css >= 1.0 && < 1.1
|
, shakespeare-css >= 1.0 && < 1.1
|
||||||
, shakespeare-js >= 1.0 && < 1.1
|
, shakespeare-js >= 1.0 && < 1.1
|
||||||
, persistent >= 0.9 && < 0.10
|
, persistent >= 1.0 && < 1.1
|
||||||
, template-haskell
|
, template-haskell
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
, data-default >= 0.3 && < 0.5
|
, data-default >= 0.3 && < 0.5
|
||||||
@ -34,16 +30,10 @@ library
|
|||||||
, email-validate >= 0.2.6 && < 0.3
|
, email-validate >= 0.2.6 && < 0.3
|
||||||
, bytestring >= 0.9.1.4
|
, bytestring >= 0.9.1.4
|
||||||
, text >= 0.9 && < 1.0
|
, text >= 0.9 && < 1.0
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, containers >= 0.2
|
, containers >= 0.2
|
||||||
|
, blaze-html >= 0.5 && < 0.6
|
||||||
if flag(blaze_html_0_5)
|
, blaze-markup >= 0.5.1 && < 0.6
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.5 && < 0.6
|
|
||||||
, blaze-markup >= 0.5.1 && < 0.6
|
|
||||||
else
|
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.4 && < 0.5
|
|
||||||
|
|
||||||
exposed-modules: Yesod.Form
|
exposed-modules: Yesod.Form
|
||||||
Yesod.Form.Class
|
Yesod.Form.Class
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-json
|
name: yesod-json
|
||||||
version: 1.0.0.1
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -14,19 +14,19 @@ description: Generate content for Yesod using the aeson package.
|
|||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, yesod-routes >= 1.0 && < 1.1
|
, yesod-routes >= 1.1 && < 1.2
|
||||||
, aeson >= 0.5
|
, aeson >= 0.5
|
||||||
, text >= 0.8 && < 1.0
|
, text >= 0.8 && < 1.0
|
||||||
, shakespeare-js >= 1.0 && < 1.1
|
, shakespeare-js >= 1.0 && < 1.1
|
||||||
, vector >= 0.9
|
, vector >= 0.9
|
||||||
, containers >= 0.2
|
, containers >= 0.2
|
||||||
, blaze-builder
|
, blaze-builder
|
||||||
, attoparsec-conduit >= 0.4 && < 0.5
|
, attoparsec-conduit >= 0.5 && < 0.6
|
||||||
, conduit >= 0.4 && < 0.5
|
, conduit >= 0.5 && < 0.6
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, wai-extra >= 1.2 && < 1.3
|
, wai-extra >= 1.3 && < 1.4
|
||||||
, bytestring >= 0.9
|
, bytestring >= 0.9
|
||||||
, safe >= 0.2 && < 0.4
|
, safe >= 0.2 && < 0.4
|
||||||
exposed-modules: Yesod.Json
|
exposed-modules: Yesod.Json
|
||||||
|
|||||||
@ -31,11 +31,8 @@ import qualified Data.ByteString.Char8 as S8
|
|||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import Data.Text.Lazy (toStrict)
|
import Data.Text.Lazy (toStrict)
|
||||||
import Text.XML
|
import Text.XML
|
||||||
#if MIN_VERSION_blaze_html(0, 5, 0)
|
|
||||||
import Text.Blaze.Html.Renderer.Text (renderHtml)
|
import Text.Blaze.Html.Renderer.Text (renderHtml)
|
||||||
#else
|
import qualified Data.Map as Map
|
||||||
import Text.Blaze.Renderer.Text (renderHtml)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
newtype RepAtom = RepAtom Content
|
newtype RepAtom = RepAtom Content
|
||||||
instance HasReps RepAtom where
|
instance HasReps RepAtom where
|
||||||
@ -55,21 +52,21 @@ template Feed {..} render =
|
|||||||
addNS' n = n
|
addNS' n = n
|
||||||
namespace = "http://www.w3.org/2005/Atom"
|
namespace = "http://www.w3.org/2005/Atom"
|
||||||
|
|
||||||
root = Element "feed" [] $ map NodeElement
|
root = Element "feed" Map.empty $ map NodeElement
|
||||||
$ Element "title" [] [NodeContent feedTitle]
|
$ Element "title" Map.empty [NodeContent feedTitle]
|
||||||
: Element "link" [("rel", "self"), ("href", render feedLinkSelf)] []
|
: Element "link" (Map.fromList [("rel", "self"), ("href", render feedLinkSelf)]) []
|
||||||
: Element "link" [("href", render feedLinkHome)] []
|
: Element "link" (Map.singleton "href" $ render feedLinkHome) []
|
||||||
: Element "updated" [] [NodeContent $ formatW3 feedUpdated]
|
: Element "updated" Map.empty [NodeContent $ formatW3 feedUpdated]
|
||||||
: Element "id" [] [NodeContent $ render feedLinkHome]
|
: Element "id" Map.empty [NodeContent $ render feedLinkHome]
|
||||||
: map (flip entryTemplate render) feedEntries
|
: map (flip entryTemplate render) feedEntries
|
||||||
|
|
||||||
entryTemplate :: FeedEntry url -> (url -> Text) -> Element
|
entryTemplate :: FeedEntry url -> (url -> Text) -> Element
|
||||||
entryTemplate FeedEntry {..} render = Element "entry" [] $ map NodeElement
|
entryTemplate FeedEntry {..} render = Element "entry" Map.empty $ map NodeElement
|
||||||
[ Element "id" [] [NodeContent $ render feedEntryLink]
|
[ Element "id" Map.empty [NodeContent $ render feedEntryLink]
|
||||||
, Element "link" [("href", render feedEntryLink)] []
|
, Element "link" (Map.singleton "href" $ render feedEntryLink) []
|
||||||
, Element "updated" [] [NodeContent $ formatW3 feedEntryUpdated]
|
, Element "updated" Map.empty [NodeContent $ formatW3 feedEntryUpdated]
|
||||||
, Element "title" [] [NodeContent feedEntryTitle]
|
, Element "title" Map.empty [NodeContent feedEntryTitle]
|
||||||
, Element "content" [("type", "html")] [NodeContent $ toStrict $ renderHtml feedEntryContent]
|
, Element "content" (Map.singleton "type" "html") [NodeContent $ toStrict $ renderHtml feedEntryContent]
|
||||||
]
|
]
|
||||||
|
|
||||||
-- | Generates a link tag in the head of a widget.
|
-- | Generates a link tag in the head of a widget.
|
||||||
|
|||||||
@ -27,11 +27,8 @@ import qualified Data.ByteString.Char8 as S8
|
|||||||
import Data.Text (Text, pack)
|
import Data.Text (Text, pack)
|
||||||
import Data.Text.Lazy (toStrict)
|
import Data.Text.Lazy (toStrict)
|
||||||
import Text.XML
|
import Text.XML
|
||||||
#if MIN_VERSION_blaze_html(0, 5, 0)
|
|
||||||
import Text.Blaze.Html.Renderer.Text (renderHtml)
|
import Text.Blaze.Html.Renderer.Text (renderHtml)
|
||||||
#else
|
import qualified Data.Map as Map
|
||||||
import Text.Blaze.Renderer.Text (renderHtml)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
newtype RepRss = RepRss Content
|
newtype RepRss = RepRss Content
|
||||||
instance HasReps RepRss where
|
instance HasReps RepRss where
|
||||||
@ -47,26 +44,26 @@ template :: Feed url -> (url -> Text) -> Document
|
|||||||
template Feed {..} render =
|
template Feed {..} render =
|
||||||
Document (Prologue [] Nothing []) root []
|
Document (Prologue [] Nothing []) root []
|
||||||
where
|
where
|
||||||
root = Element "rss" [("version", "2.0")] $ return $ NodeElement $ Element "channel" [] $ map NodeElement
|
root = Element "rss" (Map.singleton "version" "2.0") $ return $ NodeElement $ Element "channel" Map.empty $ map NodeElement
|
||||||
$ Element "{http://www.w3.org/2005/Atom}link"
|
$ Element "{http://www.w3.org/2005/Atom}link" (Map.fromList
|
||||||
[ ("href", render feedLinkSelf)
|
[ ("href", render feedLinkSelf)
|
||||||
, ("rel", "self")
|
, ("rel", "self")
|
||||||
, ("type", pack $ S8.unpack typeRss)
|
, ("type", pack $ S8.unpack typeRss)
|
||||||
] []
|
]) []
|
||||||
: Element "title" [] [NodeContent feedTitle]
|
: Element "title" Map.empty [NodeContent feedTitle]
|
||||||
: Element "link" [] [NodeContent $ render feedLinkHome]
|
: Element "link" Map.empty [NodeContent $ render feedLinkHome]
|
||||||
: Element "description" [] [NodeContent $ toStrict $ renderHtml feedDescription]
|
: Element "description" Map.empty [NodeContent $ toStrict $ renderHtml feedDescription]
|
||||||
: Element "lastBuildDate" [] [NodeContent $ formatRFC822 feedUpdated]
|
: Element "lastBuildDate" Map.empty [NodeContent $ formatRFC822 feedUpdated]
|
||||||
: Element "language" [] [NodeContent feedLanguage]
|
: Element "language" Map.empty [NodeContent feedLanguage]
|
||||||
: map (flip entryTemplate render) feedEntries
|
: map (flip entryTemplate render) feedEntries
|
||||||
|
|
||||||
entryTemplate :: FeedEntry url -> (url -> Text) -> Element
|
entryTemplate :: FeedEntry url -> (url -> Text) -> Element
|
||||||
entryTemplate FeedEntry {..} render = Element "item" [] $ map NodeElement
|
entryTemplate FeedEntry {..} render = Element "item" Map.empty $ map NodeElement
|
||||||
[ Element "title" [] [NodeContent feedEntryTitle]
|
[ Element "title" Map.empty [NodeContent feedEntryTitle]
|
||||||
, Element "link" [] [NodeContent $ render feedEntryLink]
|
, Element "link" Map.empty [NodeContent $ render feedEntryLink]
|
||||||
, Element "guid" [] [NodeContent $ render feedEntryLink]
|
, Element "guid" Map.empty [NodeContent $ render feedEntryLink]
|
||||||
, Element "pubDate" [] [NodeContent $ formatRFC822 feedEntryUpdated]
|
, Element "pubDate" Map.empty [NodeContent $ formatRFC822 feedEntryUpdated]
|
||||||
, Element "description" [] [NodeContent $ toStrict $ renderHtml feedEntryContent]
|
, Element "description" Map.empty [NodeContent $ toStrict $ renderHtml feedEntryContent]
|
||||||
]
|
]
|
||||||
|
|
||||||
-- | Generates a link tag in the head of a widget.
|
-- | Generates a link tag in the head of a widget.
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-newsfeed
|
name: yesod-newsfeed
|
||||||
version: 1.0.0.2
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman, Patrick Brisbin
|
author: Michael Snoyman, Patrick Brisbin
|
||||||
@ -12,26 +12,17 @@ build-type: Simple
|
|||||||
homepage: http://www.yesodweb.com/
|
homepage: http://www.yesodweb.com/
|
||||||
description: Helper functions and data types for producing News feeds.
|
description: Helper functions and data types for producing News feeds.
|
||||||
|
|
||||||
flag blaze_html_0_5
|
|
||||||
description: use blaze-html 0.5 and blaze-markup 0.5
|
|
||||||
default: True
|
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, time >= 1.1.4
|
, time >= 1.1.4
|
||||||
, hamlet >= 1.0 && < 1.1
|
, hamlet >= 1.0 && < 1.1
|
||||||
, bytestring >= 0.9.1.4
|
, bytestring >= 0.9.1.4
|
||||||
, text >= 0.9 && < 0.12
|
, text >= 0.9 && < 0.12
|
||||||
, xml-conduit >= 0.7 && < 0.8
|
, xml-conduit >= 0.8 && < 0.9
|
||||||
|
, blaze-html >= 0.5 && < 0.6
|
||||||
if flag(blaze_html_0_5)
|
, blaze-markup >= 0.5.1 && < 0.6
|
||||||
build-depends:
|
, containers
|
||||||
blaze-html >= 0.5 && < 0.6
|
|
||||||
, blaze-markup >= 0.5.1 && < 0.6
|
|
||||||
else
|
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.4 && < 0.5
|
|
||||||
|
|
||||||
exposed-modules: Yesod.AtomFeed
|
exposed-modules: Yesod.AtomFeed
|
||||||
, Yesod.RssFeed
|
, Yesod.RssFeed
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-persistent
|
name: yesod-persistent
|
||||||
version: 1.0.0.1
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -14,9 +14,9 @@ description: Some helpers for using Persistent from Yesod.
|
|||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, persistent >= 0.9 && < 0.10
|
, persistent >= 1.0 && < 1.1
|
||||||
, persistent-template >= 0.9 && < 0.10
|
, persistent-template >= 1.0 && < 1.1
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
exposed-modules: Yesod.Persist
|
exposed-modules: Yesod.Persist
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|||||||
@ -77,9 +77,9 @@ mkRenderRouteClauses =
|
|||||||
|
|
||||||
colon <- [|(:)|]
|
colon <- [|(:)|]
|
||||||
let cons y ys = InfixE (Just y) colon (Just ys)
|
let cons y ys = InfixE (Just y) colon (Just ys)
|
||||||
let pieces = foldr cons (VarE a) piecesSingle
|
let pieces' = foldr cons (VarE a) piecesSingle
|
||||||
|
|
||||||
let body = LamE [TupP [VarP a, VarP b]] (TupE [pieces, VarE b]) `AppE` (rr `AppE` VarE child)
|
let body = LamE [TupP [VarP a, VarP b]] (TupE [pieces', VarE b]) `AppE` (rr `AppE` VarE child)
|
||||||
|
|
||||||
return $ Clause [pat] (NormalB body) [FunD childRender childClauses]
|
return $ Clause [pat] (NormalB body) [FunD childRender childClauses]
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-routes
|
name: yesod-routes
|
||||||
version: 1.0.1.2
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
@ -30,6 +30,7 @@ import Data.Time (UTCTime)
|
|||||||
import Data.Monoid (mappend)
|
import Data.Monoid (mappend)
|
||||||
import Text.XML
|
import Text.XML
|
||||||
import Data.Text (Text, pack)
|
import Data.Text (Text, pack)
|
||||||
|
import qualified Data.Map as Map
|
||||||
|
|
||||||
data SitemapChangeFreq = Always
|
data SitemapChangeFreq = Always
|
||||||
| Hourly
|
| Hourly
|
||||||
@ -66,13 +67,13 @@ template urls render =
|
|||||||
addNS' n = n
|
addNS' n = n
|
||||||
namespace = "http://www.sitemaps.org/schemas/sitemap/0.9"
|
namespace = "http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||||
|
|
||||||
root = Element "urlset" [] $ map go urls
|
root = Element "urlset" Map.empty $ map go urls
|
||||||
|
|
||||||
go SitemapUrl {..} = NodeElement $ Element "url" [] $ map NodeElement
|
go SitemapUrl {..} = NodeElement $ Element "url" Map.empty $ map NodeElement
|
||||||
[ Element "loc" [] [NodeContent $ render sitemapLoc]
|
[ Element "loc" Map.empty [NodeContent $ render sitemapLoc]
|
||||||
, Element "lastmod" [] [NodeContent $ formatW3 sitemapLastMod]
|
, Element "lastmod" Map.empty [NodeContent $ formatW3 sitemapLastMod]
|
||||||
, Element "changefreq" [] [NodeContent $ showFreq sitemapChangeFreq]
|
, Element "changefreq" Map.empty [NodeContent $ showFreq sitemapChangeFreq]
|
||||||
, Element "priority" [] [NodeContent $ pack $ show sitemapPriority]
|
, Element "priority" Map.empty [NodeContent $ pack $ show sitemapPriority]
|
||||||
]
|
]
|
||||||
|
|
||||||
sitemap :: [SitemapUrl (Route master)] -> GHandler sub master RepXml
|
sitemap :: [SitemapUrl (Route master)] -> GHandler sub master RepXml
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-sitemap
|
name: yesod-sitemap
|
||||||
version: 1.0.0.1
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -14,10 +14,11 @@ description: Generate XML sitemaps.
|
|||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, time >= 1.1.4
|
, time >= 1.1.4
|
||||||
, xml-conduit >= 0.7 && < 0.8
|
, xml-conduit >= 0.8 && < 0.9
|
||||||
, text
|
, text
|
||||||
|
, containers
|
||||||
exposed-modules: Yesod.Sitemap
|
exposed-modules: Yesod.Sitemap
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|
||||||
|
|||||||
@ -78,19 +78,15 @@ import System.Posix.Types (EpochTime)
|
|||||||
import Data.Conduit (($$))
|
import Data.Conduit (($$))
|
||||||
import Data.Conduit.List (sourceList)
|
import Data.Conduit.List (sourceList)
|
||||||
import Data.Functor.Identity (runIdentity)
|
import Data.Functor.Identity (runIdentity)
|
||||||
|
import qualified Filesystem.Path.CurrentOS as F
|
||||||
|
|
||||||
import Network.Wai.Application.Static
|
import Network.Wai.Application.Static
|
||||||
( StaticSettings (..)
|
( StaticSettings (..)
|
||||||
, defaultWebAppSettings
|
|
||||||
, staticApp
|
, staticApp
|
||||||
, embeddedLookup
|
|
||||||
, toEmbedded
|
|
||||||
, toFilePath
|
|
||||||
, fromFilePath
|
|
||||||
, FilePath
|
|
||||||
, ETagLookup
|
|
||||||
, webAppSettingsWithLookup
|
, webAppSettingsWithLookup
|
||||||
|
, embeddedSettings
|
||||||
)
|
)
|
||||||
|
import WaiAppStatic.Storage.Filesystem (ETagLookup)
|
||||||
|
|
||||||
-- | Type used for the subsite with static contents.
|
-- | Type used for the subsite with static contents.
|
||||||
newtype Static = Static StaticSettings
|
newtype Static = Static StaticSettings
|
||||||
@ -106,7 +102,7 @@ type StaticRoute = Route Static
|
|||||||
static :: Prelude.FilePath -> IO Static
|
static :: Prelude.FilePath -> IO Static
|
||||||
static dir = do
|
static dir = do
|
||||||
hashLookup <- cachedETagLookup dir
|
hashLookup <- cachedETagLookup dir
|
||||||
return $ Static $ webAppSettingsWithLookup (toFilePath dir) hashLookup
|
return $ Static $ webAppSettingsWithLookup (F.decodeString dir) hashLookup
|
||||||
|
|
||||||
-- | Same as 'static', but does not assumes that the files do not
|
-- | Same as 'static', but does not assumes that the files do not
|
||||||
-- change and checks their modification time whenever a request
|
-- change and checks their modification time whenever a request
|
||||||
@ -114,15 +110,12 @@ static dir = do
|
|||||||
staticDevel :: Prelude.FilePath -> IO Static
|
staticDevel :: Prelude.FilePath -> IO Static
|
||||||
staticDevel dir = do
|
staticDevel dir = do
|
||||||
hashLookup <- cachedETagLookupDevel dir
|
hashLookup <- cachedETagLookupDevel dir
|
||||||
return $ Static $ webAppSettingsWithLookup (toFilePath dir) hashLookup
|
return $ Static $ webAppSettingsWithLookup (F.decodeString dir) hashLookup
|
||||||
|
|
||||||
-- | Produce a 'Static' based on embedding all of the static
|
-- | Produce a 'Static' based on embedding all of the static
|
||||||
-- files' contents in the executable at compile time.
|
-- files' contents in the executable at compile time.
|
||||||
embed :: Prelude.FilePath -> Q Exp
|
embed :: Prelude.FilePath -> Q Exp
|
||||||
embed fp =
|
embed fp = [|Static (embeddedSettings $(embedDir fp))|]
|
||||||
[|Static (defaultWebAppSettings
|
|
||||||
{ ssFolder = embeddedLookup (toEmbedded $(embedDir fp))
|
|
||||||
})|]
|
|
||||||
|
|
||||||
instance RenderRoute Static where
|
instance RenderRoute Static where
|
||||||
-- | A route on the static subsite (see also 'staticFiles').
|
-- | A route on the static subsite (see also 'staticFiles').
|
||||||
@ -226,18 +219,18 @@ publicFiles :: Prelude.FilePath -> Q [Dec]
|
|||||||
publicFiles dir = mkStaticFiles' dir "StaticRoute" False
|
publicFiles dir = mkStaticFiles' dir "StaticRoute" False
|
||||||
|
|
||||||
|
|
||||||
mkHashMap :: Prelude.FilePath -> IO (M.Map FilePath S8.ByteString)
|
mkHashMap :: Prelude.FilePath -> IO (M.Map F.FilePath S8.ByteString)
|
||||||
mkHashMap dir = do
|
mkHashMap dir = do
|
||||||
fs <- getFileListPieces dir
|
fs <- getFileListPieces dir
|
||||||
hashAlist fs >>= return . M.fromList
|
hashAlist fs >>= return . M.fromList
|
||||||
where
|
where
|
||||||
hashAlist :: [[String]] -> IO [(FilePath, S8.ByteString)]
|
hashAlist :: [[String]] -> IO [(F.FilePath, S8.ByteString)]
|
||||||
hashAlist fs = mapM hashPair fs
|
hashAlist fs = mapM hashPair fs
|
||||||
where
|
where
|
||||||
hashPair :: [String] -> IO (FilePath, S8.ByteString)
|
hashPair :: [String] -> IO (F.FilePath, S8.ByteString)
|
||||||
hashPair pieces = do let file = pathFromRawPieces dir pieces
|
hashPair pieces = do let file = pathFromRawPieces dir pieces
|
||||||
h <- base64md5File file
|
h <- base64md5File file
|
||||||
return (toFilePath file, S8.pack h)
|
return (F.decodeString file, S8.pack h)
|
||||||
|
|
||||||
pathFromRawPieces :: Prelude.FilePath -> [String] -> Prelude.FilePath
|
pathFromRawPieces :: Prelude.FilePath -> [String] -> Prelude.FilePath
|
||||||
pathFromRawPieces =
|
pathFromRawPieces =
|
||||||
@ -248,12 +241,12 @@ pathFromRawPieces =
|
|||||||
cachedETagLookupDevel :: Prelude.FilePath -> IO ETagLookup
|
cachedETagLookupDevel :: Prelude.FilePath -> IO ETagLookup
|
||||||
cachedETagLookupDevel dir = do
|
cachedETagLookupDevel dir = do
|
||||||
etags <- mkHashMap dir
|
etags <- mkHashMap dir
|
||||||
mtimeVar <- newIORef (M.empty :: M.Map FilePath EpochTime)
|
mtimeVar <- newIORef (M.empty :: M.Map F.FilePath EpochTime)
|
||||||
return $ \f ->
|
return $ \f ->
|
||||||
case M.lookup f etags of
|
case M.lookup f etags of
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
Just checksum -> do
|
Just checksum -> do
|
||||||
fs <- getFileStatus $ fromFilePath f
|
fs <- getFileStatus $ F.encodeString f
|
||||||
let newt = modificationTime fs
|
let newt = modificationTime fs
|
||||||
mtimes <- readIORef mtimeVar
|
mtimes <- readIORef mtimeVar
|
||||||
oldt <- case M.lookup f mtimes of
|
oldt <- case M.lookup f mtimes of
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-static
|
name: yesod-static
|
||||||
version: 1.0.0.3
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -19,22 +19,23 @@ library
|
|||||||
build-depends: base >= 4 && < 5
|
build-depends: base >= 4 && < 5
|
||||||
, containers >= 0.2
|
, containers >= 0.2
|
||||||
, old-time >= 1.0
|
, old-time >= 1.0
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, base64-bytestring >= 0.1.0.1 && < 0.2
|
, base64-bytestring >= 0.1.0.1 && < 0.2
|
||||||
, cereal >= 0.3 && < 0.4
|
, cereal >= 0.3 && < 0.4
|
||||||
, bytestring >= 0.9.1.4
|
, bytestring >= 0.9.1.4
|
||||||
, template-haskell
|
, template-haskell
|
||||||
, directory >= 1.0 && < 1.2
|
, directory >= 1.0 && < 1.2
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
, wai-app-static >= 1.2 && < 1.3
|
, wai-app-static >= 1.3 && < 1.4
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, text >= 0.9 && < 1.0
|
, text >= 0.9 && < 1.0
|
||||||
, file-embed >= 0.0.4.1 && < 0.5
|
, file-embed >= 0.0.4.1 && < 0.5
|
||||||
, http-types >= 0.6.5 && < 0.7
|
, http-types >= 0.6.5 && < 0.7
|
||||||
, unix-compat >= 0.2
|
, unix-compat >= 0.2
|
||||||
, conduit >= 0.4 && < 0.5
|
, conduit >= 0.5 && < 0.6
|
||||||
, crypto-conduit >= 0.3 && < 0.4
|
, crypto-conduit >= 0.4 && < 0.5
|
||||||
, cryptohash >= 0.6.1
|
, cryptohash >= 0.6.1
|
||||||
|
, system-filepath >= 0.4.6 && < 0.5
|
||||||
exposed-modules: Yesod.Static
|
exposed-modules: Yesod.Static
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|
||||||
@ -65,6 +66,7 @@ test-suite tests
|
|||||||
, conduit
|
, conduit
|
||||||
, crypto-conduit
|
, crypto-conduit
|
||||||
, cryptohash >= 0.6.1
|
, cryptohash >= 0.6.1
|
||||||
|
, system-filepath
|
||||||
|
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,6 @@ import Text.Blaze.Html.Renderer.String (renderHtml)
|
|||||||
import Text.Blaze (toHtml)
|
import Text.Blaze (toHtml)
|
||||||
import Text.Blaze.Renderer.String (renderHtml)
|
import Text.Blaze.Renderer.String (renderHtml)
|
||||||
#endif
|
#endif
|
||||||
import Text.XML.Xml2Html ()
|
|
||||||
|
|
||||||
type Query = T.Text
|
type Query = T.Text
|
||||||
type Html = L.ByteString
|
type Html = L.ByteString
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import Yesod.Test.HtmlParse
|
|||||||
import Text.XML
|
import Text.XML
|
||||||
|
|
||||||
import Data.ByteString.Lazy.Char8 ()
|
import Data.ByteString.Lazy.Char8 ()
|
||||||
|
import qualified Data.Map as Map
|
||||||
|
|
||||||
parseQuery_ = either error id . parseQuery
|
parseQuery_ = either error id . parseQuery
|
||||||
findBySelector_ x = either error id . findBySelector x
|
findBySelector_ x = either error id . findBySelector x
|
||||||
@ -33,13 +34,13 @@ main = hspecX $ do
|
|||||||
it "XHTML" $
|
it "XHTML" $
|
||||||
let html = "<html><head><title>foo</title></head><body><p>Hello World</p></body></html>"
|
let html = "<html><head><title>foo</title></head><body><p>Hello World</p></body></html>"
|
||||||
doc = Document (Prologue [] Nothing []) root []
|
doc = Document (Prologue [] Nothing []) root []
|
||||||
root = Element "html" []
|
root = Element "html" Map.empty
|
||||||
[ NodeElement $ Element "head" []
|
[ NodeElement $ Element "head" Map.empty
|
||||||
[ NodeElement $ Element "title" []
|
[ NodeElement $ Element "title" Map.empty
|
||||||
[NodeContent "foo"]
|
[NodeContent "foo"]
|
||||||
]
|
]
|
||||||
, NodeElement $ Element "body" []
|
, NodeElement $ Element "body" Map.empty
|
||||||
[ NodeElement $ Element "p" []
|
[ NodeElement $ Element "p" Map.empty
|
||||||
[NodeContent "Hello World"]
|
[NodeContent "Hello World"]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@ -47,14 +48,14 @@ main = hspecX $ do
|
|||||||
it "HTML" $
|
it "HTML" $
|
||||||
let html = "<html><head><title>foo</title></head><body><br><p>Hello World</p></body></html>"
|
let html = "<html><head><title>foo</title></head><body><br><p>Hello World</p></body></html>"
|
||||||
doc = Document (Prologue [] Nothing []) root []
|
doc = Document (Prologue [] Nothing []) root []
|
||||||
root = Element "html" []
|
root = Element "html" Map.empty
|
||||||
[ NodeElement $ Element "head" []
|
[ NodeElement $ Element "head" Map.empty
|
||||||
[ NodeElement $ Element "title" []
|
[ NodeElement $ Element "title" Map.empty
|
||||||
[NodeContent "foo"]
|
[NodeContent "foo"]
|
||||||
]
|
]
|
||||||
, NodeElement $ Element "body" []
|
, NodeElement $ Element "body" Map.empty
|
||||||
[ NodeElement $ Element "br" [] []
|
[ NodeElement $ Element "br" Map.empty []
|
||||||
, NodeElement $ Element "p" []
|
, NodeElement $ Element "p" Map.empty
|
||||||
[NodeContent "Hello World"]
|
[NodeContent "Hello World"]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-test
|
name: yesod-test
|
||||||
version: 0.2.0.6
|
version: 0.3.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Nubis <nubis@woobiz.com.ar>
|
author: Nubis <nubis@woobiz.com.ar>
|
||||||
@ -13,19 +13,14 @@ homepage: http://www.yesodweb.com
|
|||||||
description: Behaviour Oriented integration Testing for Yesod Applications
|
description: Behaviour Oriented integration Testing for Yesod Applications
|
||||||
extra-source-files: README.md, LICENSE, test/main.hs
|
extra-source-files: README.md, LICENSE, test/main.hs
|
||||||
|
|
||||||
flag blaze_html_0_5
|
|
||||||
description: use blaze-html 0.5 and blaze-markup 0.5
|
|
||||||
default: True
|
|
||||||
|
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4.3 && < 5
|
build-depends: base >= 4.3 && < 5
|
||||||
, hxt >= 9.1.6
|
, hxt >= 9.1.6
|
||||||
, attoparsec >= 0.10 && < 0.11
|
, attoparsec >= 0.10 && < 0.11
|
||||||
, persistent >= 0.9 && < 0.10
|
, persistent >= 1.0 && < 1.1
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, wai-test >= 1.2 && < 1.3
|
, wai-test >= 1.3 && < 1.4
|
||||||
, network >= 2.2 && < 2.4
|
, network >= 2.2 && < 2.4
|
||||||
, http-types >= 0.6 && < 0.7
|
, http-types >= 0.6 && < 0.7
|
||||||
, HUnit >= 1.2 && < 1.3
|
, HUnit >= 1.2 && < 1.3
|
||||||
@ -33,19 +28,12 @@ library
|
|||||||
, bytestring >= 0.9
|
, bytestring >= 0.9
|
||||||
, case-insensitive >= 0.2
|
, case-insensitive >= 0.2
|
||||||
, text
|
, text
|
||||||
, xml-conduit >= 0.7 && < 0.8
|
, xml-conduit >= 0.8 && < 0.9
|
||||||
, xml-types >= 0.3 && < 0.4
|
, xml-types >= 0.3 && < 0.4
|
||||||
, containers
|
, containers
|
||||||
, xml2html >= 0.1.2.3 && < 0.2
|
, html-conduit >= 0.1 && < 0.2
|
||||||
, html-conduit >= 0.0.1 && < 0.1
|
, blaze-html >= 0.5 && < 0.6
|
||||||
|
, blaze-markup >= 0.5.1 && < 0.6
|
||||||
if flag(blaze_html_0_5)
|
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.5 && < 0.6
|
|
||||||
, blaze-markup >= 0.5.1 && < 0.6
|
|
||||||
else
|
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.4 && < 0.5
|
|
||||||
|
|
||||||
exposed-modules: Yesod.Test
|
exposed-modules: Yesod.Test
|
||||||
Yesod.Test.CssQuery
|
Yesod.Test.CssQuery
|
||||||
@ -63,6 +51,7 @@ test-suite test
|
|||||||
, HUnit
|
, HUnit
|
||||||
, xml-conduit
|
, xml-conduit
|
||||||
, bytestring
|
, bytestring
|
||||||
|
, containers
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod
|
name: yesod
|
||||||
version: 1.0.1.6
|
version: 1.1.0
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
@ -62,34 +62,24 @@ extra-source-files:
|
|||||||
scaffold/config/mongoDB.yml.cg
|
scaffold/config/mongoDB.yml.cg
|
||||||
scaffold/devel.hs.cg
|
scaffold/devel.hs.cg
|
||||||
|
|
||||||
flag blaze_html_0_5
|
|
||||||
description: use blaze-html 0.5 and blaze-markup 0.5
|
|
||||||
default: True
|
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4.3 && < 5
|
build-depends: base >= 4.3 && < 5
|
||||||
, yesod-core >= 1.0 && < 1.1
|
, yesod-core >= 1.1 && < 1.2
|
||||||
, yesod-auth >= 1.0 && < 1.1
|
, yesod-auth >= 1.1 && < 1.2
|
||||||
, yesod-json >= 1.0 && < 1.1
|
, yesod-json >= 1.1 && < 1.2
|
||||||
, yesod-persistent >= 1.0 && < 1.1
|
, yesod-persistent >= 1.1 && < 1.2
|
||||||
, yesod-form >= 1.0 && < 1.1
|
, yesod-form >= 1.1 && < 1.2
|
||||||
, monad-control >= 0.3 && < 0.4
|
, monad-control >= 0.3 && < 0.4
|
||||||
, transformers >= 0.2.2 && < 0.4
|
, transformers >= 0.2.2 && < 0.4
|
||||||
, wai >= 1.2 && < 1.3
|
, wai >= 1.3 && < 1.4
|
||||||
, wai-extra >= 1.2 && < 1.3
|
, wai-extra >= 1.3 && < 1.4
|
||||||
, wai-logger >= 0.1.2
|
, wai-logger >= 0.1.2
|
||||||
, hamlet >= 1.0 && < 1.1
|
, hamlet >= 1.0 && < 1.1
|
||||||
, shakespeare-js >= 1.0 && < 1.1
|
, shakespeare-js >= 1.0 && < 1.1
|
||||||
, shakespeare-css >= 1.0 && < 1.1
|
, shakespeare-css >= 1.0 && < 1.1
|
||||||
, warp >= 1.2 && < 1.3
|
, warp >= 1.3 && < 1.4
|
||||||
|
, blaze-html >= 0.5 && < 0.6
|
||||||
if flag(blaze_html_0_5)
|
, blaze-markup >= 0.5.1 && < 0.6
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.5 && < 0.6
|
|
||||||
, blaze-markup >= 0.5.1 && < 0.6
|
|
||||||
else
|
|
||||||
build-depends:
|
|
||||||
blaze-html >= 0.4 && < 0.5
|
|
||||||
|
|
||||||
exposed-modules: Yesod
|
exposed-modules: Yesod
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user