packages feed

conferer-provider-yaml (empty) → 0.2.0.0

raw patch · 6 files changed

+96/−0 lines, 6 filesdep +basedep +confererdep +conferer-provider-jsonsetup-changed

Dependencies added: base, conferer, conferer-provider-json, conferer-provider-yaml, hspec, yaml

Files

+ LICENSE view
@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2019 Lucas David Traverso++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
+ README.md view
@@ -0,0 +1,1 @@+# conferer-provider-yaml
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ conferer-provider-yaml.cabal view
@@ -0,0 +1,56 @@+cabal-version: 1.18++-- This file has been generated from package.yaml by hpack version 0.31.2.+--+-- see: https://github.com/sol/hpack+--+-- hash: ad6c9975f91857f6d738f1f7d4a87f6477f7a093003f6c7e89576c7574a6a361++name:           conferer-provider-yaml+version:        0.2.0.0+synopsis:       Configuration for reading yaml files++description:    Library to abstract the parsing of many haskell config values from different config sources+category:       Configuration+homepage:       https://github.com/ludat/conferer#readme+author:         Lucas David Traverso+maintainer:     lucas6246@gmail.com+copyright:      MIT+license:        BSD3+license-file:   LICENSE+build-type:     Simple+extra-doc-files:+    README.md+    LICENSE++library+  exposed-modules:+      Conferer.Provider.Yaml+  other-modules:+      Paths_conferer_provider_yaml+  hs-source-dirs:+      src+  default-extensions: OverloadedStrings LambdaCase QuasiQuotes ScopedTypeVariables+  build-depends:+      base >=4.3 && <5+    , conferer >=0.2.0.0 && <0.3.0.0+    , conferer-provider-json >=0.2.0.0 && <0.3.0.0+    , yaml >=0.8 && <1.0+  default-language: Haskell2010++test-suite conferer-provider-yaml-test+  type: exitcode-stdio-1.0+  main-is: Spec.hs+  other-modules:+      Paths_conferer_provider_yaml+  hs-source-dirs:+      test+  default-extensions: OverloadedStrings LambdaCase QuasiQuotes ScopedTypeVariables+  build-depends:+      base >=4.3 && <5+    , conferer >=0.2.0.0 && <0.3.0.0+    , conferer-provider-json >=0.2.0.0 && <0.3.0.0+    , conferer-provider-yaml+    , hspec+    , yaml >=0.8 && <1.0+  default-language: Haskell2010
+ src/Conferer/Provider/Yaml.hs view
@@ -0,0 +1,15 @@+module Conferer.Provider.Yaml where++import           Data.Yaml++import           Conferer.Provider.JSON+import           Conferer.Provider.Files+import           Conferer.Types++mkYamlProvider :: ProviderCreator+mkYamlProvider config = do+  filePath <- getFilePathFromEnv config "yaml"+  configAsJson <- decodeFileEither filePath+  case configAsJson of+    Right jsonConfig -> mkJsonProvider' jsonConfig config+    Left parseException -> error (show parseException)
+ test/Spec.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}