packages feed

summoner 1.0.3 → 1.0.4

raw patch · 4 files changed

+31/−26 lines, 4 filesdep ~tomland

Dependency ranges changed: tomland

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Summoner +1.0.4+=====+* Bump up `tomland` to version `0.3`.+ 1.0.3 ===== * [#92](https://github.com/kowainik/summoner/issues/92):
README.md view
@@ -18,6 +18,7 @@ ### Prerequisites  To start using it make sure you have next tools installed on your machine:+ * [`Stack`](http://haskellstack.org) or [`cabal`](https://www.haskell.org/cabal/) * [`git`](https://git-scm.com) * [`hub`](https://github.com/github/hub)@@ -30,7 +31,7 @@  or -    $ stack install summoner --resolver nightly-2018-06-01+    $ stack install summoner --resolver nightly-2018-06-14  You can turn on the bash auto-completion by running the following command: @@ -103,7 +104,7 @@  ###### Examples -See example of [configuration for projects of `Kowainik` organization](https://github.com/kowainik/org/blob/master/summoner.toml).+See example of [configuration for projects of `Kowainik` organization](https://github.com/kowainik/org/blob/master/.summoner.toml).  By default the `summoner` will look for the configuration file (`.summoner.toml`) in home directory. 
src/Summoner/Config.hs view
@@ -30,10 +30,7 @@ import Data.Monoid (Last (..)) import Generics.Deriving.Monoid (GMonoid, gmemptydefault) import Generics.Deriving.Semigroup (GSemigroup, gsappenddefault)-import Toml (ValueType (TString), matchText)-import Toml.Bi (BiToml, dimap, (.=))-import Toml.Bi.Combinators (Valuer (..))-import Toml.PrefixTree (Key)+import Toml (AnyValue (..), BiToml, Key, Prism (..), dimap, (.=))  import Summoner.License (License (..)) import Summoner.ProjectData (CustomPrelude (..), Decision (..), GhcVer (..), parseGhcVer,@@ -110,11 +107,11 @@ -- | Identifies how to read 'Config' data from the @.toml@ file. configT :: BiToml PartialConfig configT = Config-    <$> lastP Toml.str  "owner"       .= cOwner-    <*> lastP Toml.str  "fullName"    .= cFullName-    <*> lastP Toml.str  "email"       .= cEmail-    <*> lastP license   "license"     .= cLicense-    <*> lastP ghcVerArr "ghcVersions" .= cGhcVer+    <$> lastT Toml.text "owner"       .= cOwner+    <*> lastT Toml.text "fullName"    .= cFullName+    <*> lastT Toml.text "email"       .= cEmail+    <*> lastT license   "license"     .= cLicense+    <*> lastT ghcVerArr "ghcVersions" .= cGhcVer     <*> decision        "github"      .= cGitHub     <*> decision        "travis"      .= cTravis     <*> decision        "appveyor"    .= cAppVey@@ -124,26 +121,29 @@     <*> decision        "exe"         .= cExe     <*> decision        "test"        .= cTest     <*> decision        "bench"       .= cBench-    <*> lastP (Toml.table preludeT)  "prelude" .= cPrelude-    <*> extensions      "extensions"      .= cExtensions+    <*> lastT (Toml.table preludeT) "prelude" .= cPrelude+    <*> extensions      "extensions"  .= cExtensions   where-    lastP :: (Key -> BiToml a) -> Key -> BiToml (Last a)-    lastP f = dimap getLast Last . Toml.maybeP f+    lastT :: (Key -> BiToml a) -> Key -> BiToml (Last a)+    lastT f = dimap getLast Last . Toml.maybeT f -    ghcVerV :: Valuer 'TString GhcVer-    ghcVerV = Valuer (matchText >=> parseGhcVer) (Toml.String . showGhcVer)+    _GhcVer :: Prism AnyValue GhcVer+    _GhcVer = Prism+        { preview = \(AnyValue t) -> Toml.matchText t >>= parseGhcVer+        , review = AnyValue . Toml.Text . showGhcVer+        }      ghcVerArr :: Key -> BiToml [GhcVer]-    ghcVerArr = Toml.arrayOf ghcVerV+    ghcVerArr = Toml.arrayOf _GhcVer      license :: Key -> BiToml License-    license =  dimap unLicense License . Toml.str+    license =  dimap unLicense License . Toml.text      extensions :: Key -> BiToml [Text]-    extensions = dimap Just maybeToMonoid . Toml.maybeP (Toml.arrayOf Toml.strV)+    extensions = dimap Just maybeToMonoid . Toml.maybeT (Toml.arrayOf Toml._Text)      decision :: Key -> BiToml Decision-    decision = dimap fromDecision toDecision . Toml.maybeP Toml.bool+    decision = dimap fromDecision toDecision . Toml.maybeT Toml.bool      decisionMaybe :: [(Decision, Maybe Bool)]     decisionMaybe = [ (Idk, Nothing)@@ -159,8 +159,8 @@      preludeT :: BiToml CustomPrelude     preludeT = Prelude-        <$> Toml.str "package" .= cpPackage-        <*> Toml.str "module"  .= cpModule+        <$> Toml.text "package" .= cpPackage+        <*> Toml.text "module"  .= cpModule  -- | Make sure that all the required configurations options were specified. finalise :: PartialConfig -> Validation [Text] Config
summoner.cabal view
@@ -1,5 +1,5 @@ name:                summoner-version:             1.0.3+version:             1.0.4 synopsis:            Tool for creating completely configured production Haskell projects. description:         Tool for creating completely configured production Haskell projects.                      See README.md for details.@@ -17,7 +17,7 @@                    , CHANGELOG.md cabal-version:       2.0 tested-with:         GHC == 8.2.2-                   , GHC == 8.4.2+                   , GHC == 8.4.3  source-repository head   type:     git@@ -56,7 +56,7 @@                      , process                      , text                      , time-                     , tomland >= 0.2.1+                     , tomland ^>= 0.3                      , universum >= 1.2.0    default-extensions:  DeriveGeneric