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 +4 -4
- data/lib/gepub/book.rb +4 -4
- data/lib/gepub/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d52fcb6d981cf377756f9f81200afee16dcb27ccc50ab56f9c7eadb956efa4e8
|
4
|
+
data.tar.gz: cabf27d5b82a4cebc292cbce13a61f92bbbb510193913d9fc13159785f92140f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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(
|
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.
|
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] =
|
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
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.
|
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-
|
11
|
+
date: 2024-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|