packages feed

snap 1.1.1.0 → 1.1.2.0

raw patch · 6 files changed

+52/−42 lines, 6 filesdep +faildep ~QuickCheckdep ~basedep ~hashablePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: fail

Dependency ranges changed: QuickCheck, base, hashable, lens, snap-core

API changes (from Hackage documentation)

- Snap.Snaplet.Config: instance Data.Semigroup.Semigroup Snap.Snaplet.Config.AppConfig
+ Snap.Snaplet.Config: instance GHC.Base.Semigroup Snap.Snaplet.Config.AppConfig
- Snap.Snaplet: snapletConfig :: forall s_avRm. Lens' (Snaplet s_avRm) SnapletConfig
+ Snap.Snaplet: snapletConfig :: forall s_avbZ. Lens' (Snaplet s_avbZ) SnapletConfig
- Snap.Snaplet: snapletValue :: forall s_avRm. Lens' (Snaplet s_avRm) s_avRm
+ Snap.Snaplet: snapletValue :: forall s_avbZ. Lens' (Snaplet s_avbZ) s_avbZ
- Snap.Snaplet.Auth: withBackend :: (forall r. (IAuthBackend r) => r -> Handler b (AuthManager v) a) -> Handler b (AuthManager v) a
+ Snap.Snaplet.Auth: withBackend :: (forall r. IAuthBackend r => r -> Handler b (AuthManager v) a) -> Handler b (AuthManager v) a
- Snap.Snaplet.Heist: getHeistState :: (HasHeist b) => Handler b v (HeistState (Handler b b))
+ Snap.Snaplet.Heist: getHeistState :: HasHeist b => Handler b v (HeistState (Handler b b))
- Snap.Snaplet.Heist: modifyHeistState :: (HasHeist b) => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
+ Snap.Snaplet.Heist: modifyHeistState :: HasHeist b => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
- Snap.Snaplet.Heist: withHeistState :: (HasHeist b) => (HeistState (Handler b b) -> a) -> Handler b v a
+ Snap.Snaplet.Heist: withHeistState :: HasHeist b => (HeistState (Handler b b) -> a) -> Handler b v a
- Snap.Snaplet.Heist.Compiled: getHeistState :: (HasHeist b) => Handler b v (HeistState (Handler b b))
+ Snap.Snaplet.Heist.Compiled: getHeistState :: HasHeist b => Handler b v (HeistState (Handler b b))
- Snap.Snaplet.Heist.Compiled: modifyHeistState :: (HasHeist b) => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
+ Snap.Snaplet.Heist.Compiled: modifyHeistState :: HasHeist b => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
- Snap.Snaplet.Heist.Compiled: withHeistState :: (HasHeist b) => (HeistState (Handler b b) -> a) -> Handler b v a
+ Snap.Snaplet.Heist.Compiled: withHeistState :: HasHeist b => (HeistState (Handler b b) -> a) -> Handler b v a
- Snap.Snaplet.Heist.Generic: getHeistState :: (HasHeist b) => Handler b v (HeistState (Handler b b))
+ Snap.Snaplet.Heist.Generic: getHeistState :: HasHeist b => Handler b v (HeistState (Handler b b))
- Snap.Snaplet.Heist.Generic: modifyHeistState :: (HasHeist b) => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
+ Snap.Snaplet.Heist.Generic: modifyHeistState :: HasHeist b => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
- Snap.Snaplet.Heist.Generic: withHeistState :: (HasHeist b) => (HeistState (Handler b b) -> a) -> Handler b v a
+ Snap.Snaplet.Heist.Generic: withHeistState :: HasHeist b => (HeistState (Handler b b) -> a) -> Handler b v a
- Snap.Snaplet.Heist.Interpreted: getHeistState :: (HasHeist b) => Handler b v (HeistState (Handler b b))
+ Snap.Snaplet.Heist.Interpreted: getHeistState :: HasHeist b => Handler b v (HeistState (Handler b b))
- Snap.Snaplet.Heist.Interpreted: modifyHeistState :: (HasHeist b) => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
+ Snap.Snaplet.Heist.Interpreted: modifyHeistState :: HasHeist b => (HeistState (Handler b b) -> HeistState (Handler b b)) -> Initializer b v ()
- Snap.Snaplet.Heist.Interpreted: withHeistState :: (HasHeist b) => (HeistState (Handler b b) -> a) -> Handler b v a
+ Snap.Snaplet.Heist.Interpreted: withHeistState :: HasHeist b => (HeistState (Handler b b) -> a) -> Handler b v a
- Snap.Snaplet.Session: checkTimeout :: (MonadSnap m) => Maybe Int -> UTCTime -> m Bool
+ Snap.Snaplet.Session: checkTimeout :: MonadSnap m => Maybe Int -> UTCTime -> m Bool
- Snap.Snaplet.Session.SessionManager: lookup :: ISessionManager r => Text -> r -> (Maybe Text)
+ Snap.Snaplet.Session.SessionManager: lookup :: ISessionManager r => Text -> r -> Maybe Text

