packages feed

hamlet 1.0.1 → 1.0.1.1

raw patch · 4 files changed

+34/−9 lines, 4 filesdep +blaze-markupdep ~blaze-htmlPVP ok

version bump matches the API change (PVP)

Dependencies added: blaze-markup

Dependency ranges changed: blaze-html

API changes (from Hackage documentation)

Files

Text/Hamlet.hs view
@@ -46,7 +46,12 @@ import Data.Maybe (fromMaybe) import Data.Text (Text, pack) import qualified Data.Text.Lazy as TL+#if MIN_VERSION_blaze_html(0,5,0)+import Text.Blaze.Html (Html, toHtml)+import Text.Blaze.Internal (preEscapedText)+#else import Text.Blaze (Html, preEscapedText, toHtml)+#endif import qualified Data.Foldable as F import Control.Monad (mplus) import Data.Monoid (mempty, mappend)
Text/Hamlet/RT.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DeriveDataTypeable #-} -- | Most everything exported here is exported also by "Text.Hamlet". The@@ -22,7 +23,12 @@ import Control.Failure import Text.Hamlet.Parse import Data.List (intercalate)+#if MIN_VERSION_blaze_html(0,5,0)+import Text.Blaze.Html (Html)+import Text.Blaze.Internal (preEscapedString, preEscapedText)+#else import Text.Blaze (preEscapedString, preEscapedText, Html)+#endif import Data.Text (Text)  type HamletMap url = [([String], HamletData url)]
hamlet.cabal view
@@ -1,5 +1,5 @@ name:            hamlet-version:         1.0.1+version:         1.0.1.1 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -39,18 +39,30 @@   test/tmp.hs   test.hs +flag blaze_html_0_5+    description: Use blaze-html 0.5 and blaze-markup 0.5+    default: False+ library     build-depends:   base             >= 4       && < 5                    , shakespeare      >= 1.0     && < 1.1                    , bytestring       >= 0.9     && < 0.10                    , template-haskell-                   , blaze-html       >= 0.4     && < 0.5                    , parsec           >= 2       && < 4                    , failure          >= 0.1     && < 0.3                    , text             >= 0.7     && < 0.12                    , containers       >= 0.2                    , blaze-builder    >= 0.2     && < 0.4                    , process          >= 1.0     && < 1.2++    if flag(blaze_html_0_5)+        build-depends:+                     blaze-html       >= 0.5     && < 0.6+                   , blaze-markup     >= 0.5.1   && < 0.6+    else+        build-depends:+                     blaze-html       >= 0.4     && < 0.5+     exposed-modules: Text.Hamlet                      Text.Hamlet.RT     other-modules:   Text.Hamlet.Parse@@ -71,7 +83,8 @@                  , text             >= 0.7     && < 1                  , HUnit                  , hspec            >= 0.8     && < 0.10-                 , blaze-html       >= 0.4     && < 0.5+                 , blaze-html       >= 0.5     && < 0.6+                 , blaze-markup     >= 0.5.1   && < 0.6   source-repository head
test/HamletTest.hs view
@@ -16,8 +16,9 @@ import Data.Text (Text, pack, unpack)
 import Data.Monoid (mappend)
 import qualified Data.Set as Set
-import qualified Text.Blaze.Renderer.Text
-import Text.Blaze (toHtml, preEscapedString)
+import qualified Text.Blaze.Html.Renderer.Text
+import Text.Blaze.Html (toHtml)
+import Text.Blaze.Internal (preEscapedString)
 
 specs = describe "hamlet"
   [ it "empty" caseEmpty
@@ -424,12 +425,12 @@ 
 helperHtml :: String -> Html -> Assertion
 helperHtml res h = do
-    let x = Text.Blaze.Renderer.Text.renderHtml h
+    let x = Text.Blaze.Html.Renderer.Text.renderHtml h
     T.pack res @=? x
 
 helper :: String -> HtmlUrl Url -> Assertion
 helper res h = do
-    let x = Text.Blaze.Renderer.Text.renderHtml $ h render
+    let x = Text.Blaze.Html.Renderer.Text.renderHtml $ h render
     T.pack res @=? x
 
 caseEmpty :: Assertion
@@ -788,7 +789,7 @@     helper "-123.456" [hamlet|#{show -123.456}|]
 
 helper' :: String -> Html -> Assertion
-helper' res h = T.pack res @=? Text.Blaze.Renderer.Text.renderHtml h
+helper' res h = T.pack res @=? Text.Blaze.Html.Renderer.Text.renderHtml h
 
 caseHamlet' :: Assertion
 caseHamlet' = do
@@ -833,7 +834,7 @@ 
 ihelper :: String -> HtmlUrlI18n Msg Url -> Assertion
 ihelper res h = do
-    let x = Text.Blaze.Renderer.Text.renderHtml $ h showMsg render
+    let x = Text.Blaze.Html.Renderer.Text.renderHtml $ h showMsg render
     T.pack res @=? x
   where
     showMsg Hello = preEscapedString "Hola"