on master help sign in
persistFile and parseRoutesFile
commit07bcb44e3e51c3735ca7e28441cb1b654dbc38e8 authorMichael Snoyman <michael@snoyman.com> dateFri 8 Apr 2011, 00:30 (16 years ago) parentf8b565b
2 files changed+5−2
wai-handler-devel.cabal+1−1 wai-handler-devel.hs+4−1
wai-handler-devel.cabal+1−1
@@ -1,5 +1,5 @@
11Name: wai-handler-devel
2−Version: 0.4.0
2+Version: 0.4.1
33Synopsis: WAI server that automatically reloads code after modification.
44Description: This handler automatically reloads your source code upon any changes. It works by using the hint package, essentially embedding GHC inside the handler. The handler (both the executable and library) takes three arguments: the port to listen on, the module name containing the application function, and the name of the function.
55 .
wai-handler-devel.hs+4−1
@@ -26,7 +26,7 @@ main = do
2626 } &= summary "WAI development web server"
2727 runQuit p m f $ if y then determineHamletDeps else (const $ return [])
2828
29−data TempType = Hamlet | Cassius | Lucius | Julius | Widget
29+data TempType = Hamlet | Cassius | Lucius | Julius | Widget | Verbatim
3030 deriving Show
3131
3232determineHamletDeps :: FilePath -> IO [FilePath]
@@ -39,6 +39,7 @@ determineHamletDeps x = do
3939 where
4040 go (Just (Hamlet, f)) = Just $ "hamlet/" ++ f ++ ".hamlet"
4141 go (Just (Widget, f)) = Just $ "hamlet/" ++ f ++ ".hamlet"
42+ go (Just (Verbatim, f)) = Just f
4243 go _ = Nothing
4344 parser = do
4445 ty <- (A.string "$(hamletFile " >> return Hamlet)
@@ -51,6 +52,8 @@ determineHamletDeps x = do
5152 <|> (A.string "$(Settings.luciusFile " >> return Lucius)
5253 <|> (A.string "$(Settings.juliusFile " >> return Julius)
5354 <|> (A.string "$(Settings.widgetFile " >> return Widget)
55+ <|> (A.string "$(persistFile " >> return Verbatim)
56+ <|> (A.string "$(parseRoutesFile " >> return Verbatim)
5457 A.skipWhile isSpace
5558 _ <- A.char '"'
5659 y <- A.many1 $ A.satisfy (/= '"')