epub-metadata 2.2.0.1 → 2.3.0
raw patch · 19 files changed
+31/−27 lines, 19 filessetup-changedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- LICENSE +1/−1
- Setup.hs +1/−1
- epub-metadata.cabal +2/−2
- src/Codec/Epub/Archive.hs +1/−1
- src/Codec/Epub/IO.hs +12/−8
- src/Codec/Epub/Opf/Common.hs +1/−1
- src/Codec/Epub/Opf/Format/Guide.hs +1/−1
- src/Codec/Epub/Opf/Format/Manifest.hs +1/−1
- src/Codec/Epub/Opf/Format/Metadata.hs +1/−1
- src/Codec/Epub/Opf/Format/Package.hs +1/−1
- src/Codec/Epub/Opf/Format/Spine.hs +1/−1
- src/Codec/Epub/Opf/Format/Util.hs +1/−1
- src/Codec/Epub/Opf/Package.hs +1/−1
- src/Codec/Epub/Opf/Package/Guide.hs +1/−1
- src/Codec/Epub/Opf/Package/Manifest.hs +1/−1
- src/Codec/Epub/Opf/Package/Metadata.hs +1/−1
- src/Codec/Epub/Opf/Package/Spine.hs +1/−1
- src/Codec/Epub/Opf/Parse.hs +1/−1
- testsuite/opf-parse.hs +1/−1
LICENSE view
@@ -1,4 +1,4 @@-Copyright Dino Morelli 2010, 2011+Copyright Dino Morelli 2010-2012 All rights reserved.
Setup.hs view
@@ -1,6 +1,6 @@ #! /usr/bin/env runhaskell --- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
epub-metadata.cabal view
@@ -1,10 +1,10 @@ name: epub-metadata-version: 2.2.0.1+version: 2.3.0 cabal-version: >= 1.8 build-type: Simple license: BSD3 license-file: LICENSE-copyright: 2010, 2011 Dino Morelli+copyright: 2010-2012 Dino Morelli author: Dino Morelli maintainer: Dino Morelli <dino@ui3.info> stability: stable
src/Codec/Epub/Archive.hs view
@@ -1,4 +1,4 @@--- Copyright: 2011 Dino Morelli+-- Copyright: 2011-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/IO.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> @@ -18,7 +18,9 @@ import Codec.Archive.Zip import Control.Arrow.ListArrows ( (>>>), deep ) import Control.Monad.Error-import qualified Data.ByteString.Lazy.Char8 as B+import qualified Data.ByteString.Char8 as BS+import Data.ByteString.Lazy ( fromChunks )+import qualified Data.ByteString.Lazy.Char8 as BL import System.Directory import System.FilePath import Text.Regex@@ -61,15 +63,17 @@ let mbEntry = findEntryByPath filePath archive maybe (throwError $ "Unable to locate file " ++ filePath)- (return . B.unpack . fromEntry) mbEntry+ (return . BL.unpack . fromEntry) mbEntry -- | Get the contents of the OPF Package Document from a ByteString opfContentsFromBS :: (MonadError String m, MonadIO m)- => B.ByteString -- ^ contents of the zip file+ => BS.ByteString -- ^ contents of the zip file -> m (FilePath, String) -- ^ path and contents of the OPF Package Document-opfContentsFromBS bytes = do- let archive = toArchive bytes+opfContentsFromBS strictBytes = do+ -- Need to turn this strict byte string into a lazy one+ let lazyBytes = fromChunks [strictBytes]+ let archive = toArchive lazyBytes {- We need to first extract the container.xml file It's required to have a certain path and name in the epub@@ -91,10 +95,10 @@ => FilePath -- ^ path to ePub zip file -> m (FilePath, String) -- ^ path and contents of the OPF Package Document opfContentsFromZip zipPath = do- {- Lazily read this file into a ByteString, send to + {- Strictly read this file into a ByteString, send to opfContentsFromBS -}- zipFileBytes <- liftIO $ B.readFile zipPath+ zipFileBytes <- liftIO $ BS.readFile zipPath opfContentsFromBS zipFileBytes
src/Codec/Epub/Opf/Common.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Format/Guide.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Format/Manifest.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Format/Metadata.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Format/Package.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Format/Spine.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Format/Util.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Package.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Package/Guide.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Package/Manifest.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Package/Metadata.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Package/Spine.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
src/Codec/Epub/Opf/Parse.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>
testsuite/opf-parse.hs view
@@ -1,4 +1,4 @@--- Copyright: 2010, 2011 Dino Morelli+-- Copyright: 2010-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>