packages feed

lens-filesystem 0.0.0.0 → 0.1.0.0

raw patch · 2 files changed

+71/−69 lines, 2 filesdep ~directorydep ~filepathdep ~lensPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: directory, filepath, lens, lens-action

API changes (from Hackage documentation)

Files

lens-filesystem.cabal view
@@ -1,61 +1,60 @@-cabal-version: 1.12---- This file has been generated from package.yaml by hpack version 0.31.1.------ see: https://github.com/sol/hpack------ hash: 9ca81ad924a9ad21b7413d6c5eabf70ce7b386acbbb1e630c907cd5e58d9531e+cabal-version:       2.2 -name:           lens-filesystem-version:        0.0.0.0-description:    Please see the README on GitHub at <https://github.com/ChrisPenner/lens-fs#readme>-homepage:       https://github.com/ChrisPenner/lens-filesystem#readme-bug-reports:    https://github.com/ChrisPenner/lens-filesystem/issues-author:         Chris Penner-maintainer:     example@example.com-copyright:      2019 Chris Penner-license:        BSD3-license-file:   LICENSE-build-type:     Simple-extra-source-files:-    README.md-    ChangeLog.md+name:                lens-filesystem+version:             0.1.0.0+synopsis:            Lens interface for your filesystem; still a bit experimental+description:         Please see the README on GitHub at <https://github.com/ChrisPenner/lens-fs#readme>+homepage:            https://github.com/ChrisPenner/lens-filesystem+bug-reports:         https://github.com/ChrisPenner/lens-filesystem/issues+license:             BSD-3-Clause+license-file:        LICENSE+author:              Chris Penner+maintainer:          christopher.penner@gmail.com+copyright:           2019 Chris Penner+category:            Control+build-type:          Simple+extra-source-files:  ChangeLog.md, README.md  source-repository head   type: git   location: https://github.com/ChrisPenner/lens-filesystem +common commons+  build-depends:       base          >= 4.7    && < 5+                     , directory    ^>= 1.3.6+                     , filepath     ^>= 1.4.2+                     , lens         ^>= 4.18.1+                     , lens-action  ^>= 0.2.4++  ghc-options:         -Wall+ library-  exposed-modules:-      Control.Lens.FileSystem-      Control.Lens.FileSystem.Internal.Combinators-  other-modules:-      Paths_lens_filesystem-  hs-source-dirs:-      src-  ghc-options: -Wall-  build-depends:-      base >=4.7 && <5-    , directory-    , filepath-    , lens-    , lens-action-  default-language: Haskell2010+  import:              commons +  exposed-modules:     Control.Lens.FileSystem+                     , Control.Lens.FileSystem.Internal.Combinators++  other-extensions:    RankNTypes+                     , KindSignatures+                     , TupleSections+                     , TypeFamilies+                     , ScopedTypeVariables+                     , LambdaCase+                     , FlexibleContexts++  hs-source-dirs:      src+  default-language:    Haskell2010+ test-suite lens-filesystem-test-  type: exitcode-stdio-1.0-  main-is: Spec.hs-  other-modules:-      Paths_lens_filesystem-  hs-source-dirs:-      test-  ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N-  build-depends:-      base >=4.7 && <5-    , directory-    , filepath-    , hspec-    , lens-    , lens-action-    , lens-filesystem-  default-language: Haskell2010+  import:              commons++  main-is:             Spec.hs+  type:                exitcode-stdio-1.0++  ghc-options:         -threaded -rtsopts -with-rtsopts=-N++  build-depends:       hspec+                     , lens-filesystem++  hs-source-dirs:      test+  default-language:    Haskell2010
test/Spec.hs view
@@ -4,6 +4,7 @@ import Control.Lens.FileSystem import System.Directory import Test.Hspec+import Data.List  baseDir :: FilePath baseDir = "test" </> "data"@@ -15,12 +16,12 @@     hspec $ do       describe "ls" $ do         it "should return files and dirs with full path" $ do-          "flat" ^! ls `shouldReturn` ["flat/file.txt","flat/file.md","flat/dir"]+          sort <$> "flat" ^! ls `shouldReturn` ["flat/dir","flat/file.md","flat/file.txt"]         it "should allow traversing deeper" $ do-          "flat" ^!! ls . traversed `shouldReturn` ["flat/file.txt","flat/file.md","flat/dir"]+          sort <$> "flat" ^!! ls . traversed `shouldReturn` ["flat/dir","flat/file.md","flat/file.txt"]       describe "ls'ed" $ do         it "should behave like 'ls' but with traversal" $ do-          "flat" ^!! ls'ed `shouldReturn` ["flat/file.txt","flat/file.md","flat/dir"]+          sort <$> "flat" ^!! ls'ed `shouldReturn` ["flat/dir","flat/file.md","flat/file.txt"]       describe "path" $ do         it "should add to path" $ do           "nested" ^! path "top" `shouldReturn` "nested/top"@@ -33,44 +34,46 @@           "nested" ^! pathL ["top", "mid", "bottom"] `shouldReturn` "nested/top/mid/bottom"       describe "branching" $ do         it "should follow many paths" $ do-          "nested" ^! branching ["top", "peak"] . ls `shouldReturn`-            ["nested/top/mid","nested/peak/trees.txt","nested/peak/base"]+          sort <$> "nested" ^! branching ["top", "peak"] . ls `shouldReturn`+            ["nested/peak/base","nested/peak/trees.txt","nested/top/mid"]       describe "dirs" $ do         it "should filter to only dirs" $ do           "flat" ^!! ls . traversed . dirs `shouldReturn` ["flat/dir"]       describe "files" $ do         it "should filter to only files" $ do-          "flat" ^!! ls . traversed . files `shouldReturn` ["flat/file.txt", "flat/file.md"]+          sort <$> "flat" ^!! ls . traversed . files `shouldReturn` ["flat/file.md", "flat/file.txt"]       describe "contents" $ do         it "should get file contents" $ do-          "flat" ^!! ls . traversed . files . contents `shouldReturn` ["text\n", "markdown\n"]+          sort <$> "flat" ^!! ls . traversed . files . contents `shouldReturn` ["markdown\n", "text\n"]       describe "exts" $ do         it "should filter by extension" $ do-          "flat" ^!! ls . traversed . exts ["", "txt"] `shouldReturn` ["flat/file.txt", "flat/dir"]+          sort <$> "flat" ^!! ls . traversed . exts ["", "txt"] `shouldReturn` ["flat/dir", "flat/file.txt"]       describe "crawled" $ do         it "should find ALL files and dirs under root including root" $ do-          "nested" ^!! crawled `shouldReturn`-            [ "nested", "nested/top", "nested/top/mid", "nested/top/mid/bottom"-            , "nested/top/mid/bottom/floor.txt", "nested/peak", "nested/peak/trees.txt"-            , "nested/peak/base", "nested/peak/base/basecamp.txt"]+          sort <$> "nested" ^!! crawled `shouldReturn`+            ["nested","nested/peak","nested/peak/base","nested/peak/base/basecamp.txt"+            , "nested/peak/trees.txt","nested/top","nested/top/mid","nested/top/mid/bottom"+            , "nested/top/mid/bottom/floor.txt"]       describe "absoluted" $ do         it "should make paths absolute" $ do-          "flat" ^!! ls . traversed . absolute `shouldReturn`-            [ absRoot </> "flat" </> "file.txt"+          sort <$> "flat" ^!! ls . traversed . absolute `shouldReturn`+            [ absRoot </> "flat" </> "dir"             , absRoot </> "flat" </> "file.md"-            , absRoot </> "flat" </> "dir"+            , absRoot </> "flat" </> "file.txt"             ]       describe "withPerms" $ do         it "should filter based on permissions" $ do           "permissions" ^!! ls . traversed . withPerms [executable] `shouldReturn`             ["permissions/exe" ]-          "permissions" ^!! ls . traversed . withPerms [readable] `shouldReturn`-            ["permissions/readonly", "permissions/exe" ]+          sort <$> "permissions" ^!! ls . traversed . withPerms [readable] `shouldReturn`+            ["permissions/exe", "permissions/readonly"]         it "should 'and' permissions together" $ do           "permissions" ^!! ls . traversed . withPerms [executable, readable, writable] `shouldReturn`             ["permissions/exe" ]+       describe "symLinksFollowed" $ do         it "should rewrite symlinks" $ do+          pendingWith "Need to look into portability, failing on CI"           "symLinked" ^!! symLinksFollowed `shouldReturn` ["flat"]        describe "recovering" $ do