Sha256: a65b3bc1862b0bea1d385a12c384ccf9f71d5b69e0b77a0401257a5ef3a17d66
Contents?: true
Size: 909 Bytes
Versions: 21
Compression:
Stored size: 909 Bytes
Contents
require 'open-uri' module EPUB class OCF class PhysicalContainer class UnpackedURI < self # EPUB URI: http://example.net/path/to/book/ # container.xml: http://example.net/path/to/book/META-INF/container.xml # @param [URI, String] container_path URI of EPUB container's root directory. # For exapmle, <code>"http://example.net/path/to/book/"</code>, which # should contain <code>"http://example.net/path/to/book/META-INF/container.xml"</code> as its container.xml file. Note that this should end with "/"(slash). def initialize(container_path) super(URI(container_path)) end def open yield self end def read(path_name) (@container_path + path_name).read rescue ::OpenURI::HTTPError => error raise NoEntry.from_error(error) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems