ruby-epub 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ruby-epub.rb +6 -3
- metadata +3 -3
data/lib/ruby-epub.rb
CHANGED
@@ -66,10 +66,10 @@ class Epub
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def cover_image
|
69
|
-
content, img_name =
|
69
|
+
content, img_name = cover_by_meta_cover
|
70
70
|
if !content
|
71
|
-
content, img_name =
|
72
|
-
elsif !content
|
71
|
+
# content, img_name = cover_by_cover_id
|
72
|
+
# elsif !content
|
73
73
|
content, img_name = cover_image_by_html
|
74
74
|
end
|
75
75
|
|
@@ -87,6 +87,7 @@ class Epub
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def cover_image_by_html
|
90
|
+
puts "enter by html"
|
90
91
|
cover_item = @opf.search("//package/guide/reference[@type='cover']")
|
91
92
|
if cover_item && cover_item.first
|
92
93
|
cover_url = cover_item.first['href']
|
@@ -107,6 +108,7 @@ class Epub
|
|
107
108
|
end
|
108
109
|
|
109
110
|
def cover_by_meta_cover
|
111
|
+
puts "enter meta cover"
|
110
112
|
img_id = @opf.search("//meta[@name='cover']")
|
111
113
|
if img_id && img_id.first
|
112
114
|
img_item = @opf.search("//manifest/item[@id='"+ img_id.first['content'] + "']")
|
@@ -121,6 +123,7 @@ class Epub
|
|
121
123
|
end
|
122
124
|
|
123
125
|
def cover_by_cover_id
|
126
|
+
puts "by id"
|
124
127
|
img_item = @opf.at_xpath("//manifest/item[@id='cover']")
|
125
128
|
if img_item
|
126
129
|
img_url = @base_path + img_item['href']
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-epub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: rubyzip
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|