epubinfo_with_toc 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDRiZDZjZTgyNTJiM2MwMTVkMzQ4Njg1ODQyNzc0YzVjYWEwNzhkOA==
4
+ NzU5NzFlNjU0MGZmMTczMjhiNTg4ZDMwZGMyZTUwYmYzZWQ3NDg3NA==
5
5
  data.tar.gz: !binary |-
6
- M2Y5Mzg4NWY3NTVlYzg4YjNjNzJjZmIyMzk2NDA4YmEyYjIwMjY2MA==
6
+ YWYwZjdiYzMzMDhiYTJmNDVmOGQxYzUzZWZhYTQyZDllNWMyNzQyNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2Y1YzI2Zjc2N2JmMzE1ZjZmZDUyMDA0ZjJkMTY2ODVmMjUxYzQzMTBkYzY3
10
- MzEyYzc4Y2Y2MTkyYThkY2ZkOTNkN2E1ODAwZTM2OTMyMmYyMjVhMGM3ZGEw
11
- YmRhNjAyOGY3ZjQwMDE4N2VhYjQ4Njk5YTM5NGY4NzEwMWY1ZWY=
9
+ ZDE3OTBjYzEzZTc1MzVmNTk1YjQyYTFhN2JiZGQ3MjUxMjVkZDM1OGIwNTc1
10
+ ZTQyN2RmNjc2MTA5NjNiMTdjYTE5ZTVlMmUxODIzYzMzNzllZjZhYzE3ZDQx
11
+ NWFlNjQ4NWIxZWQwYTg1N2ZiMDZmMzJjZDI0MWMyMTkxYTNjYjA=
12
12
  data.tar.gz: !binary |-
13
- Mjc2ZTE2MGU5YzNhNWNkMDlhNDVmNjc5Mjg2MjU1YzlhZDNlMDVkZDlhZWM2
14
- MGMwYTE2YTY0ZmY1MTI1MGJmMjdkOTc1MDk3YTgyOTcwYWI4YmEwMTVjMjI0
15
- ZmE2NzBiOGNiYTYzY2NkNTljOGFmMjlkZjFkODRiOGQ1NmZjYmQ=
13
+ NDEzNDFhMTdiZjA1OWEwYjU4MTNiNTdkZTIwYTcyOWNkMTcwY2Q4OTdlMzVi
14
+ YmZiNGM5NGExNjNkNzQ5MjFiYWUxOWJhMTc0NGQ1YzkyM2M4ZTJhNDVjM2Y4
15
+ MWFmMjNmNmZjYmRkZmEyOTc2NzFmMGFiNGI1ZGQxZWIxMjNjYTM=
data/README.md CHANGED
@@ -71,7 +71,7 @@ end
71
71
  ```
72
72
 
73
73
  ## Changelog
74
- **0.5.1** *Januari 13,2014*
74
+ **0.5.2** *Januari 13,2014*
75
75
 
76
76
  * navPoint can be nested.
77
77
 
@@ -58,12 +58,13 @@ class Resource
58
58
 
59
59
  def spine
60
60
  @spine ||=
61
- begin
62
- spine_resources = @table_of_contents.spine.first.xpath('./itemref').map { |s| s['idref'] }
63
- self.to_a.select {|r| spine_resources.include?(r[:id])}
64
- end
61
+ begin
62
+ spine_resources = @table_of_contents.spine.first.xpath('./itemref').map { |s| s['idref'] }
63
+ spine_resources.map{|a| self.to_a.select{|t| t[:id].eql?(a)}}.flatten
64
+ end
65
65
  end
66
66
 
67
+
67
68
  def ncx
68
69
  @ncx ||=
69
70
  begin
@@ -114,9 +115,7 @@ class Resource
114
115
  uri_ref = ''
115
116
  order = ''
116
117
 
117
- #nav_point = @table_of_contents.document.xpath("//navPoint[starts-with(content/@src,'#{uri}')]").first
118
- content = @table_of_contents.document.xpath("//content[starts-with(@src,'#{uri}')]")
119
- nav_point = content.search('../../navPoint').first
118
+ nav_point = @table_of_contents.document.xpath("//navPoint[descendant-or-self::*//content[starts-with(@src, '#{uri}')]]").first
120
119
 
121
120
  if nav_point #unless nav_point.nil? || nav_point.empty?
122
121
  label = nav_point.at('navLabel text').content || ''
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epubinfo_with_toc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christof Dorner
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-13 00:00:00.000000000 Z
12
+ date: 2014-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubyzip
@@ -31,14 +31,16 @@ dependencies:
31
31
  requirements:
32
32
  - - ! '>='
33
33
  - !ruby/object:Gem::Version
34
- version: 1.4.2
34
+ version: !binary |-
35
+ MS40LjI=
35
36
  type: :runtime
36
37
  prerelease: false
37
38
  version_requirements: !ruby/object:Gem::Requirement
38
39
  requirements:
39
40
  - - ! '>='
40
41
  - !ruby/object:Gem::Version
41
- version: 1.4.2
42
+ version: !binary |-
43
+ MS40LjI=
42
44
  - !ruby/object:Gem::Dependency
43
45
  name: rspec
44
46
  requirement: !ruby/object:Gem::Requirement
@@ -59,28 +61,32 @@ dependencies:
59
61
  requirements:
60
62
  - - ~>
61
63
  - !ruby/object:Gem::Version
62
- version: 0.8.7
64
+ version: !binary |-
65
+ MC44Ljc=
63
66
  type: :development
64
67
  prerelease: false
65
68
  version_requirements: !ruby/object:Gem::Requirement
66
69
  requirements:
67
70
  - - ~>
68
71
  - !ruby/object:Gem::Version
69
- version: 0.8.7
72
+ version: !binary |-
73
+ MC44Ljc=
70
74
  - !ruby/object:Gem::Dependency
71
75
  name: jeweler
72
76
  requirement: !ruby/object:Gem::Requirement
73
77
  requirements:
74
78
  - - ~>
75
79
  - !ruby/object:Gem::Version
76
- version: 1.8.3
80
+ version: !binary |-
81
+ MS44LjM=
77
82
  type: :development
78
83
  prerelease: false
79
84
  version_requirements: !ruby/object:Gem::Requirement
80
85
  requirements:
81
86
  - - ~>
82
87
  - !ruby/object:Gem::Version
83
- version: 1.8.3
88
+ version: !binary |-
89
+ MS44LjM=
84
90
  - !ruby/object:Gem::Dependency
85
91
  name: redcarpet
86
92
  requirement: !ruby/object:Gem::Requirement