http-directory 0.1.6 → 0.1.7
raw patch · 4 files changed
+7/−27 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Network.HTTP.Directory: (</>) :: String -> String -> String
- Network.HTTP.Directory: infixr 5 </>
Files
- CHANGELOG.md +4/−0
- http-directory.cabal +1/−1
- src/Network/HTTP/Directory.hs +1/−15
- test/Spec.hs +1/−11
CHANGELOG.md view
@@ -2,6 +2,10 @@ `http-directory` uses [PVP Versioning](https://pvp.haskell.org). +## 0.1.7 (2020-01-24)+- drop </> since it conflicts with filepath+- deprecates 0.1.6+ ## 0.1.6 (2020-01-24) - filter relative/paths and relative?queries - add `url </> file`
http-directory.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: http-directory-version: 0.1.6+version: 0.1.7 synopsis: http directory listing library description: Library for listing the files (href's) in an http directory.
src/Network/HTTP/Directory.hs view
@@ -32,8 +32,7 @@ isHttpUrl, trailingSlash, noTrailingSlash,- Manager,- (</>)+ Manager ) where #if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,0))@@ -207,19 +206,6 @@ -- @since 0.1.5 isHttpUrl :: String -> Bool isHttpUrl loc = "http:" `L.isPrefixOf` loc || "https:" `L.isPrefixOf` loc---- | This </> eats extra slashes.------ @"dir//" </> "/subdir/" = "dir/subdir/"@------ @since 0.1.6-infixr 5 </>-(</>) :: String -> String -> String-"" </> s = s-s </> "" = s-s </> t | last s == '/' = init s </> t- | head t == '/' = s </> tail t-s </> t = s ++ "/" ++ t -- | Make sure an url ends with "/" --
test/Spec.hs view
@@ -76,7 +76,7 @@ describe "httpRedirect" $ it "fedora" $ do- mredir <- httpRedirect' "http://dl.fedoraproject.org"+ mredir <- httpRedirect' "http://fedoraproject.org" isJust mredir `shouldBe` True describe "httpRedirect" $ do@@ -103,16 +103,6 @@ any isHttpUrl ["mailto:one@where", "somefile", "an.iso", "package.tgz"] `shouldBe` False-- describe "</>" $ do- it "url + dir" $- "http://example.com//" </> "dir/" `shouldBe` "http://example.com/dir/"-- it "dir + dir" $- "abc" </> "def" `shouldBe` "abc/def"-- it "dir + dir" $- "abc/" </> "/def" `shouldBe` "abc/def" describe "trailing slash" $ do it "add" $