From 678288db1387b4f92aee7846e3144b3c996903c0 Mon Sep 17 00:00:00 2001 From: Greg Weber Date: Sun, 21 Aug 2011 22:36:00 -0700 Subject: [PATCH] Handler->Application, ~sitearg~.hs->Foundation.hs --- yesod/Scaffold/Devel.hs | 2 +- yesod/scaffold.hs | 6 +++--- yesod/scaffold/{Handler.hs.cg => Application.hs.cg} | 6 +++--- yesod/scaffold/{sitearg.hs.cg => Foundation.hs.cg} | 2 +- yesod/scaffold/Handler/Root.hs.cg | 2 +- yesod/scaffold/config/Settings.hs.cg | 8 ++++---- yesod/scaffold/main.hs.cg | 2 +- yesod/scaffold/project.cabal.cg | 4 ++-- .../scaffold/tiny/{Handler.hs.cg => Application.hs.cg} | 4 ++-- .../scaffold/tiny/{sitearg.hs.cg => Foundation.hs.cg} | 2 +- yesod/scaffold/tiny/{cabal.cg => project.cabal.cg} | 2 +- yesod/test/run.sh | 2 +- yesod/test/scaffold.shelltest | 2 +- yesod/yesod.cabal | 10 +++++----- 14 files changed, 27 insertions(+), 27 deletions(-) rename yesod/scaffold/{Handler.hs.cg => Application.hs.cg} (95%) rename yesod/scaffold/{sitearg.hs.cg => Foundation.hs.cg} (99%) rename yesod/scaffold/tiny/{Handler.hs.cg => Application.hs.cg} (95%) rename yesod/scaffold/tiny/{sitearg.hs.cg => Foundation.hs.cg} (99%) rename yesod/scaffold/tiny/{cabal.cg => project.cabal.cg} (98%) diff --git a/yesod/Scaffold/Devel.hs b/yesod/Scaffold/Devel.hs index 1b42d6b9..1353d0cb 100644 --- a/yesod/Scaffold/Devel.hs +++ b/yesod/Scaffold/Devel.hs @@ -83,7 +83,7 @@ devel cabalCmd = do , concat [ "import \"" , pi' - , "\" Handler (withDevelAppPort)" + , "\" Application (withDevelAppPort)" ] , "import Data.Dynamic (fromDynamic)" , "import Network.Wai.Handler.Warp (run)" diff --git a/yesod/scaffold.hs b/yesod/scaffold.hs index bc227e60..822a67b6 100644 --- a/yesod/scaffold.hs +++ b/yesod/scaffold.hs @@ -158,11 +158,11 @@ scaffold = do writeFile' ("config/settings.yml") $(codegen "config/settings.yml") writeFile' ("main.hs") $(codegen "main.hs") - writeFile' (project ++ ".cabal") $ ifTiny $(codegen "tiny/cabal") $(codegen "project.cabal") + writeFile' (project ++ ".cabal") $ ifTiny $(codegen "tiny/project.cabal") $(codegen "project.cabal") writeFile' ".ghci" $(codegen ".ghci") writeFile' "LICENSE" $(codegen "LICENSE") - writeFile' (sitearg ++ ".hs") $ ifTiny $(codegen "tiny/sitearg.hs") $(codegen "sitearg.hs") - writeFile' "Handler.hs" $ ifTiny $(codegen "tiny/Handler.hs") $(codegen "Handler.hs") + writeFile' ("Foundation.hs") $ ifTiny $(codegen "tiny/Foundation.hs") $(codegen "Foundation.hs") + writeFile' "Application.hs" $ ifTiny $(codegen "tiny/Application.hs") $(codegen "Application.hs") writeFile' "Handler/Root.hs" $ ifTiny $(codegen "tiny/Handler/Root.hs") $(codegen "Handler/Root.hs") unless isTiny $ writeFile' "Model.hs" $(codegen "Model.hs") writeFile' "config/Settings.hs" $ ifTiny $(codegen "tiny/config/Settings.hs") $(codegen "config/Settings.hs") diff --git a/yesod/scaffold/Handler.hs.cg b/yesod/scaffold/Application.hs.cg similarity index 95% rename from yesod/scaffold/Handler.hs.cg rename to yesod/scaffold/Application.hs.cg index 7b1c5d2d..18b6ec22 100644 --- a/yesod/scaffold/Handler.hs.cg +++ b/yesod/scaffold/Application.hs.cg @@ -3,12 +3,12 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -module Handler +module Application ( with~sitearg~ , withDevelAppPort ) where -import ~sitearg~ +import Foundation import Settings import Yesod.Static import Yesod.Auth @@ -27,7 +27,7 @@ import Control.Concurrent.MVar (newEmptyMVar, putMVar, takeMVar) import Handler.Root -- This line actually creates our YesodSite instance. It is the second half --- of the call to mkYesodData which occurs in ~sitearg~.hs. Please see +-- of the call to mkYesodData which occurs in Foundation.hs. Please see -- the comments there for more details. mkYesodDispatch "~sitearg~" resources~sitearg~ diff --git a/yesod/scaffold/sitearg.hs.cg b/yesod/scaffold/Foundation.hs.cg similarity index 99% rename from yesod/scaffold/sitearg.hs.cg rename to yesod/scaffold/Foundation.hs.cg index 0ab402f8..163912df 100644 --- a/yesod/scaffold/sitearg.hs.cg +++ b/yesod/scaffold/Foundation.hs.cg @@ -1,6 +1,6 @@ {-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-} {-# LANGUAGE OverloadedStrings, MultiParamTypeClasses #-} -module ~sitearg~ +module Foundation ( ~sitearg~ (..) , ~sitearg~Route (..) , resources~sitearg~ diff --git a/yesod/scaffold/Handler/Root.hs.cg b/yesod/scaffold/Handler/Root.hs.cg index cb0375e7..99bf711d 100644 --- a/yesod/scaffold/Handler/Root.hs.cg +++ b/yesod/scaffold/Handler/Root.hs.cg @@ -1,7 +1,7 @@ {-# LANGUAGE TemplateHaskell, QuasiQuotes, OverloadedStrings #-} module Handler.Root where -import ~sitearg~ +import Foundation -- This is a handler function for the GET request method on the RootR -- resource pattern. All of your resource patterns are defined in diff --git a/yesod/scaffold/config/Settings.hs.cg b/yesod/scaffold/config/Settings.hs.cg index ecea4ac6..60715302 100644 --- a/yesod/scaffold/config/Settings.hs.cg +++ b/yesod/scaffold/config/Settings.hs.cg @@ -5,7 +5,7 @@ -- includes database connection settings, static file locations, etc. -- In addition, you can configure a number of different aspects of Yesod -- by overriding methods in the Yesod typeclass. That instance is --- declared in the ~sitearg~.hs file. +-- declared in the Foundation.hs file. module Settings ( hamletFile , cassiusFile @@ -49,7 +49,7 @@ data AppEnvironment = Test -- Use dynamic settings to avoid the need to re-compile the application (between staging and production environments). -- -- By convention these settings should be overwritten by any command line arguments. --- See config/~sitearg~.hs for command line arguments +-- See config/Foundation.hs for command line arguments -- Command line arguments provide some convenience but are also required for hosting situations where a setting is read from the environment (appPort on Heroku). -- data AppConfig = AppConfig { @@ -111,10 +111,10 @@ staticDir = "static" -- please see: -- http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain -- --- If you change the resource pattern for StaticR in ~sitearg~.hs, you will +-- If you change the resource pattern for StaticR in Foundation.hs, you will -- have to make a corresponding change here. -- --- To see how this value is used, see urlRenderOverride in ~sitearg~.hs +-- To see how this value is used, see urlRenderOverride in Foundation.hs staticRoot :: AppConfig -> Text staticRoot conf = [st|#{appRoot conf}/static|] diff --git a/yesod/scaffold/main.hs.cg b/yesod/scaffold/main.hs.cg index 25692ff6..6b617b96 100644 --- a/yesod/scaffold/main.hs.cg +++ b/yesod/scaffold/main.hs.cg @@ -1,7 +1,7 @@ {-# LANGUAGE CPP, DeriveDataTypeable #-} import qualified Settings as Settings import Settings (AppConfig(..)) -import Handler (with~sitearg~) +import Application (with~sitearg~) import Network.Wai.Handler.Warp (run) import System.Console.CmdArgs hiding (args) import Data.Char (toUpper, toLower) diff --git a/yesod/scaffold/project.cabal.cg b/yesod/scaffold/project.cabal.cg index 490a11c2..6269fb0a 100644 --- a/yesod/scaffold/project.cabal.cg +++ b/yesod/scaffold/project.cabal.cg @@ -25,9 +25,9 @@ library Buildable: True else Buildable: False - exposed-modules: Handler + exposed-modules: Application hs-source-dirs: ., config - other-modules: ~sitearg~ + other-modules: Foundation Model Settings StaticFiles diff --git a/yesod/scaffold/tiny/Handler.hs.cg b/yesod/scaffold/tiny/Application.hs.cg similarity index 95% rename from yesod/scaffold/tiny/Handler.hs.cg rename to yesod/scaffold/tiny/Application.hs.cg index 41de5c45..d5678325 100644 --- a/yesod/scaffold/tiny/Handler.hs.cg +++ b/yesod/scaffold/tiny/Application.hs.cg @@ -7,7 +7,7 @@ module Handler , withDevelApp ) where -import ~sitearg~ +import Foundation import Settings import Yesod.Static import Yesod.Logger (makeLogger, flushLogger, Logger) @@ -19,7 +19,7 @@ import Data.Dynamic (Dynamic, toDyn) import Handler.Root -- This line actually creates our YesodSite instance. It is the second half --- of the call to mkYesodData which occurs in ~sitearg~.hs. Please see +-- of the call to mkYesodData which occurs in Foundation.hs. Please see -- the comments there for more details. mkYesodDispatch "~sitearg~" resources~sitearg~ diff --git a/yesod/scaffold/tiny/sitearg.hs.cg b/yesod/scaffold/tiny/Foundation.hs.cg similarity index 99% rename from yesod/scaffold/tiny/sitearg.hs.cg rename to yesod/scaffold/tiny/Foundation.hs.cg index f8060d0c..4b2565be 100644 --- a/yesod/scaffold/tiny/sitearg.hs.cg +++ b/yesod/scaffold/tiny/Foundation.hs.cg @@ -1,6 +1,6 @@ {-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} -module ~sitearg~ +module Foundation ( ~sitearg~ (..) , ~sitearg~Route (..) , resources~sitearg~ diff --git a/yesod/scaffold/tiny/cabal.cg b/yesod/scaffold/tiny/project.cabal.cg similarity index 98% rename from yesod/scaffold/tiny/cabal.cg rename to yesod/scaffold/tiny/project.cabal.cg index 216aec13..dff2880d 100644 --- a/yesod/scaffold/tiny/cabal.cg +++ b/yesod/scaffold/tiny/project.cabal.cg @@ -27,7 +27,7 @@ library Buildable: False exposed-modules: Handler hs-source-dirs: ., config - other-modules: ~sitearg~ + other-modules: Foundation Settings StaticFiles Handler.Root diff --git a/yesod/test/run.sh b/yesod/test/run.sh index b65da6d8..942337aa 100755 --- a/yesod/test/run.sh +++ b/yesod/test/run.sh @@ -11,7 +11,7 @@ cabal clean && cabal install && cabal sdist for f in $(ls -1rt dist/*.tar.gz | tail -1) do tar -xzvf $f && cd `basename $f .tar.gz` - shelltest ../tests/scaffold.shelltest --color --diff $@ -- --hide-successes + shelltest ../test/scaffold.shelltest --color --diff $@ -- --hide-successes cd .. rm -r `basename $f .tar.gz` done diff --git a/yesod/test/scaffold.shelltest b/yesod/test/scaffold.shelltest index 14901ab6..85be8700 100644 --- a/yesod/test/scaffold.shelltest +++ b/yesod/test/scaffold.shelltest @@ -1,4 +1,4 @@ -# Important! run with tests/run.sh +# Important! run with test/run.sh rm -rf foobar && runghc scaffold.hs init && cd foobar && cabal install && cabal install -fdevel && cd .. <<< diff --git a/yesod/yesod.cabal b/yesod/yesod.cabal index 198ae34c..cb0db1be 100644 --- a/yesod/yesod.cabal +++ b/yesod/yesod.cabal @@ -20,12 +20,12 @@ extra-source-files: scaffold/cassius/default-layout.cassius.cg scaffold/cassius/homepage.cassius.cg scaffold/Model.hs.cg - scaffold/sitearg.hs.cg + scaffold/Foundation.hs.cg scaffold/LICENSE.cg scaffold/mongoDBConnPool.cg - scaffold/tiny/sitearg.hs.cg - scaffold/tiny/cabal.cg - scaffold/tiny/Handler.hs.cg + scaffold/tiny/Foundation.hs.cg + scaffold/tiny/project.cabal.cg + scaffold/tiny/Application.hs.cg scaffold/tiny/hamlet/homepage.hamlet.cg scaffold/tiny/Handler/Root.hs.cg scaffold/tiny/config/routes.cg @@ -35,7 +35,7 @@ extra-source-files: scaffold/sqliteConnPool.cg scaffold/.ghci.cg scaffold/project.cabal.cg - scaffold/Handler.hs.cg + scaffold/Application.hs.cg scaffold/julius/homepage.julius.cg scaffold/hamlet/homepage.hamlet.cg scaffold/hamlet/default-layout.hamlet.cg