conferer-source-yaml (empty) → 0.4.0.0
raw patch · 6 files changed
+96/−0 lines, 6 filesdep +basedep +confererdep +conferer-source-jsonsetup-changed
Dependencies added: base, conferer, conferer-source-json, conferer-source-yaml, hspec, yaml
Files
- LICENSE +21/−0
- README.md +1/−0
- Setup.hs +2/−0
- conferer-source-yaml.cabal +56/−0
- src/Conferer/Source/Yaml.hs +15/−0
- test/Spec.hs +1/−0
+ 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-source-yaml
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ conferer-source-yaml.cabal view
@@ -0,0 +1,56 @@+cabal-version: 1.18++-- This file has been generated from package.yaml by hpack version 0.33.0.+--+-- see: https://github.com/sol/hpack+--+-- hash: f448ffe1cc4edd2cd055d74961ad8df372bce5129dbc5063cc1c75b7e7011c2b++name: conferer-source-yaml+version: 0.4.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.Source.Yaml+ other-modules:+ Paths_conferer_source_yaml+ hs-source-dirs:+ src+ default-extensions: OverloadedStrings LambdaCase QuasiQuotes ScopedTypeVariables+ build-depends:+ base >=4.3 && <5+ , conferer >=0.4.0.0 && <0.5.0.0+ , conferer-source-json >=0.4.0.0 && <0.5.0.0+ , yaml >=0.8 && <1.0+ default-language: Haskell2010++test-suite specs+ type: exitcode-stdio-1.0+ main-is: Spec.hs+ other-modules:+ Paths_conferer_source_yaml+ hs-source-dirs:+ test+ default-extensions: OverloadedStrings LambdaCase QuasiQuotes ScopedTypeVariables+ build-depends:+ base >=4.3 && <5+ , conferer >=0.4.0.0 && <0.5.0.0+ , conferer-source-json >=0.4.0.0 && <0.5.0.0+ , conferer-source-yaml+ , hspec+ , yaml >=0.8 && <1.0+ default-language: Haskell2010
+ src/Conferer/Source/Yaml.hs view
@@ -0,0 +1,15 @@+module Conferer.Source.Yaml where++import Data.Yaml++import Conferer.Source.JSON+import Conferer.Source.Files+import Conferer.Types++mkYamlSource :: SourceCreator+mkYamlSource config = do+ filePath <- getFilePathFromEnv config "yaml"+ configAsJson <- decodeFileEither filePath+ case configAsJson of+ Right jsonConfig -> mkJsonSource' jsonConfig config+ Left parseException -> error (show parseException)
+ test/Spec.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}