packages feed

download 0.3.2.1 → 0.3.2.2

raw patch · 4 files changed

+97/−10 lines, 4 filesdep +downloaddep +hspecdep ~basePVP ok

version bump matches the API change (PVP)

Dependencies added: download, hspec

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

+ ChangeLog.md view
@@ -0,0 +1,3 @@+## 0.3.2.2++* Basic test suite added.
+ README.md view
@@ -0,0 +1,49 @@+# download++[![Build Status](https://travis-ci.org/psibi/download.svg?branch=master)](https://travis-ci.org/psibi/download)++ Download web content as strict bytestring, strings, HTML tags, XML, RSS+ or Atom feeds or JSON, via HTTP, FTP or file protocols, using a URL+ interface.++## Using the library:++ Importing the library:++``` haskell+import Network.Download+```++ Loading a webpage as a `ByteString`:++``` haskell+doc  <- openURI "http://google.com"+```++ Loading from a file:++``` haskell+doc  <- openURI "file:///tmp/A.hs"+```++ Loading a HTML page as a list of tags:++``` haskell+tags <- openAsTags "http://google.com"+```++ Loading a HTML page as XML:++``` haskell+tags <- openAsXML "http://google.com"+```++ Loading an RSS or Atom feed:++``` haskell+feed <- openAsFeed "http://google.com"+```++ These data types can the be processed further with the XML, Feed and+ TagSoup libraries.+
+ Spec.hs view
@@ -0,0 +1,26 @@+import Test.Hspec+import Network.Download+import Data.Either (isRight)++main :: IO ()+main = hspec $ do+  describe "openURI" $ do+    it "returns Right data constructor for http" $ do+     doc <- openURI "http://www.google.com"+     doc `shouldSatisfy` isRight+         +  describe "openAsTags" $ do+    it "returns Right data constructor for http" $ do+     doc <- openAsTags "http://www.google.com"+     doc `shouldSatisfy` isRight++  describe "openAsXML" $ do+    it "returns Right data constructor for http" $ do+     doc <- openAsXML "http://www.google.com"+     doc `shouldSatisfy` isRight++  describe "openAsFeed" $ do+    it "returns Right data constructor for http" $ do+     doc <- openAsFeed "http://www.google.com"+     doc `shouldSatisfy` isRight         +
download.cabal view
@@ -1,8 +1,10 @@ name:            download-version:         0.3.2.1-homepage:        http://code.haskell.org/~dons/code/download+version:         0.3.2.2+homepage:        https://github.com/psibi/download synopsis:        High-level file download based on URLs description:     High-level file download based on URLs+extra-source-files: ChangeLog.md README.md+bug-reports:     https://github.com/psibi/download/issues  .  Download web content as strict bytestring, strings, HTML tags, XML, RSS  or Atom feeds or JSON, via HTTP, FTP or file protocols, using a URL@@ -14,7 +16,7 @@  .  Loading a webpage as a "ByteString":  .- > doc  <- openURI "http://haskell.org"+ > doc  <- openURI "http://google.com"  .  Loading from a file:  .@@ -22,15 +24,15 @@  .  Loading a HTML page as a list of tags:  .- > tags <- openAsTags "http://haskell.org"+ > tags <- openAsTags "http://google.com"  .  Loading a HTML page as XML:  .- > tags <- openAsXML "http://haskell.org"+ > tags <- openAsXML "http://google.com"  .  Loading an RSS or Atom feed:  .- > feed <- openAsFeed "http://haskell.org"+ > feed <- openAsFeed "http://google.com"  .  These data types can the be processed further with the XML, Feed and  TagSoup libraries.@@ -41,7 +43,7 @@ copyright:       (c) 2008-2011, Don Stewart <dons00@gmail.com> author:          Don Stewart maintainer:      Sibi Prabakaran <sibi@psibi.in>, Don Stewart <dons00@gmail.com>-cabal-version:   >= 1.6+cabal-version:   >= 1.8 build-type:      Simple tested-with:     GHC ==7.10.3 @@ -62,9 +64,8 @@      ghc-options:     -Wall -    build-depends:   base >= 3 && < 5, bytestring--    build-depends: tagsoup >= 0.8, feed, xml+    build-depends:   base >= 3 && < 5, bytestring,+                     tagsoup >= 0.8, feed, xml      ------------------------------------------------------------------------     -- Building libdownload@@ -105,3 +106,11 @@                         httperr.h                         hs_download_utils.h +test-suite test+    type:          exitcode-stdio-1.0+    ghc-options:   -Wall+    main-is:       Spec.hs+    +    build-depends:   base >= 4.6 && < 5,+                     download,+                     hspec == 2.*