snap 0.9.1.1 → 0.9.2
raw patch · 9 files changed
+84/−42 lines, 9 filesdep ~bytestringdep ~clientsessiondep ~directoryPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: bytestring, clientsession, directory, pwstore-fast, snap-core, snap-server, stm, template-haskell, unix
API changes (from Hackage documentation)
- Snap.Snaplet: snapletConfig :: Lens (Snaplet a) SnapletConfig
+ Snap.Snaplet: snapletConfig :: Lens (Snaplet s_az9h) SnapletConfig
- Snap.Snaplet: snapletValue :: Lens (Snaplet a) a
+ Snap.Snaplet: snapletValue :: Lens (Snaplet s_az9h) s_az9h
Files
- project_template/barebones/foo.cabal +2/−2
- project_template/default/foo.cabal +2/−2
- project_template/default/src/Main.hs +12/−0
- project_template/tutorial/foo.cabal +3/−3
- project_template/tutorial/src/Tutorial.lhs +20/−11
- snap.cabal +36/−16
- src/Snap/Snaplet/Auth/SpliceHelpers.hs +1/−0
- src/Snap/Snaplet/Internal/Types.hs +2/−2
- test/snap-testsuite.cabal +6/−6
project_template/barebones/foo.cabal view
@@ -19,8 +19,8 @@ bytestring >= 0.9.1 && < 0.10, MonadCatchIO-transformers >= 0.2.1 && < 0.4, mtl >= 2 && < 3,- snap-core >= 0.9 && < 0.10,- snap-server >= 0.9 && < 0.10+ snap-core >= 0.9.2 && < 0.10,+ snap-server >= 0.9.2 && < 0.10 if impl(ghc >= 6.12.0) ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2
project_template/default/foo.cabal view
@@ -27,8 +27,8 @@ MonadCatchIO-transformers >= 0.2.1 && < 0.4, mtl >= 2 && < 3, snap == 0.9.*,- snap-core == 0.9.*,- snap-server == 0.9.*,+ snap-core >= 0.9.2 && <0.10,+ snap-server >= 0.9.2 && <0.10, snap-loader-static == 0.9.*, text >= 0.11 && < 0.12, time >= 1.1 && < 1.5,
project_template/default/src/Main.hs view
@@ -1,6 +1,18 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} +{-++NOTE: Don't modify this file unless you know what you are doing. If you are+new to snap, start with Site.hs and Application.hs. This file contains+boilerplate needed for dynamic reloading and is not meant for general+consumption.++Occasionally if we modify the way the dynamic reloader works and you want to+upgrade, you might have to swap out this file for a newer version. But in+most cases you'll never need to modify this code.++-} module Main where ------------------------------------------------------------------------------
project_template/tutorial/foo.cabal view
@@ -19,9 +19,9 @@ bytestring >= 0.9.1 && < 0.10, MonadCatchIO-transformers >= 0.2.1 && < 0.4, mtl >= 2 && < 3,- snap >= 0.9 && < 0.10,- snap-core >= 0.9 && < 0.10,- snap-server >= 0.9 && < 0.10+ snap >= 0.9.2 && < 0.10,+ snap-core >= 0.9.2 && < 0.10,+ snap-server >= 0.9.2 && < 0.10 if impl(ghc >= 6.12.0) ghc-options: -threaded -Wall -fwarn-tabs -funbox-strict-fields -O2
project_template/tutorial/src/Tutorial.lhs view
@@ -54,8 +54,11 @@ what we are talking about. If you need global application state, you have to use a thread-safe construct such as an MVar or IORef. -This post is written in literate Haskell, so first we need to get imports out-of the way.+This post is written in literate Haskell. It uses a small external module+called Part2 that is [available+here](https://github.com/snapframework/snap/blob/master/project_template/tutorial/src/Part2.lhs).+You can also install the full code in the current directory with the command+`snap init tutorial`. First we need to get imports out of the way. > {-# LANGUAGE TemplateHaskell #-} > {-# LANGUAGE OverloadedStrings #-}@@ -267,10 +270,10 @@ This completes a full working application. We did leave out a little dummy code for the Foo and Bar snaplets. This code is included in Part2.hs. For more information look in our [API-documentation](http://hackage.haskell.org/packages/archive/snap/0.6.0.2/doc/html/Snap-Snaplet.html).-No really, that wasn't a joke. The API docs are written as prose. It is-written to be very easy to read, while having the benefit of including all the-actual type signatures.+documentation](http://hackage.haskell.org/package/snap), specifically the+Snap.Snaplet module. No really, that wasn't a joke. The API docs are written+as prose. They should be very easy to read, while having the benefit of+including all the actual type signatures. Filesystem Data and Automatic Installation ==========================================@@ -280,7 +283,7 @@ snaplet filesystem layout might look like: foosnaplet/- |-- *snaplet.cfg*+ |-- *devel.cfg* |-- db.cfg |-- public/ |-- stylesheets/@@ -293,13 +296,13 @@ |-- subsnaplet2/ Only the starred items are actually enforced by current code, but we want to-establish the others as a convention. The file snaplet.cfg is automatically+establish the others as a convention. The file devel.cfg is automatically read by the snaplet infrastructure. It is available to you via the `getSnapletUserConfig` function. Config files use the format defined by Bryan O'Sullivan's excellent [configurator package](http://hackage.haskell.org/package/configurator). In this example, the user has chosen to put db config items in a separate file and use-configurator's import functionality to include it in snaplet.cfg. If+configurator's import functionality to include it in devel.cfg. If foosnaplet uses `nestSnaplet` or `embedSnaplet` to include any other snaplets, then filesystem data defined by those snaplets will be included in subdirectories under the `snaplets/` directory.@@ -343,11 +346,17 @@ including a section like the following in snaplet-killerapp.cabal: data-files:- resources/snaplet.cfg,+ resources/devel.cfg, resources/public/stylesheets/style.css, resources/snaplets/heist/templates/page.tpl Now whenever your snaplet is used, its filesystem data will be automagically copied into the local project that is using it, whenever the application is-run and it sees that the files don't already exist.+run and it sees that the snaplet's directory does not already exist. If the+user upgrades to a new version of the snaplet and the new version made changes+to the filesystem resources, those resources will NOT be automatically copied+in by default. Resource installation *only* happens when the `snaplets/foo`+directory does not exist. If you want to get the latest version of the+filesystem resources, remove the `snaplets/foo` directory, and restart your+app.
snap.cabal view
@@ -1,7 +1,27 @@ name: snap-version: 0.9.1.1-synopsis: Snap: A Haskell Web Framework: project starter executable and glue code library-description: Snap Framework project starter executable and glue code library+version: 0.9.2+synopsis: Top-level package for the Snap Web Framework+description:+ This is the top-level package for the official Snap Framework libraries.+ It includes:+ .+ * The Snaplets API+ .+ * The \"snap\" executable program for generating starter projects+ .+ * Snaplets for sessions, authentication, and templates+ .+ To get started, issue the following sequence of commands:+ .+ @$ cabal install snap+ $ mkdir myproject+ $ cd myproject+ $ snap init@+ .+ If you have trouble or any questions, see our FAQ page+ (<http://snapframework.com/faq>) or the documentation+ (<http://snapframework.com/docs>).+ license: BSD3 license-file: LICENSE author: Ozgun Ataman, Doug Beardsley, Gregory Collins, Carl Howells, Chris Smith@@ -115,19 +135,19 @@ if !os(windows) build-depends:- unix >= 2.2.0.0 && < 2.6+ unix >= 2.2.0.0 && < 2.7 build-depends: MonadCatchIO-transformers >= 0.2 && < 0.4, aeson >= 0.6 && < 0.7, attoparsec >= 0.10 && < 0.11, base >= 4 && < 5,- bytestring >= 0.9.1 && < 0.10,+ bytestring >= 0.9.1 && < 0.11, cereal >= 0.3 && < 0.4,- clientsession >= 0.7.3.6 && < 0.8,+ clientsession >= 0.8 && < 0.9, configurator >= 0.1 && < 0.3, containers >= 0.3 && < 0.6,- directory >= 1.0 && < 1.2,+ directory >= 1.0 && < 1.3, directory-tree >= 0.10 && < 0.11, data-lens >= 2.0.1 && < 2.11, data-lens-template >= 2.1 && < 2.2,@@ -137,12 +157,12 @@ logict >= 0.4.2 && < 0.6, mtl > 2.0 && < 2.2, mwc-random >= 0.8 && < 0.13,- pwstore-fast >= 2.2 && < 2.3,- snap-core >= 0.9.0 && < 0.10,- snap-server >= 0.9.0 && < 0.10,- stm >= 2.2 && < 2.4,+ pwstore-fast >= 2.3 && < 2.4,+ snap-core >= 0.9.2 && < 0.10,+ snap-server >= 0.9.2 && < 0.10,+ stm >= 2.2 && < 2.5, syb >= 0.1 && < 0.4,- template-haskell >= 2.2 && < 2.8,+ template-haskell >= 2.2 && < 2.9, text >= 0.11 && < 0.12, time >= 1.1 && < 1.5, transformers >= 0.2 && < 0.4,@@ -187,14 +207,14 @@ build-depends: base >= 4 && < 5,- bytestring >= 0.9.1 && < 0.10,+ bytestring >= 0.9.1 && < 0.11, containers >= 0.3 && < 0.6,- directory >= 1.0 && < 1.2,+ directory >= 1.0 && < 1.3, directory-tree >= 0.10 && < 0.11, filepath >= 1.1 && < 1.4, old-time >= 1.0 && < 1.2,- snap-server >= 0.9.0 && < 0.10,- template-haskell >= 2.2 && < 2.8,+ snap-server >= 0.9.1 && < 0.10,+ template-haskell >= 2.2 && < 2.9, text >= 0.11 && < 0.12 ghc-prof-options: -prof -auto-all
src/Snap/Snaplet/Auth/SpliceHelpers.hs view
@@ -35,6 +35,7 @@ -- This adds the following splices: -- \<ifLoggedIn\> -- \<ifLoggedOut\>+-- \<loggedInUser\> addAuthSplices :: HasHeist b => Lens b (Snaplet (AuthManager b))
src/Snap/Snaplet/Internal/Types.hs view
@@ -75,7 +75,7 @@ makeLenses [''SnapletConfig, ''Snaplet] -+{- ------------------------------------------------------------------------------ -- | A lens referencing the opaque SnapletConfig data type held inside -- Snaplet.@@ -85,7 +85,7 @@ ------------------------------------------------------------------------------ -- | A lens referencing the user-defined state type wrapped by a Snaplet. snapletValue :: Lens (Snaplet a) a-+-} ------------------------------------------------------------------------------ -- | Transforms a lens of the type you get from makeLenses to an similar lens
test/snap-testsuite.cabal view
@@ -22,8 +22,8 @@ directory-tree >= 0.10 && < 0.11, filepath, heist >= 0.7 && < 0.9,- http-conduit >= 1.4 && < 1.5,- http-types >= 0.6 && < 0.7,+ http-conduit >= 1.4 && < 1.7,+ http-types >= 0.6 && < 0.8, mtl >= 2, process == 1.*, snap-core >= 0.9 && < 0.10,@@ -33,7 +33,7 @@ test-framework-quickcheck2 >= 0.2.12.1 && <0.3, text >= 0.11 && < 0.12, transformers >= 0.2,- unix >= 2.2.0.0 && < 2.6,+ unix >= 2.2.0.0 && < 2.7, utf8-string >= 0.3 && < 0.4, template-haskell @@ -70,7 +70,7 @@ base >= 4 && < 5, bytestring >= 0.9 && < 0.10, cereal >= 0.3,- clientsession >= 0.7.3.6 && < 0.8,+ clientsession >= 0.7.3.6 && < 0.9, configurator >= 0.1 && < 0.3, containers >= 0.3, data-lens >= 2.0.1 && < 2.11,@@ -83,8 +83,8 @@ mtl >= 2, mwc-random >= 0.8, process == 1.*,- snap-core >= 0.9 && < 0.10,- snap-server >= 0.9 && < 0.10,+ snap-core >= 0.9.2 && < 0.10,+ snap-server >= 0.9.2 && < 0.10, syb >= 0.1, time >= 1.1, text >= 0.11 && < 0.12,