From 667d8405a89557c0b5d1db8092c843015cafa896 Mon Sep 17 00:00:00 2001 From: Yann Esposito Date: Thu, 23 Aug 2012 14:22:56 +0300 Subject: [PATCH 1/5] Added example on AddHandler to avoid confusion I used the add-handler command of Yesod, and I found the sentences were too ambiguous. In order to avoid confusion, I just added some examples. ps: I tried to write "getCommentR" instead of just "GET" and it was transformed in getcommentrCommentR :(. --- yesod/AddHandler.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yesod/AddHandler.hs b/yesod/AddHandler.hs index accd9347..04ffc8cf 100644 --- a/yesod/AddHandler.hs +++ b/yesod/AddHandler.hs @@ -29,10 +29,10 @@ addHandler = do c:_ | isLower c -> error "Name must start with an upper case letter" | otherwise -> return () - putStr "Enter route pattern: " + putStr "Enter route pattern (ex: /entry/#EntryId): " hFlush stdout pattern <- getLine - putStr "Enter space-separated list of methods: " + putStr "Enter space-separated list of methods (ex: GET POST): " hFlush stdout methods <- getLine From 933ad50ac3ad7197a8c81bff67a792f59e4ecd9b Mon Sep 17 00:00:00 2001 From: Hiromi Ishii Date: Sat, 25 Aug 2012 14:54:59 +0900 Subject: [PATCH 2/5] caught up with yesod 1.1 --- yesod-auth-oauth/yesod-auth-oauth.cabal | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yesod-auth-oauth/yesod-auth-oauth.cabal b/yesod-auth-oauth/yesod-auth-oauth.cabal index e6be9e93..97992b24 100644 --- a/yesod-auth-oauth/yesod-auth-oauth.cabal +++ b/yesod-auth-oauth/yesod-auth-oauth.cabal @@ -1,5 +1,5 @@ name: yesod-auth-oauth -version: 1.0.0 +version: 1.1.0.0 license: BSD3 license-file: LICENSE author: Hiromi Ishii @@ -10,7 +10,7 @@ stability: Stable cabal-version: >= 1.6.0 build-type: Simple homepage: http://www.yesodweb.com/ -description: Authentication for Yesod. +description: Oauth Authentication for Yesod. flag ghc7 @@ -20,12 +20,12 @@ library cpp-options: -DGHC7 else build-depends: base >= 4 && < 4.3 - build-depends: authenticate-oauth >= 1.3 && < 1.4 + build-depends: authenticate-oauth >= 1.4 && < 1.5 , bytestring >= 0.9.1.4 && < 0.10 - , yesod-core >= 1.0 && < 1.1 - , yesod-auth >= 1.0 && < 1.1 + , yesod-core >= 1.1 && < 1.2 + , yesod-auth >= 1.1 && < 1.2 , text >= 0.7 && < 0.12 - , yesod-form >= 1.0 && < 1.1 + , yesod-form >= 1.1 && < 1.2 , transformers >= 0.2.2 && < 0.4 exposed-modules: Yesod.Auth.OAuth ghc-options: -Wall From 5b19865c7a002b33400ea0431e569cb8f945aaa3 Mon Sep 17 00:00:00 2001 From: Felipe Lessa Date: Mon, 27 Aug 2012 10:20:17 -0300 Subject: [PATCH 3/5] yesod-core: In handlerToIO, really avoid keeping old handler data in memory. --- yesod-core/Yesod/Handler.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yesod-core/Yesod/Handler.hs b/yesod-core/Yesod/Handler.hs index 811d8f54..f6314df7 100644 --- a/yesod-core/Yesod/Handler.hs +++ b/yesod-core/Yesod/Handler.hs @@ -438,6 +438,12 @@ handlerToIO = newWaiReq = oldWaiReq { W.requestBody = mempty } newReq = oldReq { reqWaiRequest = newWaiReq , reqBodySize = 0 } + clearedOldHandlerData = + oldHandlerData { handlerRequest = err "handlerRequest never here" + , handlerState = err "handlerState never here" } + where + err :: String -> a + err = error . ("handlerToIO: clearedOldHandlerData/" ++) newState <- liftIO $ do oldState <- I.readIORef (handlerState oldHandlerData) return $ oldState { ghsRBC = Nothing @@ -450,8 +456,9 @@ handlerToIO = -- The state IORef needs to be created here, otherwise it -- will be shared by different invocations of this function. newStateIORef <- I.newIORef newState - runResourceT $ f oldHandlerData { handlerRequest = newReq - , handlerState = newStateIORef } + runResourceT $ f clearedOldHandlerData + { handlerRequest = newReq + , handlerState = newStateIORef } -- | Function used internally by Yesod in the process of converting a From 0d95e6917d60d5f674c5f64d1feec61716e20092 Mon Sep 17 00:00:00 2001 From: Felipe Lessa Date: Mon, 27 Aug 2012 14:50:04 -0300 Subject: [PATCH 4/5] yesod-core: Whitespace. --- yesod-core/Yesod/Handler.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-core/Yesod/Handler.hs b/yesod-core/Yesod/Handler.hs index f6314df7..d6c54ef3 100644 --- a/yesod-core/Yesod/Handler.hs +++ b/yesod-core/Yesod/Handler.hs @@ -757,7 +757,7 @@ getExpires m = do -- -- Note: although the value used for key and path is 'Text', you should only -- use ASCII values to be HTTP compliant. -deleteCookie :: Text -- ^ key +deleteCookie :: Text -- ^ key -> Text -- ^ path -> GHandler sub master () deleteCookie a = addHeader . DeleteCookie (encodeUtf8 a) . encodeUtf8 From 865281d241388888f7e50cdf52c71893cce525a8 Mon Sep 17 00:00:00 2001 From: Felipe Lessa Date: Mon, 27 Aug 2012 14:50:11 -0300 Subject: [PATCH 5/5] yesod-core: Bump version to 1.1.1.1. Where do I redeem my prize? --- yesod-core/yesod-core.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index 212178bb..e9ef9403 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 1.1.0.1 +version: 1.1.1.1 license: MIT license-file: LICENSE author: Michael Snoyman