gepub 1.0.16 → 1.0.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93cb58ca825f4f30efeb8f1ce191ccf9bbb2e74d32f9cfd77f37dedb85cc7a3e
4
- data.tar.gz: da3618e21ad20a7f6a12c4d52fe43d1159ecdd378a5eb4bae39d1eb2558fb605
3
+ metadata.gz: d52fcb6d981cf377756f9f81200afee16dcb27ccc50ab56f9c7eadb956efa4e8
4
+ data.tar.gz: cabf27d5b82a4cebc292cbce13a61f92bbbb510193913d9fc13159785f92140f
5
5
  SHA512:
6
- metadata.gz: 0ba5fbbd7590739ef20d73af2cc3b50811c0ba330959cc784a6246bb13dbd249d32a0c9fbe3c31adb15ae4e4b9c69a7c7988cc5c62b8b6e65cdf9c105eed85d6
7
- data.tar.gz: bb66bd6e2f564ed780e0417b91e43993fb0ece0fc938095a31d10fdfff56b9c77d290df812e3ff94feb64256ac1b21e06aa2a36fb29553b6145ee89644c2f684
6
+ metadata.gz: a48073e42445dc12752eff196f6781df927bc57d5e0ac77f0496674dba4da5756189f7a40eb1dbd41ab062bcbc3f355ab5e98a499960fef15ec2d4379efcc354
7
+ data.tar.gz: 9d6d43549a1ce8757cce93e4fd80e4367e8344017f43cc8ad9de552efa1278f4b8d43d2334ef2cb34bc0724de4860f47bccfe9e106f326d8fc59454b806caac0
data/lib/gepub/book.rb CHANGED
@@ -94,15 +94,15 @@ module GEPUB
94
94
  doc.css("#{defaultns}|rootfiles > #{defaultns}|rootfile")[0]['full-path']
95
95
  end
96
96
 
97
- # Parses existing EPUB2/EPUB3 files from an IO object, and creates new Book object.
97
+ # Parses existing EPUB2/EPUB3 files from an IO object or a file path and creates new Book object.
98
98
  # book = self.parse(File.new('some.epub'))
99
99
 
100
- def self.parse(io)
100
+ def self.parse(path_or_io)
101
101
  files = {}
102
102
  package = nil
103
103
  package_path = nil
104
104
  book = nil
105
- Zip::File.open_buffer(io) do
105
+ Zip::File.open(path_or_io) do
106
106
  |zip_file|
107
107
  package, package_path = parse_container(zip_file, files)
108
108
  check_consistency_of_package(package, package_path)
@@ -384,7 +384,7 @@ EOF
384
384
  package = nil
385
385
  zip_file.each do |entry|
386
386
  if !entry.directory?
387
- files[entry.name] = zip_file.read(entry)
387
+ files[entry.name] = entry.get_input_stream(&:read)
388
388
  case entry.name
389
389
  when MIMETYPE then
390
390
  if files[MIMETYPE] != MIMETYPE_CONTENTS
data/lib/gepub/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module GEPUB
2
2
  # GEPUB gem version
3
- VERSION = "1.0.16"
3
+ VERSION = "1.0.17"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gepub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOJIMA Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-27 00:00:00.000000000 Z
11
+ date: 2024-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri