shakespeare-js 1.0.0.4 → 1.0.0.5
raw patch · 4 files changed
+40/−4 lines, 4 filesdep ~hspecPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hspec
API changes (from Hackage documentation)
Files
- shakespeare-js.cabal +3/−2
- test.hs +1/−1
- test/Quoter.hs +35/−0
- test/ShakespeareJsTest.hs +1/−1
shakespeare-js.cabal view
@@ -1,5 +1,5 @@ name: shakespeare-js-version: 1.0.0.4+version: 1.0.0.5 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -58,6 +58,7 @@ test-suite test hs-source-dirs: test main-is: ../test.hs+ other-modules: Quoter type: exitcode-stdio-1.0 ghc-options: -Wall@@ -65,7 +66,7 @@ , shakespeare , base >= 4 && < 5 , HUnit- , hspec >= 0.8 && < 1.2+ , hspec >= 0.8 && < 1.3 , text >= 0.7 && < 0.12 , template-haskell
test.hs view
@@ -2,4 +2,4 @@ import ShakespeareJsTest (specs) main :: IO ()-main = hspecX specs+main = hspec specs
+ test/Quoter.hs view
@@ -0,0 +1,35 @@+{-# LANGUAGE CPP #-}+{-# OPTIONS_GHC -fno-warn-missing-fields #-}+module Quoter (quote, quoteFile, quoteFileReload) where++import Language.Haskell.TH.Syntax+import Language.Haskell.TH.Quote (QuasiQuoter (..))++#ifdef TEST_COFFEE+import Text.Coffee+import Text.Coffee (coffeeSettings)+import Text.Shakespeare (shakespeare)+#else+import Text.Julius+#endif++quote :: QuasiQuoter+quoteFile :: FilePath -> Q Exp+quoteFileReload :: FilePath -> Q Exp+#ifdef TEST_COFFEE+translate ('#':'{':rest) = translate $ '%':'{':translate rest+translate (c:other) = c:translate other+translate [] = []++quote = QuasiQuoter { quoteExp = \s -> do+ rs <- coffeeSettings+ quoteExp (shakespeare rs) (translate s)+ }++quoteFile = coffeeFile+quoteFileReload = coffeeFileReload+#else+quote = julius+quoteFile = juliusFile+quoteFileReload = juliusFileReload+#endif
test/ShakespeareJsTest.hs view
@@ -27,7 +27,7 @@ join = intercalate "\n" #endif -specs :: Specs +specs :: Spec specs = describe "shakespeare-js" $ do it "julius" $ do let var = "x=2"