packages feed

wai-routes 0.4.0 → 0.4.1

raw patch · 3 files changed

+86/−81 lines, 3 filesdep ~basedep ~blaze-builderdep ~bytestring

Dependency ranges changed: base, blaze-builder, bytestring, http-types, mtl, template-haskell, text, wai, yesod-routes

Files

README.md view
@@ -1,4 +1,4 @@-Wai Routes (wai-routes-0.4.0)+Wai Routes (wai-routes-0.4.1) ==============================  [![Build Status](https://travis-ci.org/ajnsit/wai-routes.png)](https://travis-ci.org/ajnsit/wai-routes)@@ -81,5 +81,5 @@ * 0.3.3 : Better exports from the Network.Wai.Middleware.Routes module * 0.3.4 : Added 'liftResourceT' to lift a ResourceT into HandlerM * 0.4.0 : Wai 2 compatibility. Replaced 'liftResourceT' with 'lift'-+* 0.4.1 : showRoute now returns "/" instead of "" 
src/Network/Wai/Middleware/Routes/Routes.hs view
@@ -147,6 +147,8 @@ showRoute = uncurry encodePathInfo . second (map $ second Just) . renderRoute   where     encodePathInfo :: [Text] -> [(Text, Maybe Text)] -> Text+    -- Slightly hackish: Convert "" into "/"+    encodePathInfo [] = encodePathInfo [""]     encodePathInfo segments = decodeUtf8 . toByteString . encodePath segments . queryTextToQuery  -- | Read a route from Text
wai-routes.cabal view
@@ -1,85 +1,88 @@-Name:                wai-routes-Version:             0.4.0-Synopsis:            Typesafe URLs for Wai applications.-Homepage:            https://github.com/ajnsit/wai-routes-License:             MIT-License-file:        LICENSE-Author:              Anupam Jain-Maintainer:          ajnsit@gmail.com-Build-Type:          Simple-Cabal-Version:       >=1.6-stability:           Experimental-Category:            Network-Extra-source-files:  README.md, examples/Example.hs-Description:-  Provides easy to use typesafe URLs for Wai Applications.-  .-  Sample usage follows (See examples/Example.hs in the source bundle for the full code) --  .-  @-    &#123;-&#35; LANGUAGE OverloadedStrings, TypeFamilies &#35;-&#125;-    .-    import Network.Wai-    import Network.Wai.Middleware.Routes-    .-    import Data.IORef-    .-    &#45;&#45; The Site Argument-    data MyRoute = MyRoute (IORef DB)-    .-    &#45;&#45; Generate Routes-    mkRoute "MyRoute" &#91;parseRoutes&#124;-    &#47;             UsersR         GET-    &#47;user&#47;&#35;Int    UserR&#58;-    &#32;&#32;/              UserRootR   GET-    &#32;&#32;/delete        UserDeleteR POST-    &#124;&#93;-    .-    &#45;&#45; Define Handlers-    &#45;&#45; All Users Page-    getUsersR &#58;&#58; Handler MyRoute-    getUsersR (MyRoute dbref) request = ...-    &#45;&#45; Single User Page-    getUserRootR &#58;&#58; Int -> Handler MyRoute-    getUserRootR userid (MyRoute dbref) request = ...-    &#45;&#45; Delete Single User-    postUserDeleteR &#58;&#58; Int -> Handler MyRoute-    postUserDeleteR userid (MyRoute dbref) request = ...-    .-    &#45;&#45; Define Application using RouteM Monad-    myApp = do-    &#32;&#32;db <- liftIO &#36; newIORef mydb-    &#32;&#32;route (MyRoute db)-    &#32;&#32;setDefaultAction $ staticApp $ defaultFileServerSettings &#34;static&#34;-    .-    &#45;&#45; Run the application-    main &#58;&#58; IO ()-    main = toWaiApp myApp >>= run 8080-  @+name          : wai-routes+version       : 0.4.1+cabal-version : >=1.10+build-type    : Simple+license       : MIT+license-file  : LICENSE+maintainer    : ajnsit@gmail.com+stability     : Experimental+homepage      : https://github.com/ajnsit/wai-routes+synopsis      : Typesafe URLs for Wai applications.+description   : Provides easy to use typesafe URLs for Wai Applications.+             .+             Sample usage follows (See examples/Example.hs in the source bundle for the full code) -+             .+             @+             &#123;-&#35; LANGUAGE OverloadedStrings, TypeFamilies &#35;-&#125;+             .+             import Network.Wai+             import Network.Wai.Middleware.Routes+             .+             import Data.IORef+             .+             &#45;&#45; The Site Argument+             data MyRoute = MyRoute (IORef DB)+             .+             &#45;&#45; Generate Routes+             mkRoute "MyRoute" &#91;parseRoutes&#124;+             &#47;             UsersR         GET+             &#47;user&#47;&#35;Int    UserR&#58;+             &#32;&#32;/              UserRootR   GET+             &#32;&#32;/delete        UserDeleteR POST+             &#124;&#93;+             .+             &#45;&#45; Define Handlers+             &#45;&#45; All Users Page+             getUsersR &#58;&#58; Handler MyRoute+             getUsersR (MyRoute dbref) request = ...+             &#45;&#45; Single User Page+             getUserRootR &#58;&#58; Int -> Handler MyRoute+             getUserRootR userid (MyRoute dbref) request = ...+             &#45;&#45; Delete Single User+             postUserDeleteR &#58;&#58; Int -> Handler MyRoute+             postUserDeleteR userid (MyRoute dbref) request = ...+             .+             &#45;&#45; Define Application using RouteM Monad+             myApp = do+             &#32;&#32;db <- liftIO &#36; newIORef mydb+             &#32;&#32;route (MyRoute db)+             &#32;&#32;setDefaultAction $ staticApp $ defaultFileServerSettings &#34;static&#34;+             .+             &#45;&#45; Run the application+             main &#58;&#58; IO ()+             main = toWaiApp myApp >>= run 8080+             @+category           : Network+author             : Anupam Jain+data-dir           : ""+extra-source-files : README.md examples/Example.hs  source-repository head-  type:     git-  location: http://github.com/ajnsit/wai-routes+    type     : git+    location : http://github.com/ajnsit/wai-routes  source-repository this-  type:     git-  location: http://github.com/ajnsit/wai-routes/tree/v0.4.0-  tag:      v0.4.0+    type     : git+    location : http://github.com/ajnsit/wai-routes/tree/v0.4.1+    tag      : v0.4.1 -Library-  hs-source-dirs:    src-  Build-Depends:     base >= 3 && < 5-               ,     wai >= 2 && < 2.1-               ,     text >= 0.11.3 && < 0.12-               ,     bytestring >= 0.10.0 && < 0.10.1-               ,     http-types >= 0.8.3 && < 0.8.4-               ,     blaze-builder >= 0.3.3 && < 0.3.4-               ,     template-haskell >= 2.8.0 && < 2.8.1-               ,     yesod-routes >= 1.2.0 && < 1.2.1-               ,     mtl-  exposed-modules:   Network.Wai.Middleware.Routes-               ,     Network.Wai.Middleware.Routes.Routes-               ,     Network.Wai.Middleware.Routes.Monad-               ,     Network.Wai.Middleware.Routes.Handler-               ,     Network.Wai.Middleware.Routes.ContentTypes+library+    build-depends  : base             >= 4.6.0.1  && < 4.7+                   , wai              >= 2.0.0    && < 2.1+                   , text             >= 0.11.3.1 && < 0.12+                   , bytestring       >= 0.10.0.2 && < 0.11+                   , http-types       >= 0.8.3    && < 0.9+                   , blaze-builder    >= 0.3.3.2  && < 0.4+                   , template-haskell >= 2.8.0.0  && < 2.9+                   , yesod-routes     >= 1.2.0.6  && < 1.3+                   , mtl              >= 2.1.2    && < 2.2+    exposed-modules: Network.Wai.Middleware.Routes+                     Network.Wai.Middleware.Routes.Routes+                     Network.Wai.Middleware.Routes.Monad+                     Network.Wai.Middleware.Routes.Handler+                     Network.Wai.Middleware.Routes.ContentTypes+    exposed        : True+    buildable      : True+    hs-source-dirs : src+    default-language   : Haskell2010