apiary 1.1.1 → 1.1.2
raw patch · 4 files changed
+16/−9 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- apiary.cabal +2/−2
- src/Control/Monad/Apiary/Filter.hs +0/−1
- src/Web/Apiary/Heroku.hs +11/−6
CHANGELOG.md view
@@ -1,3 +1,6 @@+# 1.1.2+* re-export Web.Apiary from Web.Apiary.Heroku.+ # 1.1.1 * add request test to web API documentation.
apiary.cabal view
@@ -1,5 +1,5 @@ name: apiary-version: 1.1.1+version: 1.1.2 synopsis: Simple and type safe web framework that can be automatically generate API documentation. description: Simple and type safe web framework that can be automatically generate API documentation.@@ -40,7 +40,7 @@ . * Auto generate API documentation(example: <http://best-haskell.herokuapp.com/api/documentation>). .- more examples: <https://github.com/philopon/apiary/blob/v1.1.1/examples/>+ more examples: <https://github.com/philopon/apiary/blob/v1.1.2/examples/> . live demo: <http://best-haskell.herokuapp.com/> (source code: <https://github.com/philopon/best-haskell>)
src/Control/Monad/Apiary/Filter.hs view
@@ -66,7 +66,6 @@ import Text.Blaze.Html import qualified Data.ByteString.Char8 as SC import qualified Data.Text as T-import qualified Data.Text.Encoding as T import qualified Data.CaseInsensitive as CI import Data.Monoid import Data.Apiary.Compat
src/Web/Apiary/Heroku.hs view
@@ -14,6 +14,10 @@ , runHeroku, runHerokuWith, runHerokuTWith -- * extension functions , getHerokuEnv, getHerokuEnv'++ -- * reexports+ -- | exclude run* functions.+ , module Web.Apiary ) where import System.Environment@@ -35,6 +39,7 @@ import Network.Wai import Control.Monad.Apiary import Data.Apiary.Extension+import Web.Apiary hiding (runApiary, runApiaryWith, runApiaryTWith) data Heroku = Heroku { herokuEnv :: IORef (Maybe (H.HashMap T.Text T.Text))@@ -59,11 +64,11 @@ -- | use this function instead of serverWith in heroku app. since 0.17.0. ----- @ serverWith exts (run 3000) . runApiary def $ foo @+-- @ runApiaryTWith id (run 3000) exts def $ foo @ -- -- to ----- @ herokuWith exts run def . runApiary def $ foo @+-- @ runHerokuTWith id run exts def $ foo @ -- runHerokuTWith :: (MonadIO m, Monad actM) => (forall b. actM b -> IO b)@@ -100,10 +105,10 @@ getHerokuEnv' :: T.Text -- ^ heroku environment variable name -> Heroku -> IO (Maybe T.Text)-getHerokuEnv' key Heroku{..} = try (getEnv $ T.unpack key) >>= \case+getHerokuEnv' envkey Heroku{..} = try (getEnv $ T.unpack envkey) >>= \case Right e -> return (Just $ T.pack e) Left (_::SomeException) -> readIORef herokuEnv >>= \case- Just hm -> return $ H.lookup key hm+ Just hm -> return $ H.lookup envkey hm Nothing -> do let args = ["config", "-s"] ++ maybe [] (\n -> ["--app", n]) (herokuAppName herokuConfig)@@ -115,10 +120,10 @@ hm <- H.fromList . map (second T.tail . T.break (== '=')) . T.lines <$> T.hGetContents hout writeIORef herokuEnv (Just hm)- return $ H.lookup key hm+ return $ H.lookup envkey hm else Nothing <$ writeIORef herokuEnv (Just H.empty) getHerokuEnv :: Has Heroku exts => T.Text -- ^ heroku environment variable name -> Extensions exts -> IO (Maybe T.Text)-getHerokuEnv key exts = getHerokuEnv' key (getExtension Proxy exts)+getHerokuEnv envkey exts = getHerokuEnv' envkey (getExtension Proxy exts)