This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "snap".

The branch, master has been updated
       via  88ffb71b776e5503b0f15f33612686e902454a16 (commit)
       via  54f17ad2a7dbecf2d493e4e46b37d6fb6acdf515 (commit)
       via  7bb0d699699e75271d39b8723887bac19e236180 (commit)
      from  75ee397c24a75dff344d06edaf644894a9c2f4e8 (commit)


Summary of changes:
 src/Snap/Heist.hs   |   16 ++++++++++++++--
 src/Snap/Starter.hs |    2 ++
 2 files changed, 16 insertions(+), 2 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 88ffb71b776e5503b0f15f33612686e902454a16
Merge: 54f17ad 75ee397
Author: Mighty Byte <[email protected]>
Date:   Mon Oct 4 09:33:24 2010 -0400

    Merge branch 'master' of git.snapframework.com:snap
    
    Conflicts:
        project_template/extensions/foo.cabal
        src/Snap/Heist.hs
        src/Snap/Starter.hs

diff --cc src/Snap/Heist.hs
index 2e7aa6d,2693b1e..e889a91
--- a/src/Snap/Heist.hs
+++ b/src/Snap/Heist.hs
@@@ -3,14 -3,9 +3,12 @@@
  -- Heist templates from Snap.
  module Snap.Heist where
  
 -import           Data.ByteString (ByteString)
 -import qualified Data.ByteString as B
 +------------------------------------------------------------------------------
 +import           Control.Applicative
- import qualified Data.ByteString.Char8 as S
- 
- import           Snap.Error
++import           Data.ByteString.Char8 (ByteString)
++import qualified Data.ByteString.Char8 as B
  import           Snap.Types
 +import           Snap.Util.FileServe
- 
  import           Text.Templating.Heist
  
  
@@@ -32,20 -26,7 +29,16 @@@ render :: (MonadSnap m
         -> m ()
  render contentType ts template = do
      bytes <- renderTemplate ts template
-     flip (maybe missingTemplate) bytes $ \x -> do
+     flip (maybe pass) bytes $ \x -> do
          modifyResponse $ setContentType contentType
-                        . setContentLength (fromIntegral $ S.length x)
+                        . setContentLength (fromIntegral $ B.length x)
          writeBS x
-   where
-     msg = S.append "Unable to load template: " template
-     missingTemplate = internalError msg
 +
 +
 +------------------------------------------------------------------------------
 +-- | Handles the rendering of any template in TemplateState.
 +handleAllTemplates :: (MonadSnap m)
 +                   => TemplateState m -> m ()
 +handleAllTemplates ts =
 +    ifTop (renderHtml ts "index") <|>
-     (renderHtml ts . S.pack =<< getSafePath)
-     
++    (renderHtml ts . B.pack =<< getSafePath)
commit 54f17ad2a7dbecf2d493e4e46b37d6fb6acdf515
Author: Mighty Byte <[email protected]>
Date:   Mon Oct 4 09:13:39 2010 -0400

    Fixed version dependencies and added template helper function.

diff --git a/project_template/default/foo.cabal 
b/project_template/default/foo.cabal
index d3e3b7b..3a01d66 100644
--- a/project_template/default/foo.cabal
+++ b/project_template/default/foo.cabal
@@ -19,10 +19,10 @@ Executable projname
     haskell98,
     monads-fd >= 0.1 && <0.2,
     bytestring >= 0.9.1 && <0.10,
-    snap-core >= 0.2 && <0.3,
-    snap-server >= 0.2 && <0.3,
+    snap-core >= 0.3 && <0.4,
+    snap-server >= 0.3 && <0.4,
     heist >= 0.2.2 && <0.3,
-    hexpat == 0.16,
+    hexpat >= 0.18.3 && <0.19,
     xhtml-combinators,
     unix,
     text,
diff --git a/snap.cabal b/snap.cabal
index a7f2d73..fa9ee97 100644
--- a/snap.cabal
+++ b/snap.cabal
@@ -79,7 +79,7 @@ Executable snap
     base >= 4 && < 5,
     bytestring,
     bytestring-nums,
-    cereal >= 0.2 && < 0.3,
+    cereal >= 0.3 && < 0.4,
     containers,
     directory,
     directory-tree,
diff --git a/src/Snap/Heist.hs b/src/Snap/Heist.hs
index 881d0ff..2e7aa6d 100644
--- a/src/Snap/Heist.hs
+++ b/src/Snap/Heist.hs
@@ -4,10 +4,12 @@
 module Snap.Heist where
 
 ------------------------------------------------------------------------------
+import           Control.Applicative
 import qualified Data.ByteString.Char8 as S
 
 import           Snap.Error
 import           Snap.Types
+import           Snap.Util.FileServe
 
 import           Text.Templating.Heist
 
@@ -37,3 +39,13 @@ render contentType ts template = do
   where
     msg = S.append "Unable to load template: " template
     missingTemplate = internalError msg
+
+
+------------------------------------------------------------------------------
+-- | Handles the rendering of any template in TemplateState.
+handleAllTemplates :: (MonadSnap m)
+                   => TemplateState m -> m ()
+handleAllTemplates ts =
+    ifTop (renderHtml ts "index") <|>
+    (renderHtml ts . S.pack =<< getSafePath)
+    
commit 7bb0d699699e75271d39b8723887bac19e236180
Author: Mighty Byte <[email protected]>
Date:   Sun Oct 3 20:18:06 2010 -0400

    Improve help messages

diff --git a/src/Snap/Starter.hs b/src/Snap/Starter.hs
index 348df39..88a35a2 100644
--- a/src/Snap/Starter.hs
+++ b/src/Snap/Starter.hs
@@ -28,6 +28,8 @@ usage = unlines
     ,""
     ,"    <action> can be one of:"
     ,"      init - create a new project directory structure in the current 
directory"
+    ,""
+    ,"  Note: you can use --help after any of the above actions to get help on 
that action"
     ]
 
 
@@ -70,16 +72,17 @@ initProject args = do
         ,"  snap init"
         ,""
         ,"    -b  --barebones   Depend only on -core and -server"
+        ,"    -i  --hint        Depend only on hint for dynamic reloading"
         ,"    -h  --help        Print this message"
         ]
 
     options =
         [ Option ['b'] ["barebones"] (NoArg InitBareBones)
                  "Depend only on -core and -server"
-        , Option ['h'] ["help"]      (NoArg InitHelp)
-                 "Print this message"
         , Option ['i'] ["hint"]      (NoArg InitHint)
                  "Depend on hint"
+        , Option ['h'] ["help"]      (NoArg InitHelp)
+                 "Print this message"
         ]
 
     init' flags = do
-----------------------------------------------------------------------


hooks/post-receive
-- 
snap
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to