packages feed

config-manager 0.3.0.0 → 0.3.0.1

raw patch · 2 files changed

+36/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

config-manager.cabal view
@@ -1,5 +1,5 @@ name:                  config-manager-version:               0.3.0.0+version:               0.3.0.1 synopsis:              Configuration management description:   A configuration management library which supports:@@ -46,6 +46,7 @@   location:            https://gitlab.com/guyonvarch/config-manager  Test-Suite test-config-manager+  other-modules:       Helper   type:                exitcode-stdio-1.0   hs-source-dirs:      tests   main-is:             Test.hs
+ tests/Helper.hs view
@@ -0,0 +1,34 @@+module Helper+  ( forceGetConfig+  , getConfig+  , eitherToMaybe+  ) where+++import System.IO (hClose)+import System.IO.Temp (withSystemTempFile)+import System.Directory (removeFile)++import Data.Text (Text)+import qualified Data.Text.IO as T+import Data.Maybe (fromJust)++import Data.ConfigManager+import Data.ConfigManager.Types (Config)++forceGetConfig :: Text -> IO Config+forceGetConfig = (fmap fromJust) . getConfig++getConfig :: Text -> IO (Maybe Config)+getConfig input =+  withSystemTempFile "config-manager-test" (\filePath handle -> do+    hClose handle+    T.writeFile filePath input+    config <- readConfig filePath+    removeFile filePath+    return $ eitherToMaybe config+  )++eitherToMaybe :: Either a b -> Maybe b+eitherToMaybe (Left _) = Nothing+eitherToMaybe (Right x) = Just x