Files

runTestsAndCoverage.sh view
@@ -2,30 +2,31 @@  set -e -# All directory variables relative to project root-DIR=dist-newstyle/hpc--SUITE=./dist-newstyle/build/snap-1.0.0.0/build/testsuite/testsuite--if [ -z "$DEBUG" ]; then-    export DEBUG=snap-testsuite-fi--rm -f testsuite.tix-rm -rf "$DIR"-mkdir -p "$DIR"--if [ ! -f $SUITE ]; then-    cat <<EOF-Testsuite executable not found, please run:-    cabal install --enable-tests --only-dependencies-    cabal configure --enable-tests-    cabal build-EOF-    exit;-fi--$SUITE $*+# # All directory variables relative to project root+# DIR=dist-newstyle/hpc+# +# SUITE=./dist-newstyle/build/x86_64-osx/ghc-8.2.2/snap-1.1.1.0/t/testsuite/build/testsuite/testsuite+# +# if [ -z "$DEBUG" ]; then+#     export DEBUG=snap-testsuite+# fi+# +# rm -f testsuite.tix+# rm -rf "$DIR"+# mkdir -p "$DIR"+# +# if [ ! -f $SUITE ]; then+#     cat <<EOF+# Testsuite executable not found, please run:+#     cabal install --enable-tests --only-dependencies+#     cabal configure --enable-tests+#     cabal new-build --enable-tests+# EOF+#     exit;+# fi+# +# # cabal new-run testsuite+# $SUITE $*  EXCLUDES='Main Snap@@ -68,6 +69,8 @@ rm -f test/snaplets/heist/templates/bad.tpl rm -f test/snaplets/heist/templates/good.tpl rm -fr test/non-cabal-appdir/snaplets/foosnaplet # TODO++cp ./dist-newstyle/build/x86_64-osx/ghc-8.2.2/snap-1.1.1.0/hpc/vanilla/tix/testsuite/testsuite.tix .  # TODO - actually send results to /dev/null when hpc kinks are fully removed hpc markup $EXCL --destdir=$DIR testsuite # >/dev/null 2>&1
snap.cabal view
@@ -1,5 +1,5 @@ name:           snap-version:        1.1.1.0+version:        1.1.2.0 synopsis:       Top-level package for the Snap Web Framework description:     This is the top-level package for the official Snap Framework libraries.@@ -41,7 +41,8 @@   GHC == 7.10.3,   GHC == 8.0.1,   GHC == 8.2.1,-  GHC == 8.4.1+  GHC == 8.4.1,+  GHC == 8.6.1  extra-source-files:   .ghci@@ -110,33 +111,34 @@     Snap.Snaplet.Session.SecureCookie    build-depends:-    aeson                     >= 0.6      && < 1.4,+    aeson                     >= 0.6      && < 1.5,     attoparsec                >= 0.10     && < 0.14,-    base                      >= 4        && < 4.12,+    base                      >= 4        && < 4.13,     bytestring                >= 0.9.1    && < 0.11,     cereal                    >= 0.3      && < 0.6,     clientsession             >= 0.8      && < 0.10,     configurator              >= 0.1      && < 0.4,-    containers                >= 0.2      && < 0.6,+    containers                >= 0.2      && < 0.7,     directory                 >= 1.1      && < 1.4,     directory-tree            >= 0.10     && < 0.13,     dlist                     >= 0.5      && < 0.9,+    fail                      >= 4.9      && < 4.10,     filepath                  >= 1.3      && < 1.5,     -- hashable is broken from 1.2.0.0 through 1.2.0.5     -- snap does work with hashable 1.1.*, but some have complained that     -- the version disjunction causes problems with dependency resolution.     hashable                  >= 1.2.0.6  && < 1.3,     heist                     >= 1.1      && < 1.2,-    lens                      >= 3.7.6    && < 4.17,+    lens                      >= 3.7.6    && < 4.18,     lifted-base               >= 0.2      && < 0.3,     map-syntax                >= 0.2      && < 0.4,     monad-control             >= 0.3      && < 1.1,     mtl                       >= 2.0      && < 2.3,-    mwc-random                >= 0.8      && < 0.14,+    mwc-random                >= 0.8      && < 0.15,     pwstore-fast              >= 2.2      && < 2.5,     snap-core                 >= 1.0      && < 1.1,     snap-server               >= 1.0      && < 1.2,-    stm                       >= 2.2      && < 2.5,+    stm                       >= 2.2      && < 2.6,     text                      >= 0.11     && < 1.3,     time                      >= 1.1      && < 1.10,     transformers              >= 0.2      && < 0.6,@@ -242,6 +244,7 @@     directory,     directory-tree,     dlist,+    fail,     filepath,     hashable,     heist,@@ -254,7 +257,7 @@     mtl,     mwc-random,     pwstore-fast,-    QuickCheck                 >= 2.4.2    && < 2.12,+    QuickCheck                 >= 2.4.2    && < 2.13,     smallcheck                 >= 1.1.1    && < 1.2,     snap-core,     snap-server,
src/Snap/Snaplet/Internal/Initializer.hs view
@@ -111,7 +111,7 @@ ------------------------------------------------------------------------------ -- | Return the current environment string.  This will be the -- environment given to 'runSnaplet' or from the command line when--- using 'serveSnaplet'.  Usefully for changing behavior during+-- using 'serveSnaplet'.  Useful for changing behavior during -- development and testing. getEnvironment :: Initializer b v String getEnvironment = iGets _environment
src/Snap/Snaplet/Internal/Lensed.hs view
@@ -14,6 +14,7 @@ import           Control.Lens                (ALens', cloneLens, storing, (^#)) import           Control.Monad               (MonadPlus (..), liftM) import           Control.Monad.Base          (MonadBase (..))+import qualified Control.Monad.Fail          as Fail import           Control.Monad.Reader        (MonadReader (..)) import           Control.Monad.State.Class   (MonadState (..)) import           Control.Monad.Trans         (MonadIO (..), MonadTrans (..))@@ -44,6 +45,11 @@     Lensed mf <*> Lensed ma = Lensed $ \l v s -> do         (f, v', s') <- mf l v s         (\(a,v'',s'') -> (f a, v'', s'')) <$> ma l v' s'+++------------------------------------------------------------------------------+instance Fail.MonadFail m => Fail.MonadFail (Lensed b v m) where+    fail s = Lensed $ \_ _ _ -> Fail.fail s   ------------------------------------------------------------------------------
src/Snap/Snaplet/Internal/Types.hs view
@@ -20,6 +20,7 @@ import           Control.Lens                 (ALens', makeLenses, set) import           Control.Monad                (liftM) import           Control.Monad.Base           (MonadBase (..))+import           Control.Monad.Fail           (MonadFail) import           Control.Monad.Reader         (MonadIO (..), MonadPlus, MonadReader (ask, local)) import           Control.Monad.State.Class    (MonadState (get, put), gets) import           Control.Monad.Trans.Control  (MonadBaseControl (..))@@ -277,6 +278,7 @@   deriving ( Monad            , Functor            , Applicative+           , MonadFail            , MonadIO            , MonadPlus            , Alternative
test/suite/Snap/Snaplet/Test/Tests.hs view
@@ -12,14 +12,10 @@ import           Test.Framework.Providers.HUnit (testCase) import           Test.HUnit                     hiding (Test, path) -------------------------------------------------------------------------------import           Snap.Core                      (readRequestBody,-                                                 writeLBS, writeText)-import qualified Snap.Test                      as ST-import           Snap.Snaplet.Test              (closeSnaplet,-                                                 getSnaplet,-                                                 evalHandler, evalHandler',-                                                 runHandler, runHandler')+import           Snap.Core                      (readRequestBody, writeLBS, writeText)+import           Snap.Snaplet.Test              (closeSnaplet, evalHandler, evalHandler', getSnaplet, runHandler, runHandler') import           Snap.Snaplet.Test.Common.App   (appInit, failingAppInit)+import qualified Snap.Test                      as ST  ------------------------------------------------------------------------------ tests :: Test@@ -121,7 +117,7 @@     assertReadRqBody =       do let hdl = readRequestBody 5000 >>= writeLBS          res <- race-                (threadDelay 1000000)+                (threadDelay 100000000)                 (runHandler Nothing (ST.get "" Map.empty) hdl appInit)          either (assertFailure . ("readRequestBody timeout" ++) . show)            (either (assertFailure . show) ST.assertSuccess) res