eepub 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eepub/epub.rb +3 -3
- data/lib/eepub/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 025305fc54a605c35c60cfc8cfe7dda9046e7a5d
|
4
|
+
data.tar.gz: 7d2ff2df5a02f29e0c6611f43993fa08b92f10cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cb94e81780bf8eb68665fb899f40d6bac235a350012b0caca545edaa48b12d8ed329ae80aefeac78e570c4f57f94aa698e478d76486fd80ce76aa6d2ccd181d
|
7
|
+
data.tar.gz: 890c918e8afb1ef46254f46597cb0cb1ff5432934a1a59bd630b3609797bf820fb6332d4f7150dd6dbbbd0582135770a85fd472738e3f2772b0827a85d7cbd6c
|
data/lib/eepub/epub.rb
CHANGED
@@ -14,7 +14,7 @@ module Eepub
|
|
14
14
|
@title ||= Zip::File.open(@path) {|zip|
|
15
15
|
package_xml = REXML::Document.new(package_entry(zip).get_input_stream)
|
16
16
|
|
17
|
-
package_xml
|
17
|
+
REXML::XPath.first(package_xml, '//dc:title', 'dc' => 'http://purl.org/dc/elements/1.1/').text
|
18
18
|
}
|
19
19
|
end
|
20
20
|
|
@@ -26,7 +26,7 @@ module Eepub
|
|
26
26
|
Zip::File.open to do |zip|
|
27
27
|
entry = package_entry(zip)
|
28
28
|
xml = REXML::Document.new(entry.get_input_stream)
|
29
|
-
title_node = xml
|
29
|
+
title_node = REXML::XPath.first(xml, '//dc:title', 'dc' => 'http://purl.org/dc/elements/1.1/')
|
30
30
|
|
31
31
|
title_node.text = title
|
32
32
|
|
@@ -43,7 +43,7 @@ module Eepub
|
|
43
43
|
def package_entry(zip)
|
44
44
|
container_entry = zip.find_entry('META-INF/container.xml')
|
45
45
|
container_xml = REXML::Document.new(container_entry.get_input_stream)
|
46
|
-
path = container_xml
|
46
|
+
path = REXML::XPath.first(container_xml, '//container:rootfile/@full-path', 'container' => 'urn:oasis:names:tc:opendocument:xmlns:container').value
|
47
47
|
|
48
48
|
zip.find_entry(path)
|
49
49
|
end
|
data/lib/eepub/version.rb
CHANGED