yesod-bin 1.2.11 → 1.2.12
raw patch · 10 files changed
+211/−118 lines, 10 files
Files
- Devel.hs +1/−1
- Keter.hs +1/−1
- Scaffolding/Scaffolder.hs +0/−1
- hsfiles/mongo.hsfiles +34/−19
- hsfiles/mysql.hsfiles +35/−19
- hsfiles/postgres-fay.hsfiles +35/−19
- hsfiles/postgres.hsfiles +35/−19
- hsfiles/simple.hsfiles +34/−19
- hsfiles/sqlite.hsfiles +35/−19
- yesod-bin.cabal +1/−1
Devel.hs view
@@ -266,7 +266,7 @@ unless (anyTouched || haskellFileChanged) $ loop list1 if not success then liftIO $ do- putStrLn "Build failure, pausing..."+ putStrLn "\x1b[1;31mBuild failure, pausing...\x1b[0m" runBuildHook $ failHook opts else do liftIO $ runBuildHook $ successHook opts
Keter.hs view
@@ -7,7 +7,7 @@ import qualified Data.HashMap.Strict as Map import qualified Data.Text as T import System.Exit-import System.Cmd+import System.Process import Control.Monad import System.Directory import Data.Maybe (mapMaybe)
Scaffolding/Scaffolder.hs view
@@ -73,7 +73,6 @@ if validPackageName s && s /= "test" then Just s else Nothing- let dir = project puts $ renderTextUrl undefined $(textFile "input/database.cg")
hsfiles/mongo.hsfiles view
@@ -211,6 +211,13 @@ -- The page to be redirected to when authentication is required. authRoute _ = Just $ AuthR LoginR + -- Routes not requiring authenitcation.+ isAuthorized (AuthR _) _ = return Authorized+ isAuthorized FaviconR _ = return Authorized+ isAuthorized RobotsR _ = return Authorized+ -- Default to Authorized for now.+ isAuthorized _ _ = return Authorized+ -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows -- expiration dates to be set far in the future without worry of@@ -609,17 +616,21 @@ -- -- cabal repl --ghc-options="-O0 -fobject-code" --+-- run with:+--+-- :l DevelMain+-- DevelMain.update+-- -- You will need to add these packages to your .cabal file--- * foreign-store (very light-weight)+-- * foreign-store >= 0.1 (very light-weight) -- * warp (you already depend on this, it just isn't in your .cabal file) -- -- If you don't use cabal repl, you will need--- to run the following in GHCi or to add it to--- your .ghci file.+-- to add settings to your .ghci file. -- -- :set -DDEVELOPMENT ----- There is more information about this approach,+-- There is more information about using ghci -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci module DevelMain where@@ -633,27 +644,31 @@ import Network.Wai.Handler.Warp -- | Start or restart the server.+-- A Store holds onto some data across ghci reloads update :: IO () update = do- mtidStore <- lookupStore tid_1+ mtidStore <- lookupStore tidStoreNum case mtidStore of+ -- no server running Nothing -> do- done <- newEmptyMVar- _done_0 <- newStore done+ done <- storeAction doneStore newEmptyMVar tid <- start done- tidRef <- newIORef tid- _tid_1 <- newStore tidRef+ _ <- storeAction (Store tidStoreNum) (newIORef tid) return ()- Just tidStore -> do- tidRef <- readStore tidStore- tid <- readIORef tidRef- done <- readStore (Store done_0)- killThread tid- takeMVar done- newTid <- start done- writeIORef tidRef newTid- where tid_1 = 1- done_0 = 0+ -- server is already running+ Just tidStore ->+ -- shut the server down with killThread and wait for the done signal+ modifyStoredIORef tidStore $ \tid -> do+ killThread tid+ withStore doneStore takeMVar >> readStore doneStore >>= start+ where+ doneStore = Store 0+ tidStoreNum = 1++ modifyStoredIORef :: Store (IORef a) -> (a -> IO a) -> IO ()+ modifyStoredIORef store f = withStore store $ \ref -> do+ v <- readIORef ref+ f v >>= writeIORef ref -- | Start the server in a separate thread. start :: MVar () -- ^ Written to when the thread is killed.
hsfiles/mysql.hsfiles view
@@ -218,6 +218,13 @@ -- The page to be redirected to when authentication is required. authRoute _ = Just $ AuthR LoginR + -- Routes not requiring authenitcation.+ isAuthorized (AuthR _) _ = return Authorized+ isAuthorized FaviconR _ = return Authorized+ isAuthorized RobotsR _ = return Authorized+ -- Default to Authorized for now.+ isAuthorized _ _ = return Authorized+ -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows -- expiration dates to be set far in the future without worry of@@ -365,6 +372,7 @@ import Data.Text (Text) import Database.Persist.Quasi import Data.Typeable (Typeable)+import Prelude -- You can define all of your database entities in the entities file. -- You can find more information on persistent and how to declare entities@@ -612,17 +620,21 @@ -- -- cabal repl --ghc-options="-O0 -fobject-code" --+-- run with:+--+-- :l DevelMain+-- DevelMain.update+-- -- You will need to add these packages to your .cabal file--- * foreign-store (very light-weight)+-- * foreign-store >= 0.1 (very light-weight) -- * warp (you already depend on this, it just isn't in your .cabal file) -- -- If you don't use cabal repl, you will need--- to run the following in GHCi or to add it to--- your .ghci file.+-- to add settings to your .ghci file. -- -- :set -DDEVELOPMENT ----- There is more information about this approach,+-- There is more information about using ghci -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci module DevelMain where@@ -636,27 +648,31 @@ import Network.Wai.Handler.Warp -- | Start or restart the server.+-- A Store holds onto some data across ghci reloads update :: IO () update = do- mtidStore <- lookupStore tid_1+ mtidStore <- lookupStore tidStoreNum case mtidStore of+ -- no server running Nothing -> do- done <- newEmptyMVar- _done_0 <- newStore done+ done <- storeAction doneStore newEmptyMVar tid <- start done- tidRef <- newIORef tid- _tid_1 <- newStore tidRef+ _ <- storeAction (Store tidStoreNum) (newIORef tid) return ()- Just tidStore -> do- tidRef <- readStore tidStore- tid <- readIORef tidRef- done <- readStore (Store done_0)- killThread tid- takeMVar done- newTid <- start done- writeIORef tidRef newTid- where tid_1 = 1- done_0 = 0+ -- server is already running+ Just tidStore ->+ -- shut the server down with killThread and wait for the done signal+ modifyStoredIORef tidStore $ \tid -> do+ killThread tid+ withStore doneStore takeMVar >> readStore doneStore >>= start+ where+ doneStore = Store 0+ tidStoreNum = 1++ modifyStoredIORef :: Store (IORef a) -> (a -> IO a) -> IO ()+ modifyStoredIORef store f = withStore store $ \ref -> do+ v <- readIORef ref+ f v >>= writeIORef ref -- | Start the server in a separate thread. start :: MVar () -- ^ Written to when the thread is killed.
hsfiles/postgres-fay.hsfiles view
@@ -222,6 +222,13 @@ -- The page to be redirected to when authentication is required. authRoute _ = Just $ AuthR LoginR + -- Routes not requiring authenitcation.+ isAuthorized (AuthR _) _ = return Authorized+ isAuthorized FaviconR _ = return Authorized+ isAuthorized RobotsR _ = return Authorized+ -- Default to Authorized for now.+ isAuthorized _ _ = return Authorized+ -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows -- expiration dates to be set far in the future without worry of@@ -397,6 +404,7 @@ import Data.Text (Text) import Database.Persist.Quasi import Data.Typeable (Typeable)+import Prelude -- You can define all of your database entities in the entities file. -- You can find more information on persistent and how to declare entities@@ -661,17 +669,21 @@ -- -- cabal repl --ghc-options="-O0 -fobject-code" --+-- run with:+--+-- :l DevelMain+-- DevelMain.update+-- -- You will need to add these packages to your .cabal file--- * foreign-store (very light-weight)+-- * foreign-store >= 0.1 (very light-weight) -- * warp (you already depend on this, it just isn't in your .cabal file) -- -- If you don't use cabal repl, you will need--- to run the following in GHCi or to add it to--- your .ghci file.+-- to add settings to your .ghci file. -- -- :set -DDEVELOPMENT ----- There is more information about this approach,+-- There is more information about using ghci -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci module DevelMain where@@ -685,27 +697,31 @@ import Network.Wai.Handler.Warp -- | Start or restart the server.+-- A Store holds onto some data across ghci reloads update :: IO () update = do- mtidStore <- lookupStore tid_1+ mtidStore <- lookupStore tidStoreNum case mtidStore of+ -- no server running Nothing -> do- done <- newEmptyMVar- _done_0 <- newStore done+ done <- storeAction doneStore newEmptyMVar tid <- start done- tidRef <- newIORef tid- _tid_1 <- newStore tidRef+ _ <- storeAction (Store tidStoreNum) (newIORef tid) return ()- Just tidStore -> do- tidRef <- readStore tidStore- tid <- readIORef tidRef- done <- readStore (Store done_0)- killThread tid- takeMVar done- newTid <- start done- writeIORef tidRef newTid- where tid_1 = 1- done_0 = 0+ -- server is already running+ Just tidStore ->+ -- shut the server down with killThread and wait for the done signal+ modifyStoredIORef tidStore $ \tid -> do+ killThread tid+ withStore doneStore takeMVar >> readStore doneStore >>= start+ where+ doneStore = Store 0+ tidStoreNum = 1++ modifyStoredIORef :: Store (IORef a) -> (a -> IO a) -> IO ()+ modifyStoredIORef store f = withStore store $ \ref -> do+ v <- readIORef ref+ f v >>= writeIORef ref -- | Start the server in a separate thread. start :: MVar () -- ^ Written to when the thread is killed.
hsfiles/postgres.hsfiles view
@@ -218,6 +218,13 @@ -- The page to be redirected to when authentication is required. authRoute _ = Just $ AuthR LoginR + -- Routes not requiring authenitcation.+ isAuthorized (AuthR _) _ = return Authorized+ isAuthorized FaviconR _ = return Authorized+ isAuthorized RobotsR _ = return Authorized+ -- Default to Authorized for now.+ isAuthorized _ _ = return Authorized+ -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows -- expiration dates to be set far in the future without worry of@@ -365,6 +372,7 @@ import Data.Text (Text) import Database.Persist.Quasi import Data.Typeable (Typeable)+import Prelude -- You can define all of your database entities in the entities file. -- You can find more information on persistent and how to declare entities@@ -612,17 +620,21 @@ -- -- cabal repl --ghc-options="-O0 -fobject-code" --+-- run with:+--+-- :l DevelMain+-- DevelMain.update+-- -- You will need to add these packages to your .cabal file--- * foreign-store (very light-weight)+-- * foreign-store >= 0.1 (very light-weight) -- * warp (you already depend on this, it just isn't in your .cabal file) -- -- If you don't use cabal repl, you will need--- to run the following in GHCi or to add it to--- your .ghci file.+-- to add settings to your .ghci file. -- -- :set -DDEVELOPMENT ----- There is more information about this approach,+-- There is more information about using ghci -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci module DevelMain where@@ -636,27 +648,31 @@ import Network.Wai.Handler.Warp -- | Start or restart the server.+-- A Store holds onto some data across ghci reloads update :: IO () update = do- mtidStore <- lookupStore tid_1+ mtidStore <- lookupStore tidStoreNum case mtidStore of+ -- no server running Nothing -> do- done <- newEmptyMVar- _done_0 <- newStore done+ done <- storeAction doneStore newEmptyMVar tid <- start done- tidRef <- newIORef tid- _tid_1 <- newStore tidRef+ _ <- storeAction (Store tidStoreNum) (newIORef tid) return ()- Just tidStore -> do- tidRef <- readStore tidStore- tid <- readIORef tidRef- done <- readStore (Store done_0)- killThread tid- takeMVar done- newTid <- start done- writeIORef tidRef newTid- where tid_1 = 1- done_0 = 0+ -- server is already running+ Just tidStore ->+ -- shut the server down with killThread and wait for the done signal+ modifyStoredIORef tidStore $ \tid -> do+ killThread tid+ withStore doneStore takeMVar >> readStore doneStore >>= start+ where+ doneStore = Store 0+ tidStoreNum = 1++ modifyStoredIORef :: Store (IORef a) -> (a -> IO a) -> IO ()+ modifyStoredIORef store f = withStore store $ \ref -> do+ v <- readIORef ref+ f v >>= writeIORef ref -- | Start the server in a separate thread. start :: MVar () -- ^ Written to when the thread is killed.
hsfiles/simple.hsfiles view
@@ -196,6 +196,13 @@ Just $ uncurry (joinPath y (Settings.staticRoot $ settings y)) $ renderRoute s urlRenderOverride _ _ = Nothing + -- Routes not requiring authenitcation.+ isAuthorized (AuthR _) _ = return Authorized+ isAuthorized FaviconR _ = return Authorized+ isAuthorized RobotsR _ = return Authorized+ -- Default to Authorized for now.+ isAuthorized _ _ = return Authorized+ -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows -- expiration dates to be set far in the future without worry of@@ -531,17 +538,21 @@ -- -- cabal repl --ghc-options="-O0 -fobject-code" --+-- run with:+--+-- :l DevelMain+-- DevelMain.update+-- -- You will need to add these packages to your .cabal file--- * foreign-store (very light-weight)+-- * foreign-store >= 0.1 (very light-weight) -- * warp (you already depend on this, it just isn't in your .cabal file) -- -- If you don't use cabal repl, you will need--- to run the following in GHCi or to add it to--- your .ghci file.+-- to add settings to your .ghci file. -- -- :set -DDEVELOPMENT ----- There is more information about this approach,+-- There is more information about using ghci -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci module DevelMain where@@ -555,27 +566,31 @@ import Network.Wai.Handler.Warp -- | Start or restart the server.+-- A Store holds onto some data across ghci reloads update :: IO () update = do- mtidStore <- lookupStore tid_1+ mtidStore <- lookupStore tidStoreNum case mtidStore of+ -- no server running Nothing -> do- done <- newEmptyMVar- _done_0 <- newStore done+ done <- storeAction doneStore newEmptyMVar tid <- start done- tidRef <- newIORef tid- _tid_1 <- newStore tidRef+ _ <- storeAction (Store tidStoreNum) (newIORef tid) return ()- Just tidStore -> do- tidRef <- readStore tidStore- tid <- readIORef tidRef- done <- readStore (Store done_0)- killThread tid- takeMVar done- newTid <- start done- writeIORef tidRef newTid- where tid_1 = 1- done_0 = 0+ -- server is already running+ Just tidStore ->+ -- shut the server down with killThread and wait for the done signal+ modifyStoredIORef tidStore $ \tid -> do+ killThread tid+ withStore doneStore takeMVar >> readStore doneStore >>= start+ where+ doneStore = Store 0+ tidStoreNum = 1++ modifyStoredIORef :: Store (IORef a) -> (a -> IO a) -> IO ()+ modifyStoredIORef store f = withStore store $ \ref -> do+ v <- readIORef ref+ f v >>= writeIORef ref -- | Start the server in a separate thread. start :: MVar () -- ^ Written to when the thread is killed.
hsfiles/sqlite.hsfiles view
@@ -218,6 +218,13 @@ -- The page to be redirected to when authentication is required. authRoute _ = Just $ AuthR LoginR + -- Routes not requiring authenitcation.+ isAuthorized (AuthR _) _ = return Authorized+ isAuthorized FaviconR _ = return Authorized+ isAuthorized RobotsR _ = return Authorized+ -- Default to Authorized for now.+ isAuthorized _ _ = return Authorized+ -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows -- expiration dates to be set far in the future without worry of@@ -365,6 +372,7 @@ import Data.Text (Text) import Database.Persist.Quasi import Data.Typeable (Typeable)+import Prelude -- You can define all of your database entities in the entities file. -- You can find more information on persistent and how to declare entities@@ -612,17 +620,21 @@ -- -- cabal repl --ghc-options="-O0 -fobject-code" --+-- run with:+--+-- :l DevelMain+-- DevelMain.update+-- -- You will need to add these packages to your .cabal file--- * foreign-store (very light-weight)+-- * foreign-store >= 0.1 (very light-weight) -- * warp (you already depend on this, it just isn't in your .cabal file) -- -- If you don't use cabal repl, you will need--- to run the following in GHCi or to add it to--- your .ghci file.+-- to add settings to your .ghci file. -- -- :set -DDEVELOPMENT ----- There is more information about this approach,+-- There is more information about using ghci -- on the wiki: https://github.com/yesodweb/yesod/wiki/ghci module DevelMain where@@ -636,27 +648,31 @@ import Network.Wai.Handler.Warp -- | Start or restart the server.+-- A Store holds onto some data across ghci reloads update :: IO () update = do- mtidStore <- lookupStore tid_1+ mtidStore <- lookupStore tidStoreNum case mtidStore of+ -- no server running Nothing -> do- done <- newEmptyMVar- _done_0 <- newStore done+ done <- storeAction doneStore newEmptyMVar tid <- start done- tidRef <- newIORef tid- _tid_1 <- newStore tidRef+ _ <- storeAction (Store tidStoreNum) (newIORef tid) return ()- Just tidStore -> do- tidRef <- readStore tidStore- tid <- readIORef tidRef- done <- readStore (Store done_0)- killThread tid- takeMVar done- newTid <- start done- writeIORef tidRef newTid- where tid_1 = 1- done_0 = 0+ -- server is already running+ Just tidStore ->+ -- shut the server down with killThread and wait for the done signal+ modifyStoredIORef tidStore $ \tid -> do+ killThread tid+ withStore doneStore takeMVar >> readStore doneStore >>= start+ where+ doneStore = Store 0+ tidStoreNum = 1++ modifyStoredIORef :: Store (IORef a) -> (a -> IO a) -> IO ()+ modifyStoredIORef store f = withStore store $ \ref -> do+ v <- readIORef ref+ f v >>= writeIORef ref -- | Start the server in a separate thread. start :: MVar () -- ^ Written to when the thread is killed.
yesod-bin.cabal view
@@ -1,5 +1,5 @@ name: yesod-bin-version: 1.2.11+version: 1.2.12 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>