packages feed

hack-contrib 2009.7.3 → 2009.8.16

raw patch · 14 files changed

+37/−26 lines, 14 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

changelog.md view
@@ -1,3 +1,10 @@+2009.8.16+---------++### Feature++* no $ noise+ 2009.7.3 -------- 
hack-contrib.cabal view
@@ -1,8 +1,8 @@ Name:                 hack-contrib-Version:              2009.7.3+Version:              2009.8.16 Build-type:           Simple Synopsis:             Hack contrib-Description:          Hack contrib+Description:          Common middlewares and utilities that helps working with Hack License:              BSD3 License-file:         LICENSE Author:               Wang, Jinjing@@ -10,7 +10,7 @@ Build-Depends:        base Cabal-version:        >= 1.2 category:             Web-homepage:             http://github.com/nfjinjing/hack/tree/master+homepage:             http://github.com/nfjinjing/hack-contrib/tree/master data-files:           readme.md, changelog.md  library
src/Hack/Contrib/Middleware/ContentLength.hs view
@@ -8,7 +8,7 @@ import Hack.Contrib.Response import Hack.Contrib.Utils import MPS.Light-import Prelude hiding ((.), (^), (>))+import Prelude hiding ((.), (^), (>), (-))   content_length :: Middleware@@ -22,7 +22,7 @@      where      should_size response =-      [  not $ response.has_header _ContentLength-      ,  not $ response.has_header _TransferEncoding-      ,  not $ status_with_no_entity_body.has(response.status)+      [  not - response.has_header _ContentLength+      ,  not - response.has_header _TransferEncoding+      ,  not - status_with_no_entity_body.has(response.status)       ] .and
src/Hack/Contrib/Middleware/ContentType.hs view
@@ -7,13 +7,13 @@ import Hack.Contrib.Constants import Hack.Contrib.Response import MPS.Light-import Prelude hiding ((.), (^), (>))+import Prelude hiding ((.), (^), (>), (-))   content_type :: String -> Middleware content_type s app = \env -> do   response <- app env   -  return $ case response.header _ContentType of+  return - case response.header _ContentType of     Nothing -> response.set_header _ContentType s     Just _ -> response
src/Hack/Contrib/Middleware/ETag.hs view
@@ -8,7 +8,7 @@ import Hack.Contrib.Constants import Hack.Contrib.Response import MPS.Light-import Prelude hiding ((.), (^), (>))+import Prelude hiding ((.), (^), (>), (-))   
src/Hack/Contrib/Middleware/File.hs view
@@ -12,7 +12,7 @@ import Hack.Contrib.Response import Hack.Contrib.Utils import MPS-import Prelude hiding ((.), (^), (>), (+), (/), readFile)+import Prelude hiding ((.), (^), (>), (+), (/), (-), readFile) import System.Directory import System.FilePath import qualified Data.ByteString.Lazy.Char8 as B@@ -54,7 +54,7 @@         let safe_lookup = lookup_mime_type > fromMaybe default_content_type         let content_type = path.takeExtension.safe_lookup         -        return $ +        return -            def              .set_body content             .set_content_length size@@ -83,7 +83,7 @@   where msg = "File not found: " ++ path ++ "\n"  forbidden :: IO Response-forbidden = return $ +forbidden = return -    def     .set_status 403     .set_content_type _TextPlain
src/Hack/Contrib/Middleware/Hub.hs view
@@ -9,7 +9,7 @@ import Data.Maybe import Data.Time import MPS-import Prelude hiding ((.), (^), (>), (+))+import Prelude hiding ((.), (^), (>), (+), (-)) import Text.PrettyPrint.ANSI.Leijen import Text.Printf @@ -38,7 +38,7 @@   do     time <- now     pid <- get_pid-    stream $ formatter severity time pid program message+    stream - formatter severity time pid program message  get_pid :: IO Int get_pid =
src/Hack/Contrib/Middleware/Lambda.hs view
@@ -12,7 +12,7 @@ import MPS import MPS.Heavy import MPS.TH-import Prelude hiding ((.), (^), (>), (+))+import Prelude hiding ((.), (^), (>), (+), (-)) import qualified Data.ByteString.Lazy.Char8 as B  @@ -44,7 +44,7 @@ lambda app = \env -> do   if env.path_info.is "/lambda"     then -      return $ def+      return - def         .set_body (data64.unzip64.B.pack)         .set_content_type _TextHtml         .set_status 200
src/Hack/Contrib/Middleware/Lucky.hs view
@@ -12,14 +12,14 @@ import MPS import MPS.Heavy import MPS.TH-import Prelude hiding ((.), (^), (>), (+))+import Prelude hiding ((.), (^), (>), (+), (-)) import qualified Data.ByteString.Lazy.Char8 as B  lucky :: Middleware lucky app = \env -> do   if env.path_info.is "/lucky"     then -      return $ def+      return - def       .set_body (data64.unzip64.B.pack)       .set_content_type _TextHtml       .set_status 200
src/Hack/Contrib/Middleware/RegexpRouter.hs view
@@ -8,7 +8,7 @@ import Hack.Contrib.Utils import List (find) import MPS-import Prelude hiding ((.), (^), (>))+import Prelude hiding ((.), (^), (>), (-))  type RoutePath = (String, Application) 
src/Hack/Contrib/Middleware/ShowExceptions.hs view
@@ -9,7 +9,7 @@ import Hack.Contrib.Middleware.Hub import Hack.Contrib.Utils import MPS.Light-import Prelude hiding ((.), (^), (>), log)+import Prelude hiding ((.), (^), (>), (-), log) import System.IO   import System.IO.Error import qualified Data.ByteString.Lazy.Char8 as B@@ -29,4 +29,4 @@     handler log e = do       let message = e.show       Error. log message-      return $ def { status = 500, body = B.pack message }+      return - def { status = 500, body = B.pack message }
src/Hack/Contrib/Middleware/URLMap.hs view
@@ -16,7 +16,7 @@ import Hack.Contrib.Utils import List (find, isPrefixOf) import MPS.Light-import Prelude hiding ((.), (^), (>))+import Prelude hiding ((.), (^), (>), (-))   type RoutePath = (String, Application)
src/Hack/Contrib/Mime.hs view
@@ -100,7 +100,10 @@    ,  x     ".odp"          "application/vnd.oasis.opendocument.presentation"    ,  x     ".ods"          "application/vnd.oasis.opendocument.spreadsheet"    ,  x     ".odt"          "application/vnd.oasis.opendocument.text"-   ,  x     ".ogg"          "application/ogg"+   ,  x     ".oga"          "audio/ogg"+   ,  x     ".ogg"          "audio/ogg"+   ,  x     ".ogv"          "video/ogg"+   ,  x     ".ogx"          "application/ogg"    ,  x     ".p"            "text/x-pascal"    ,  x     ".pas"          "text/x-pascal"    ,  x     ".pbm"          "image/x-portable-bitmap"@@ -138,6 +141,7 @@    ,  x     ".sig"          "application/pgp-signature"    ,  x     ".snd"          "audio/basic"    ,  x     ".so"           "application/octet-stream"+   ,  x     ".spx"          "audio/ogg"    ,  x     ".svg"          "image/svg+xml"    ,  x     ".svgz"         "image/svg+xml"    ,  x     ".swf"          "application/x-shockwave-flash"
src/Hack/Contrib/Utils.hs view
@@ -12,7 +12,7 @@ import Hack.Contrib.Constants import MPS.Light import Network.URI hiding (path)-import Prelude hiding ((.), (^), (>), lookup, (+), (/))+import Prelude hiding ((.), (^), (>), lookup, (+), (/), (-)) import System.Locale (defaultTimeLocale) import qualified Data.ByteString.Lazy.Char8 as B import qualified Data.Map as M@@ -38,7 +38,7 @@ dummy_middleware = id  dummy_app :: Application-dummy_app _ = return $ def { status = 500 }+dummy_app _ = return - def { status = 500 }  escape_html :: String -> String escape_html = concatMap fixChar