Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stepcut committed Feb 7, 2012
2 parents 214772d + 0a4014f commit 1e13dc0
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 9 deletions.
4 changes: 4 additions & 0 deletions hamlet/Text/Hamlet.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleContexts #-}
Expand Down Expand Up @@ -246,6 +247,9 @@ hamletFromString qhr set s = do

hamletFileWithSettings :: Q HamletRules -> HamletSettings -> FilePath -> Q Exp
hamletFileWithSettings qhr set fp = do
#ifdef GHC_7_4
qAddDependentFile fp
#endif
contents <- fmap TL.unpack $ qRunIO $ readUtf8File fp
hamletFromString qhr set contents

Expand Down
2 changes: 2 additions & 0 deletions hamlet/hamlet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ library
Text.Hamlet.RT
other-modules: Text.Hamlet.Parse
ghc-options: -Wall
if impl(ghc >= 7.4)
cpp-options: -DGHC_7_4

test-suite test
hs-source-dirs: test
Expand Down
2 changes: 1 addition & 1 deletion scripts
Submodule scripts updated 1 files
+1 −1 install
8 changes: 4 additions & 4 deletions servius/servius.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: servius
Version: 0.0.1
Version: 0.0.2
Synopsis: Serve Shakespearean templates via Warp
Homepage: http://github.com/yesodweb/hamlet
License: BSD3
Expand All @@ -15,9 +15,9 @@ Description: Does not support any variable interpolation. Supports Hamle
Executable servius
Main-is: servius.hs
Build-depends: base >= 4 && < 5
, warp >= 1.0 && < 1.1
, wai-app-static >= 1.0 && < 1.1
, wai-extra >= 1.0 && < 1.1
, warp >= 1.1 && < 1.2
, wai-app-static >= 1.1 && < 1.2
, wai-extra >= 1.1 && < 1.2
, cmdargs >= 0.6.7
, directory >= 1.0
, containers >= 0.2 && < 0.5
Expand Down
3 changes: 3 additions & 0 deletions shakespeare-css/Text/Cassius.hs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ cassiusFromString s =

cassiusFile :: FilePath -> Q Exp
cassiusFile fp = do
#ifdef GHC_7_4
qAddDependentFile fp
#endif
contents <- fmap TL.unpack $ qRunIO $ readUtf8File fp
cassiusFromString contents

Expand Down
3 changes: 3 additions & 0 deletions shakespeare-css/Text/Css.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ data CDData url = CDPlain Builder
cssFileDebug :: Q Exp -> Parser [TopLevel] -> FilePath -> Q Exp
cssFileDebug parseBlocks' parseBlocks fp = do
s <- fmap TL.unpack $ qRunIO $ readUtf8File fp
#ifdef GHC_7_4
qAddDependentFile fp
#endif
let a = either (error . show) id $ parse parseBlocks s s
let (scope, contents) = go a
vs <- mapM (getVars scope) contents
Expand Down
2 changes: 2 additions & 0 deletions shakespeare-css/shakespeare-css.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ library
other-modules: Text.MkSizeType
Text.Css
ghc-options: -Wall
if impl(ghc >= 7.4)
cpp-options: -DGHC_7_4

test-suite test
hs-source-dirs: test
Expand Down
2 changes: 2 additions & 0 deletions shakespeare-js/shakespeare-js.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ library
Text.Julius
Text.Coffee
ghc-options: -Wall
if impl(ghc >= 7.4)
cpp-options: -DGHC_7_4

if flag(test_coffee)
cpp-options: -DTEST_COFFEE
Expand Down
11 changes: 8 additions & 3 deletions shakespeare-test/shakespeare-test.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build-type: Simple
homepage: http://www.yesodweb.com/book/templates

extra-source-files:
test/main.hs
main.hs

library
exposed-modules:
Expand All @@ -32,6 +32,8 @@ library

ghc-options: -Wall
cpp-options: -DTEST -DTEST_EXPORT
if impl(ghc >= 7.4)
cpp-options: -DGHC_7_4

flag test_coffee
description: render tests through coffeescript render function
Expand All @@ -51,8 +53,11 @@ test-suite test
, template-haskell
, parsec >= 2 && < 4

if flag(test_coffee)
cpp-options: -DTEST_COFFEE
-- if impl(ghc >= 7.4)
-- cpp-options: -DGHC_7_4

--if flag(test_coffee)
-- cpp-options: -DTEST_COFFEE


source-repository head
Expand Down
2 changes: 2 additions & 0 deletions shakespeare-text/shakespeare-text.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ library

exposed-modules: Text.Shakespeare.Text
ghc-options: -Wall
if impl(ghc >= 7.4)
cpp-options: -DGHC_7_4

test-suite test
hs-source-dirs: test
Expand Down
6 changes: 5 additions & 1 deletion shakespeare/Text/Shakespeare.hs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ shakespeareFromString r str = do
contentsToShakespeare r $ contentFromString r $ s

shakespeareFile :: ShakespeareSettings -> FilePath -> Q Exp
shakespeareFile r fp = readFileQ fp >>= shakespeareFromString r
shakespeareFile r fp = do
#ifdef GHC_7_4
qAddDependentFile fp
#endif
readFileQ fp >>= shakespeareFromString r

data VarType = VTPlain | VTUrl | VTUrlParam | VTMixin

Expand Down

0 comments on commit 1e13dc0

Please sign in to comment.