From 3848b23ca5257330bcc361131d8ed5e1edc4ce48 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 21 Sep 2014 13:12:59 +0300 Subject: [PATCH] Updated scaffolding --- yesod-bin/hsfiles/mongo.hsfiles | 19 +++++++++++++------ yesod-bin/hsfiles/mysql.hsfiles | 19 +++++++++++++------ yesod-bin/hsfiles/postgres-fay.hsfiles | 20 ++++++++++++++------ yesod-bin/hsfiles/postgres.hsfiles | 19 +++++++++++++------ yesod-bin/hsfiles/simple.hsfiles | 17 +++++++++++------ yesod-bin/hsfiles/sqlite.hsfiles | 19 +++++++++++++------ 6 files changed, 77 insertions(+), 36 deletions(-) diff --git a/yesod-bin/hsfiles/mongo.hsfiles b/yesod-bin/hsfiles/mongo.hsfiles index 073ef1c8..465139f1 100644 --- a/yesod-bin/hsfiles/mongo.hsfiles +++ b/yesod-bin/hsfiles/mongo.hsfiles @@ -96,7 +96,14 @@ makeFoundation conf = do (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter - foundation = App conf s p manager dbconf logger + foundation = App + { settings = conf + , getStatic = s + , connPool = p + , httpManager = manager + , persistConfig = dbconf + , appLogger = logger + } return foundation @@ -453,7 +460,7 @@ executable PROJECTNAME test-suite test type: exitcode-stdio-1.0 main-is: main.hs - hs-source-dirs: tests + hs-source-dirs: test ghc-options: -Wall build-depends: base @@ -8021,7 +8028,7 @@ h2##{aDomId} { color: #990 } -{-# START_FILE tests/HomeTest.hs #-} +{-# START_FILE test/HomeTest.hs #-} {-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs @@ -8043,7 +8050,7 @@ homeSpecs = setMethod "POST" setUrl HomeR addNonce - fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference + fileByLabel "Choose a file" "test/main.hs" "text/plain" -- talk about self-reference byLabel "What's on the file?" "Some Content" statusIs 200 @@ -8061,7 +8068,7 @@ homeSpecs = users <- runDB $ selectList ([] :: [Filter User]) [] assertEqual "user table empty" 0 $ L.length users -{-# START_FILE tests/TestImport.hs #-} +{-# START_FILE test/TestImport.hs #-} {-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test @@ -8091,7 +8098,7 @@ runDB query = do pool <- fmap connPool getTestYesod liftIO $ runResourceT $ runNoLoggingT $ runMongoDBPoolDef query pool -{-# START_FILE tests/main.hs #-} +{-# START_FILE test/main.hs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/yesod-bin/hsfiles/mysql.hsfiles b/yesod-bin/hsfiles/mysql.hsfiles index 37b32749..337bbeef 100644 --- a/yesod-bin/hsfiles/mysql.hsfiles +++ b/yesod-bin/hsfiles/mysql.hsfiles @@ -98,7 +98,14 @@ makeFoundation conf = do (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter - foundation = App conf s p manager dbconf logger + foundation = App + { settings = conf + , getStatic = s + , connPool = p + , httpManager = manager + , persistConfig = dbconf + , appLogger = logger + } -- Perform database migration using our application's logging settings. runLoggingT @@ -459,7 +466,7 @@ executable PROJECTNAME test-suite test type: exitcode-stdio-1.0 main-is: main.hs - hs-source-dirs: tests + hs-source-dirs: test ghc-options: -Wall build-depends: base @@ -8036,7 +8043,7 @@ h2##{aDomId} { color: #990 } -{-# START_FILE tests/HomeTest.hs #-} +{-# START_FILE test/HomeTest.hs #-} {-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs @@ -8058,7 +8065,7 @@ homeSpecs = setMethod "POST" setUrl HomeR addNonce - fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference + fileByLabel "Choose a file" "test/main.hs" "text/plain" -- talk about self-reference byLabel "What's on the file?" "Some Content" statusIs 200 @@ -8076,7 +8083,7 @@ homeSpecs = users <- runDB $ selectList ([] :: [Filter User]) [] assertEqual "user table empty" 0 $ L.length users -{-# START_FILE tests/TestImport.hs #-} +{-# START_FILE test/TestImport.hs #-} {-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test @@ -8104,7 +8111,7 @@ runDB query = do pool <- fmap connPool getTestYesod liftIO $ runSqlPersistMPool query pool -{-# START_FILE tests/main.hs #-} +{-# START_FILE test/main.hs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/yesod-bin/hsfiles/postgres-fay.hsfiles b/yesod-bin/hsfiles/postgres-fay.hsfiles index 22251e2f..27e6841b 100644 --- a/yesod-bin/hsfiles/postgres-fay.hsfiles +++ b/yesod-bin/hsfiles/postgres-fay.hsfiles @@ -101,7 +101,15 @@ makeFoundation conf = do (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter - foundation = App conf s p manager dbconf onCommand logger + foundation = App + { settings = conf + , getStatic = s + , connPool = p + , httpManager = manager + , persistConfig = dbconf + , fayCommandHandler = onCommand + , appLogger = logger + } -- Perform database migration using our application's logging settings. runLoggingT @@ -496,7 +504,7 @@ executable PROJECTNAME test-suite test type: exitcode-stdio-1.0 main-is: main.hs - hs-source-dirs: tests + hs-source-dirs: test ghc-options: -Wall build-depends: base @@ -8148,7 +8156,7 @@ h2##{aDomId} { color: #990 } -{-# START_FILE tests/HomeTest.hs #-} +{-# START_FILE test/HomeTest.hs #-} {-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs @@ -8170,7 +8178,7 @@ homeSpecs = setMethod "POST" setUrl HomeR addNonce - fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference + fileByLabel "Choose a file" "test/main.hs" "text/plain" -- talk about self-reference byLabel "What's on the file?" "Some Content" statusIs 200 @@ -8188,7 +8196,7 @@ homeSpecs = users <- runDB $ selectList ([] :: [Filter User]) [] assertEqual "user table empty" 0 $ L.length users -{-# START_FILE tests/TestImport.hs #-} +{-# START_FILE test/TestImport.hs #-} {-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test @@ -8216,7 +8224,7 @@ runDB query = do pool <- fmap connPool getTestYesod liftIO $ runSqlPersistMPool query pool -{-# START_FILE tests/main.hs #-} +{-# START_FILE test/main.hs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/yesod-bin/hsfiles/postgres.hsfiles b/yesod-bin/hsfiles/postgres.hsfiles index 221ac810..863b5dc8 100644 --- a/yesod-bin/hsfiles/postgres.hsfiles +++ b/yesod-bin/hsfiles/postgres.hsfiles @@ -98,7 +98,14 @@ makeFoundation conf = do (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter - foundation = App conf s p manager dbconf logger + foundation = App + { settings = conf + , getStatic = s + , connPool = p + , httpManager = manager + , persistConfig = dbconf + , appLogger = logger + } -- Perform database migration using our application's logging settings. runLoggingT @@ -459,7 +466,7 @@ executable PROJECTNAME test-suite test type: exitcode-stdio-1.0 main-is: main.hs - hs-source-dirs: tests + hs-source-dirs: test ghc-options: -Wall build-depends: base @@ -8036,7 +8043,7 @@ h2##{aDomId} { color: #990 } -{-# START_FILE tests/HomeTest.hs #-} +{-# START_FILE test/HomeTest.hs #-} {-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs @@ -8058,7 +8065,7 @@ homeSpecs = setMethod "POST" setUrl HomeR addNonce - fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference + fileByLabel "Choose a file" "test/main.hs" "text/plain" -- talk about self-reference byLabel "What's on the file?" "Some Content" statusIs 200 @@ -8076,7 +8083,7 @@ homeSpecs = users <- runDB $ selectList ([] :: [Filter User]) [] assertEqual "user table empty" 0 $ L.length users -{-# START_FILE tests/TestImport.hs #-} +{-# START_FILE test/TestImport.hs #-} {-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test @@ -8104,7 +8111,7 @@ runDB query = do pool <- fmap connPool getTestYesod liftIO $ runSqlPersistMPool query pool -{-# START_FILE tests/main.hs #-} +{-# START_FILE test/main.hs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/yesod-bin/hsfiles/simple.hsfiles b/yesod-bin/hsfiles/simple.hsfiles index 59ecdaba..90408143 100644 --- a/yesod-bin/hsfiles/simple.hsfiles +++ b/yesod-bin/hsfiles/simple.hsfiles @@ -89,7 +89,12 @@ makeFoundation conf = do (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter - foundation = App conf s manager logger + foundation = App + { settings = conf + , getStatic = s + , httpManager = manager + , appLogger = logger + } return foundation @@ -383,7 +388,7 @@ executable PROJECTNAME test-suite test type: exitcode-stdio-1.0 main-is: main.hs - hs-source-dirs: tests + hs-source-dirs: test ghc-options: -Wall build-depends: base @@ -7901,7 +7906,7 @@ h2##{aDomId} { color: #990 } -{-# START_FILE tests/HomeTest.hs #-} +{-# START_FILE test/HomeTest.hs #-} {-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs @@ -7922,7 +7927,7 @@ homeSpecs = setMethod "POST" setUrl HomeR addNonce - fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference + fileByLabel "Choose a file" "test/main.hs" "text/plain" -- talk about self-reference byLabel "What's on the file?" "Some Content" statusIs 200 @@ -7931,7 +7936,7 @@ homeSpecs = htmlAllContain ".message" "Some Content" htmlAllContain ".message" "text/plain" -{-# START_FILE tests/TestImport.hs #-} +{-# START_FILE test/TestImport.hs #-} {-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test @@ -7946,7 +7951,7 @@ import Foundation type Spec = YesodSpec App type Example = YesodExample App -{-# START_FILE tests/main.hs #-} +{-# START_FILE test/main.hs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-orphans #-} diff --git a/yesod-bin/hsfiles/sqlite.hsfiles b/yesod-bin/hsfiles/sqlite.hsfiles index 11017119..a033df72 100644 --- a/yesod-bin/hsfiles/sqlite.hsfiles +++ b/yesod-bin/hsfiles/sqlite.hsfiles @@ -98,7 +98,14 @@ makeFoundation conf = do (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter - foundation = App conf s p manager dbconf logger + foundation = App + { settings = conf + , getStatic = s + , connPool = p + , httpManager = manager + , persistConfig = dbconf + , appLogger = logger + } -- Perform database migration using our application's logging settings. runLoggingT @@ -459,7 +466,7 @@ executable PROJECTNAME test-suite test type: exitcode-stdio-1.0 main-is: main.hs - hs-source-dirs: tests + hs-source-dirs: test ghc-options: -Wall build-depends: base @@ -8023,7 +8030,7 @@ h2##{aDomId} { color: #990 } -{-# START_FILE tests/HomeTest.hs #-} +{-# START_FILE test/HomeTest.hs #-} {-# LANGUAGE OverloadedStrings #-} module HomeTest ( homeSpecs @@ -8045,7 +8052,7 @@ homeSpecs = setMethod "POST" setUrl HomeR addNonce - fileByLabel "Choose a file" "tests/main.hs" "text/plain" -- talk about self-reference + fileByLabel "Choose a file" "test/main.hs" "text/plain" -- talk about self-reference byLabel "What's on the file?" "Some Content" statusIs 200 @@ -8063,7 +8070,7 @@ homeSpecs = users <- runDB $ selectList ([] :: [Filter User]) [] assertEqual "user table empty" 0 $ L.length users -{-# START_FILE tests/TestImport.hs #-} +{-# START_FILE test/TestImport.hs #-} {-# LANGUAGE OverloadedStrings #-} module TestImport ( module Yesod.Test @@ -8091,7 +8098,7 @@ runDB query = do pool <- fmap connPool getTestYesod liftIO $ runSqlPersistMPool query pool -{-# START_FILE tests/main.hs #-} +{-# START_FILE test/main.hs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoMonomorphismRestriction #-} {-# OPTIONS_GHC -fno-warn-orphans #-}