packages feed

tkyprof 0.0.3 → 0.0.4

raw patch · 6 files changed

+49/−34 lines, 6 filesdep +cmdargsdep −wai-handler-webkit

Dependencies added: cmdargs

Dependencies removed: wai-handler-webkit

Files

Controller.hs view
@@ -5,13 +5,12 @@   , withDevelApp   ) where -import TKYProf-import Settings-import Yesod.Helpers.Static import Data.ByteString (ByteString)-import Network.Wai (Application) import Data.Dynamic (Dynamic, toDyn)-+import Network.Wai (Application)+import Settings+import TKYProf+import Yesod.Helpers.Static -- Import all relevant handler modules here. import Handler.Home import Handler.Reports
ProfilingReport.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleInstances, RecordWildCards, OverloadedStrings, BangPatterns #-}+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} module ProfilingReport   ( -- * Parsers for profiling reports     profilingReport
TKYProf.hs view
@@ -23,6 +23,7 @@ import Settings (hamletFile, luciusFile, juliusFile, widgetFile) import StaticFiles import System.Directory+import System.FilePath ((</>)) import Yesod.Core import Yesod.Helpers.Static import qualified Data.ByteString.Lazy as L@@ -92,7 +93,7 @@   -- users receiving stale content.   addStaticContent ext' _ content = do     let fn = base64md5 content ++ '.' : T.unpack ext'-    let statictmp = Settings.staticdir ++ "/tmp/"+    let statictmp = Settings.staticdir </> "tmp/"     liftIO $ createDirectoryIfMissing True statictmp     let fn' = statictmp ++ fn     exists <- liftIO $ doesFileExist fn'@@ -104,4 +105,3 @@   breadcrumb ReportsR         = return ("Reports", Just HomeR)   breadcrumb (ReportsIdR rid) = return ("Report #" `T.append` T.pack (show rid), Just ReportsR)   breadcrumb _                = return ("Not found", Just HomeR)-
bin/tkyprof.hs view
@@ -1,17 +1,28 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveDataTypeable, CPP #-} import Controller (withTKYProf)+import System.IO (hPutStrLn, stderr)+ #if PRODUCTION-import Network.Wai.Handler.Webkit (run)+import Network.Wai.Handler.Warp (Port, run)+import System.Directory (setCurrentDirectory)+import Paths_tkyprof (getDataDir)+import System.Console.CmdArgs  main :: IO ()-main = withTKYProf $ run "Devel.TKYProf"-#elif WEB-import Network.Wai.Handler.Warp (run)+main = do+  getDataDir >>= setCurrentDirectory+  TKYProfArg p <- cmdArgs tkyProfArg+  hPutStrLn stderr $ "TKYProf launched, listening on http://localhost:" ++ show p+  withTKYProf $ run p -main :: IO ()-main = withTKYProf $ run 3000+data TKYProfArg = TKYProfArg+  { port :: Port+  } deriving (Show, Data, Typeable)++tkyProfArg :: TKYProfArg+tkyProfArg = TKYProfArg { port = 3000 &= help "Port number" }+             &= summary "TKYProf" #else-import System.IO (hPutStrLn, stderr) import Network.Wai.Middleware.Debug (debug) import Network.Wai.Handler.Warp (run) @@ -21,3 +32,11 @@   hPutStrLn stderr $ "Application launched, listening on port " ++ show port   withTKYProf $ run port . debug #endif++{-+import Network.Wai.Handler.Webkit (run)++main :: IO ()+main = withTKYProf $ run "Devel.TKYProf"+-}+
config/Settings.hs view
tkyprof.cabal view
@@ -1,5 +1,5 @@ name:                 tkyprof-version:              0.0.3+version:              0.0.4 license:              BSD3 license-file:         LICENSE author:               Mitsutoshi Aoe@@ -12,23 +12,21 @@ build-type:           Simple homepage:             https://github.com/maoe/tkyprof bug-reports:          https://github.com/maoe/tkyprof/issues+ data-files:           static/js/d3.layout.min.js                       static/js/d3.min.js                       static/js/jquery.fileupload.js                       static/js/jquery.iframe-transport.js                       static/js/jquery.pjax.js                       static/js/jquery.ui.widget.js-                      config/favicon.ico-                      config/routes                       hamlet/*.hamlet                       julius/*.julius                       lucius/*.lucius+                      config/favicon.ico -flag production-  description:        Build the production executable.-  default:            False+extra-source-files:   config/routes -flag web+flag production   description:        Build the production executable.   default:            True @@ -41,25 +39,23 @@     buildable:        False    if flag(production)-    if flag(web)-      ghc-options:      -Wall -threaded -O2 -fno-warn-unused-do-bind-      cpp-options:    -DWEB-    else-      cpp-options:    -DPRODUCTION-      ghc-options:    -Wall -fno-warn-unused-do-bind -pgmc g++ -pgml g++-      pkgconfig-depends: QtWebKit-      build-depends:  wai-handler-webkit-  else-    ghc-options:      -Wall -threaded+    ghc-options:      -O2+    cpp-options:      -DPRODUCTION +    -- ghc-options:    -pgmc g++ -pgml g+++    -- pkgconfig-depends: QtWebKit+    -- build-depends:  wai-handler-webkit+   main-is:            bin/tkyprof.hs   hs-source-dirs:     ., config, bin-+  other-modules:      Paths_tkyprof+  ghc-options:        -Wall -threaded   build-depends:      base >= 4 && < 5                     , aeson >= 0.3 && < 0.4                     , attoparsec >= 0.9 && < 0.10                     , attoparsec-enumerator >= 0.2 && < 0.3                     , bytestring >= 0.9 && < 0.10+                    , cmdargs >= 0.7 && < 0.8                     , containers < 0.5                     , directory < 2                     , enumerator >= 0.4 && < 0.5@@ -78,7 +74,6 @@                     , yesod-form >= 0.1 && < 0.2                     , yesod-json >= 0.1 && < 0.2                     , yesod-static >= 0.1 && < 0.2-  ghc-options:        -Wall -threaded  library   if flag(devel)@@ -91,6 +86,7 @@                       Handler.Home                       Handler.Reports                       Model+                      Paths_tkyprof                       ProfilingReport                       Settings                       StaticFiles