json-feed 1.0.0 → 1.0.1
raw patch · 8 files changed
+126/−67 lines, 8 filesdep ~aesondep ~basedep ~bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, base, bytestring, filepath, hspec, mime-types, network-uri, text, time
API changes (from Hackage documentation)
Files
- CHANGELOG.markdown +7/−0
- LICENSE.markdown +8/−10
- json-feed.cabal +26/−23
- library/JsonFeed.hs +2/−1
- package.yaml +49/−0
- stack.yaml +1/−0
- tests/Main.hs +33/−0
- tests/test.hs +0/−33
+ CHANGELOG.markdown view
@@ -0,0 +1,7 @@+# Change log++JSON Feed uses [Semantic Versioning][].+The change log is available through the [releases on GitHub][].++[Semantic Versioning]: http://semver.org/spec/v2.0.0.html+[releases on GitHub]: https://github.com/tfausak/json-feed/releases
LICENSE.markdown view
@@ -1,13 +1,13 @@-# [The MIT License (MIT)][]+MIT License -Copyright (c) Taylor Fausak+Copyright (c) 2018 Taylor Fausak -Permission is hereby granted, free of charge, to any person obtaining a copy of-this software and associated documentation files (the "Software"), to deal in-the Software without restriction, including without limitation the rights to-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies-of the Software, and to permit persons to whom the Software is furnished to do-so, subject to the following conditions:+Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.@@ -19,5 +19,3 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.--[The MIT License (MIT)]: http://opensource.org/licenses/MIT
json-feed.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: bb3da7d5d38b5be1e7750d100d9d59b84e5d03006160d7de63f94192fc8348c5+-- hash: 326a1e427a3541c8810a07d0bbf4ccbe067fa4d71a7613a59630ca73eaf5fd80 name: json-feed-version: 1.0.0+version: 1.0.1 synopsis: JSON Feed description: This is an implementation of the JSON Feed spec in Haskell. The spec is available at <https://jsonfeed.org>. JSON Feed is similar to the Atom and RSS feed formats, but it is serialized as JSON rather than XML. category: Web@@ -18,6 +18,7 @@ cabal-version: >= 1.10 extra-source-files:+ CHANGELOG.markdown feeds/allenpike.com.json feeds/daringfireball.net.json feeds/flyingmeat.com.json@@ -29,7 +30,9 @@ feeds/shapeof.com.json feeds/therecord.co.json feeds/timetable.manton.org.json+ package.yaml README.markdown+ stack.yaml source-repository head type: git@@ -38,16 +41,16 @@ library hs-source-dirs: library- ghc-options: -Wall+ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe build-depends:- aeson ==1.2.*- , base ==4.10.*- , bytestring ==0.10.*- , mime-types ==0.1.*- , network-uri ==2.6.*- , tagsoup ==0.14.*- , text ==1.2.*- , time ==1.8.*+ aeson >=0.11.2 && <0.12 || >=1.0.2 && <1.4+ , base >=4.9.0 && <4.12+ , bytestring >=0.10.8 && <0.11+ , mime-types >=0.1.0 && <0.2+ , network-uri >=2.6.1 && <2.7+ , tagsoup >=0.14 && <0.15+ , text >=1.2.2 && <1.3+ , time >=1.6.0 && <1.9 exposed-modules: JsonFeed other-modules:@@ -56,22 +59,22 @@ test-suite test type: exitcode-stdio-1.0- main-is: test.hs+ main-is: Main.hs hs-source-dirs: tests- ghc-options: -Wall -rtsopts -threaded+ ghc-options: -Weverything -Wno-implicit-prelude -Wno-safe -Wno-unsafe -rtsopts -threaded build-depends:- aeson ==1.2.*- , base ==4.10.*- , bytestring ==0.10.*- , filepath ==1.4.*- , hspec ==2.4.*+ aeson >=0.11.2 && <0.12 || >=1.0.2 && <1.4+ , base >=4.9.0 && <4.12+ , bytestring >=0.10.8 && <0.11+ , filepath >=1.4.1 && <1.5+ , hspec >=2.2.3 && <2.6 , json-feed- , mime-types ==0.1.*- , network-uri ==2.6.*- , tagsoup ==0.14.*- , text ==1.2.*- , time ==1.8.*+ , mime-types >=0.1.0 && <0.2+ , network-uri >=2.6.1 && <2.7+ , tagsoup >=0.14 && <0.15+ , text >=1.2.2 && <1.3+ , time >=1.6.0 && <1.9 other-modules: Paths_json_feed default-language: Haskell2010
library/JsonFeed.hs view
@@ -27,7 +27,8 @@ import Numeric.Natural (Natural) import Text.HTML.TagSoup (Tag) -import qualified Data.Aeson as Json+import qualified Data.Aeson as Json (eitherDecode, encode)+import qualified Data.Aeson.Types as Json import qualified Data.List as List import qualified Data.Text as Text import qualified Data.Text.Encoding as Text
+ package.yaml view
@@ -0,0 +1,49 @@+name: json-feed+version: 1.0.1++category: Web+description: >+ This is an implementation of the JSON Feed spec in Haskell. The spec is+ available at <https://jsonfeed.org>. JSON Feed is similar to the Atom and RSS+ feed formats, but it is serialized as JSON rather than XML.+extra-source-files:+ - CHANGELOG.markdown+ - feeds/*.json+ - package.yaml+ - README.markdown+ - stack.yaml+github: tfausak/json-feed+license-file: LICENSE.markdown+license: MIT+maintainer: Taylor Fausak+synopsis: JSON Feed++dependencies:+ aeson: '>= 0.11.2 && < 0.12 || >= 1.0.2 && < 1.4'+ base: '>= 4.9.0 && < 4.12'+ bytestring: '>= 0.10.8 && < 0.11'+ mime-types: '>= 0.1.0 && < 0.2'+ network-uri: '>= 2.6.1 && < 2.7'+ tagsoup: '>= 0.14 && < 0.15'+ text: '>= 1.2.2 && < 1.3'+ time: '>= 1.6.0 && < 1.9'+ghc-options:+ - -Weverything+ - -Wno-implicit-prelude+ - -Wno-safe+ - -Wno-unsafe++library:+ source-dirs: library++tests:+ test:+ dependencies:+ filepath: '>= 1.4.1 && < 1.5'+ hspec: '>= 2.2.3 && < 2.6'+ json-feed: -any+ ghc-options:+ - -rtsopts+ - -threaded+ main: Main.hs+ source-dirs: tests
+ stack.yaml view
@@ -0,0 +1,1 @@+resolver: lts-11.0
+ tests/Main.hs view
@@ -0,0 +1,33 @@+module Main (main) where++import System.FilePath ((</>), (<.>))++import qualified Control.Monad as Monad+import qualified Data.ByteString.Lazy as ByteString+import qualified Data.Either as Either+import qualified JsonFeed+import qualified Test.Hspec as Hspec+++main :: IO ()+main = Hspec.hspec . Hspec.parallel . Hspec.describe "JsonFeed" $ do+ Monad.forM_ feeds $ \feed -> do+ Hspec.it ("parses the " ++ feed ++ " feed") $ do+ let file = "feeds" </> feed <.> "json"+ contents <- ByteString.readFile file+ JsonFeed.parseFeed contents `Hspec.shouldSatisfy` Either.isRight++feeds :: [String]+feeds =+ [ "allenpike.com"+ , "daringfireball.net"+ , "flyingmeat.com"+ , "hypercritical.co"+ , "inessential.com"+ , "jsonfeed.org"+ , "manton.org"+ , "maybepizza.com"+ , "shapeof.com"+ , "therecord.co"+ , "timetable.manton.org"+ ]
− tests/test.hs
@@ -1,33 +0,0 @@-module Main (main) where--import JsonFeed-import System.FilePath ((</>), (<.>))-import Test.Hspec--import qualified Control.Monad as Monad-import qualified Data.ByteString.Lazy as ByteString-import qualified Data.Either as Either---main :: IO ()-main = hspec . parallel . describe "JsonFeed" $ do- Monad.forM_ feeds $ \feed -> do- it ("parses the " ++ feed ++ " feed") $ do- let file = "feeds" </> feed <.> "json"- contents <- ByteString.readFile file- parseFeed contents `shouldSatisfy` Either.isRight--feeds :: [String]-feeds =- [ "allenpike.com"- , "daringfireball.net"- , "flyingmeat.com"- , "hypercritical.co"- , "inessential.com"- , "jsonfeed.org"- , "manton.org"- , "maybepizza.com"- , "shapeof.com"- , "therecord.co"- , "timetable.manton.org"- ]