packages feed

yesod-gitrepo 0.1.1.0 → 0.2.0.0

raw patch · 3 files changed

+9/−27 lines, 3 filesdep −system-filepathPVP ok

version bump matches the API change (PVP)

Dependencies removed: system-filepath

API changes (from Hackage documentation)

- Yesod.GitRepo: gitRepoDev :: FilePath -> (FilePath -> IO a) -> IO (GitRepo a)

Files

ChangeLog.md view
@@ -1,7 +1,7 @@-## 0.1.1.0+## 0.2.0.0 -`gitRepoDev` added.+* Drop system-filepath  ## 0.1.0.0 -Initial release+* Initial release
Yesod/GitRepo.hs view
@@ -8,7 +8,6 @@     , grRefresh     , grContent     , gitRepo-    , gitRepoDev     , Route (..)     ) where @@ -22,13 +21,11 @@ import           Data.IORef                 (newIORef, readIORef, writeIORef) import           Data.Monoid                ((<>)) import           Data.Text                  (Text, pack, unpack)-import           Filesystem.Path.CurrentOS  (FilePath, decodeString,-                                             encodeString) import           Network.HTTP.Types         (status200) import           Network.Wai                (responseLBS) import           Prelude                    (Eq, IO, Maybe (..), Monad (..),                                              Read, Show, error, error, map,-                                             show, ($))+                                             show, ($), FilePath) import           System.Directory           (getTemporaryDirectory,                                              removeDirectory) import           System.Exit                (ExitCode (ExitSuccess, ExitFailure))@@ -71,10 +68,9 @@            -> IO (GitRepo a) gitRepo url branch refresh = do     tmpDir <- getTemporaryDirectory-    contentDir' <- createTempDirectory tmpDir "git-repo"-    let contentDir = decodeString contentDir'-    removeDirectory contentDir'-    git Nothing ["clone", "-b", branch, url, pack contentDir']+    contentDir <- createTempDirectory tmpDir "git-repo"+    removeDirectory contentDir+    git Nothing ["clone", "-b", branch, url, pack contentDir]     ref <- refresh contentDir >>= newIORef     var <- newEmptyMVar     mask_ $ void $ forkIO $ forever $ do@@ -98,18 +94,6 @@     parseRoute ([], []) = Just GitRepoRoute     parseRoute _ = Nothing --- | Like 'gitRepo', but intended to be used in a dev environment. It just uses--- a hard-coded @FilePath@ and reloads the contents on each request.------ Since 0.1.1-gitRepoDev :: FilePath-           -> (FilePath -> IO a)-           -> IO (GitRepo a)-gitRepoDev fp refresh = return GitRepo-    { grRefresh = return ()-    , grContent = refresh fp-    }- instance YesodSubDispatch (GitRepo a) (HandlerT site IO) where     yesodSubDispatch env _req send = do         void $ forkIO $ grRefresh gr@@ -122,7 +106,7 @@ git mdir args = do     (Nothing, Nothing, Nothing, ph) <- createProcess         (proc "git" $ map unpack args)-            { cwd = encodeString <$> mdir+            { cwd = mdir             }     ec <- waitForProcess ph     case ec of
yesod-gitrepo.cabal view
@@ -1,7 +1,6 @@ name:                yesod-gitrepo-version:             0.1.1.0+version:             0.2.0.0 synopsis:            Host content provided by a Git repo-description:         See README.md homepage:            https://github.com/snoyberg/yesod-gitrepo license:             MIT license-file:        LICENSE@@ -23,7 +22,6 @@                      , http-types                      , process >=1.1                      , lifted-base-                     , system-filepath                      , text                      , enclosed-exceptions   default-language:    Haskell2010