feature-flipper 0.2.0.0 → 0.2.0.1
raw patch · 2 files changed
+5/−60 lines, 2 filesdep −QuickCheckPVP ok
version bump matches the API change (PVP)
Dependencies removed: QuickCheck
API changes (from Hackage documentation)
Files
- examples/environment-config/Main.hs +0/−41
- feature-flipper.cabal +5/−19
− examples/environment-config/Main.hs
@@ -1,41 +0,0 @@-module Main where--import Control.Monad.State-import qualified Data.Map.Strict as Map-import Data.Maybe (maybe)-import qualified System.Environment as Env--import Control.Flipper-import Control.Flipper.Adapters.Memory--main :: IO ()-main = do- features <- loadFeatures-- -- StateT has a HasFeatureFlags instance defined- evalFlipperT features runWithFeatureFlags--runWithFeatureFlags :: (MonadIO m, HasFeatureFlags m)- => m ()-runWithFeatureFlags = do- whenEnabled- "SOME_FEATURE"- (liftIO $ putStrLn "We're running SOME_FEATURE!")-- whenEnabled- "SOME_OTHER_FEATURE"- (liftIO $ putStrLn "We're running SOME_OTHER_FEATURE!")-- liftIO $ putStrLn "Done!"--loadFeatures :: IO Features-loadFeatures = do- -- load feature flags from the environment- someFeatureEnabled <- maybe False read <$> Env.lookupEnv "SOME_FEATURE"- someOtherFeatureEnabled <- maybe False read <$> Env.lookupEnv "SOME_OTHER_FEATURE"-- -- build flipper feature type- pure . Features $ Map.fromList- [ ("SOME_FEATURE", someFeatureEnabled)- , ("SOME_OTHER_FEATURE", someOtherFeatureEnabled)- ]
feature-flipper.cabal view
@@ -3,11 +3,11 @@ -- see: https://github.com/sol/hpack name: feature-flipper-version: 0.2.0.0+version: 0.2.0.1 synopsis: A minimally obtrusive feature flag library description: A minimally obtrusive feature flag library-homepage: https://github.com/toddmohney/feature-flipper#readme-bug-reports: https://github.com/toddmohney/feature-flipper/issues+homepage: https://github.com/toddmohney/flipper#readme+bug-reports: https://github.com/toddmohney/flipper/issues license: MIT license-file: LICENSE author: Todd Mohney@@ -22,7 +22,7 @@ source-repository head type: git- location: https://github.com/toddmohney/feature-flipper+ location: https://github.com/toddmohney/flipper library hs-source-dirs:@@ -36,25 +36,12 @@ other-modules: Paths_feature_flipper build-depends:- base >=4.7 && <5+ base >=4.8 && <5 , containers , mtl , text default-language: Haskell2010 -executable environment-config- main-is: Main.hs- hs-source-dirs:- examples/environment-config- default-extensions: OverloadedStrings- ghc-options: -Wall -fwarn-unused-matches -fwarn-unused-binds -fwarn-unused-imports- build-depends:- base >=4.7 && <5- , containers- , feature-flipper- , mtl- default-language: Haskell2010- test-suite feature-flipper-test type: exitcode-stdio-1.0 hs-source-dirs:@@ -67,7 +54,6 @@ , feature-flipper , hspec , mtl- , QuickCheck other-modules: Control.FlipperSpec ghc-options: -threaded -rtsopts -with-rtsopts=-N