persistent-discover 0.1.0.0 → 0.1.0.1
raw patch · 4 files changed
+18/−4 lines, 4 files
Files
- ChangeLog.md +5/−0
- persistent-discover.cabal +2/−2
- src/Database/Persist/Discover/Exe.hs +1/−1
- test/Database/Persist/Discover/ExeSpec.hs +10/−1
ChangeLog.md view
@@ -2,6 +2,11 @@ ## Unreleased changes +## 0.1.0.1++- Fix behavior where uppercase directories (eg on Mac OS) would cause incorrect+ module names. [#2](https://github.com/parsonsmatt/persistent-discover/pull/2)+ ## 0.1.0.0 - Initial Release
persistent-discover.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 367368542f35766d0f032885ef0642293c2d78cc493e4ed99fdd2d71c68d68d2+-- hash: a19c34e1b40e11e9e11ba1037b48d10704dccd150ce870080a6648ef6a8c1ad1 name: persistent-discover-version: 0.1.0.0+version: 0.1.0.1 synopsis: Persistent module discover utilities description: This package provides an executable for discovering Persistent model definition files, as well as a library function to glob all persistent model files. Please see the README on GitHub at <https://github.com/parsonsmatt/persistent-discover#readme> category: Web
src/Database/Persist/Discover/Exe.hs view
@@ -171,7 +171,7 @@ :: FilePath -> [String] mkModulePieces fp =- fmap dropSuffixes $ dropWhile isLowerFirst $ filter noDots $ splitDirectories fp+ fmap dropSuffixes $ reverse $ takeWhile (not . isLowerFirst) $ reverse $ filter noDots $ splitDirectories fp where noDots x = "." /= x && ".." /= x
test/Database/Persist/Discover/ExeSpec.hs view
@@ -53,4 +53,13 @@ , modulePath = exPath }-+ it "pathToModule absolute path" do+ let absPath = "/Users/user/Code/project/src/Foo/Bar.hs"+ pathToModule absPath+ `shouldBe`+ Just Module+ { moduleName =+ "Foo.Bar"+ , modulePath =+ absPath+ }