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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a03a7f0d557df85b37ddfe0d051d7a8ad7c1237
4
- data.tar.gz: c959ec316cc35d15bf4ff5a161ded27973a825ca
3
+ metadata.gz: 025305fc54a605c35c60cfc8cfe7dda9046e7a5d
4
+ data.tar.gz: 7d2ff2df5a02f29e0c6611f43993fa08b92f10cc
5
5
  SHA512:
6
- metadata.gz: 3639ea2af82b48b313435f3dfba5597a32e7fcc74d108677ea7c24208923fa81f266a12e5e1f7077d7a3a4777f090521fe334d5ecd02f2148040be5523fbe12f
7
- data.tar.gz: 56e6fd6e9becee705928da1bd5d7ee7662ddbcc389eb053d0d431461163dd933aa5a6cf39c4967668724527cd34d559f5ce5ac5c11d33d9158daa02b4fef2972
6
+ metadata.gz: 5cb94e81780bf8eb68665fb899f40d6bac235a350012b0caca545edaa48b12d8ed329ae80aefeac78e570c4f57f94aa698e478d76486fd80ce76aa6d2ccd181d
7
+ data.tar.gz: 890c918e8afb1ef46254f46597cb0cb1ff5432934a1a59bd630b3609797bf820fb6332d4f7150dd6dbbbd0582135770a85fd472738e3f2772b0827a85d7cbd6c
@@ -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.elements['//dc:title'].text
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.elements['//dc:title']
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.elements['//rootfile/@full-path'].value
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
@@ -1,3 +1,3 @@
1
1
  module Eepub
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eepub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keita Urashima