Sha256: 8f997ddc27dfb66bbce9afcdb3a48eef3039c9203bcbac0df27c5819062ccc9b
Contents?: true
Size: 848 Bytes
Versions: 21
Compression:
Stored size: 848 Bytes
Contents
require 'zipruby' module EPUB class OCF class PhysicalContainer class Zipruby < self def open Zip::Archive.open @container_path do |archive| @monitor.synchronize do begin @archive = archive yield self rescue ::Zip::Error => error raise NoEntry.from_error(error) ensure @archive = nil end end end end def read(path_name) if @archive @archive.fopen(path_name) {|entry| entry.read} else open {|container| container.read(path_name)} end rescue ::Zip::Error => error raise NoEntry.from_error(error) ensure @archive = nil end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems