freckle-env 0.0.1.1 → 0.0.1.2
raw patch · 5 files changed
+25/−9 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Freckle.App.Env: instance GHC.Show.Show Freckle.App.Env.Timeout
+ Freckle.App.Env: instance GHC.Internal.Show.Show Freckle.App.Env.Timeout
Files
- CHANGELOG.md +5/−1
- README.md +1/−1
- freckle-env.cabal +2/−2
- library/Freckle/App/Env.hs +15/−3
- package.yaml +2/−2
CHANGELOG.md view
@@ -1,4 +1,8 @@-## [_Unreleased_](https://github.com/freckle/freckle-app/compare/freckle-env-v0.0.1.1...main)+## [_Unreleased_](https://github.com/freckle/freckle-app/compare/freckle-env-v0.0.1.2...main)++## [v0.0.1.1](https://github.com/freckle/freckle-app/compare/freckle-env-v0.0.1.1...freckle-env-v0.0.1.2)++Support `envparse` `0.6` ## [v0.0.1.1](https://github.com/freckle/freckle-app/compare/freckle-env-v0.0.1.0...freckle-env-v0.0.1.1)
README.md view
@@ -1,6 +1,6 @@ # freckle-env -Some extensions to the `envparse` library.+Some extensions to the [envparse](https://hackage.haskell.org/package/envparse) library. ---
freckle-env.cabal view
@@ -1,12 +1,12 @@ cabal-version: 1.18 name: freckle-env-version: 0.0.1.1+version: 0.0.1.2 license: MIT license-file: LICENSE maintainer: Freckle Education homepage: https://github.com/freckle/freckle-app#readme bug-reports: https://github.com/freckle/freckle-app/issues-synopsis: Some extension to the envparse library+synopsis: Some extensions to the envparse library description: Please see README.md category: Environment, System build-type: Simple
library/Freckle/App/Env.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE CPP #-}+ -- | Parse the shell environment for configuration -- -- A minor extension of [envparse](https://hackage.haskell.org/package/envparse).@@ -13,7 +15,7 @@ -- > } -- > -- > loadConfig :: IO Config--- > loadConfig = parse $ Config+-- > loadConfig = parse id $ Config -- > <$> var auto "BATCH_SIZE" (def 1) -- > <*> switch "DRY_RUN" mempty -- > <*> flag (Off LevelInfo) (On LevelDebug) "DEBUG" mempty@@ -38,15 +40,21 @@ import Prelude import Control.Error.Util (note)-import Data.Bifunctor (first, second) import Data.Char (isDigit) import Data.Text (Text) import Data.Text qualified as T import Data.Time (UTCTime, defaultTimeLocale, parseTimeM)-import Env hiding (flag) import Env qualified import Prelude qualified as Unsafe (read) +#if MIN_VERSION_envparse(0,5,2)+import Data.Bifunctor (second)+import Env hiding (eitherReader, flag)+#else+import Data.Bifunctor (first, second)+import Env hiding (flag)+#endif+ -- | Designates the value of a parameter when a flag is not provided. newtype Off a = Off a @@ -83,9 +91,13 @@ -- -- This is a building-block for other 'Reader's eitherReader :: (String -> Either String a) -> Env.Reader Error a+#if MIN_VERSION_envparse(0,5,2)+eitherReader = Env.eitherReader+#else eitherReader f s = first (unread . suffix) $ f s where suffix x = x <> ": " <> show s+#endif -- | Read a time value using the given format --
package.yaml view
@@ -1,9 +1,9 @@ name: freckle-env-version: 0.0.1.1+version: 0.0.1.2 maintainer: Freckle Education category: Environment, System github: freckle/freckle-app-synopsis: Some extension to the envparse library+synopsis: Some extensions to the envparse library description: Please see README.md extra-doc-files: