on master help sign in
persistFile and parseRoutesFile
07bcb44Michael Snoyman
wai-handler-devel.cabal+1−1
@@ -1,5 +1,5 @@
1Name: wai-handler-devel
1Name: wai-handler-devel
2−Version: 0.4.0
2+Version: 0.4.1
3Synopsis: WAI server that automatically reloads code after modification.
3Synopsis: WAI server that automatically reloads code after modification.
4Description: 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.
4Description: 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.
5 .
5 .
wai-handler-devel.hs+4−1
@@ -26,7 +26,7 @@ main = do
26 } &= summary "WAI development web server"
26 } &= summary "WAI development web server"
27 runQuit p m f $ if y then determineHamletDeps else (const $ return [])
27 runQuit p m f $ if y then determineHamletDeps else (const $ return [])
28
28
29−data TempType = Hamlet | Cassius | Lucius | Julius | Widget
29+data TempType = Hamlet | Cassius | Lucius | Julius | Widget | Verbatim
30 deriving Show
30 deriving Show
31
31
32determineHamletDeps :: FilePath -> IO [FilePath]
32determineHamletDeps :: FilePath -> IO [FilePath]
@@ -39,6 +39,7 @@ determineHamletDeps x = do
39 where
39 where
40 go (Just (Hamlet, f)) = Just $ "hamlet/" ++ f ++ ".hamlet"
40 go (Just (Hamlet, f)) = Just $ "hamlet/" ++ f ++ ".hamlet"
41 go (Just (Widget, f)) = Just $ "hamlet/" ++ f ++ ".hamlet"
41 go (Just (Widget, f)) = Just $ "hamlet/" ++ f ++ ".hamlet"
42+ go (Just (Verbatim, f)) = Just f
42 go _ = Nothing
43 go _ = Nothing
43 parser = do
44 parser = do
44 ty <- (A.string "$(hamletFile " >> return Hamlet)
45 ty <- (A.string "$(hamletFile " >> return Hamlet)
@@ -51,6 +52,8 @@ determineHamletDeps x = do
51 <|> (A.string "$(Settings.luciusFile " >> return Lucius)
52 <|> (A.string "$(Settings.luciusFile " >> return Lucius)
52 <|> (A.string "$(Settings.juliusFile " >> return Julius)
53 <|> (A.string "$(Settings.juliusFile " >> return Julius)
53 <|> (A.string "$(Settings.widgetFile " >> return Widget)
54 <|> (A.string "$(Settings.widgetFile " >> return Widget)
55+ <|> (A.string "$(persistFile " >> return Verbatim)
56+ <|> (A.string "$(parseRoutesFile " >> return Verbatim)
54 A.skipWhile isSpace
57 A.skipWhile isSpace
55 _ <- A.char '"'
58 _ <- A.char '"'
56 y <- A.many1 $ A.satisfy (/= '"')
59 y <- A.many1 $ A.satisfy (/= '"')