epub_book 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epub_book/book.rb +3 -2
- data/lib/epub_book/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f97b7dd57c6d5f908aad4c6ff2e02bd0d850e5e
|
4
|
+
data.tar.gz: 0b0a7fb475fff417e0412b2758ddcb74d4dd5e25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59a3c190c686e0ec7bf42f3c40e142ab3bd699679d489f7c2f93078861fbf6266eea540a02bd73253385b5e53c7318939936ca6eb1d68de7c8287ced27e64c2b
|
7
|
+
data.tar.gz: 5ef21c42347c49fb71c6282e7820f928bb17be68b5d1ba0cbf55013ce983bbb01d8db165f4c57362ab8cdebf0735d1dcbe8a45ad3a11ceeb6227015db911b24a
|
data/lib/epub_book/book.rb
CHANGED
@@ -132,8 +132,8 @@ module EpubBook
|
|
132
132
|
elsif _href.start_with?("/")
|
133
133
|
_href = "#{link_host}#{_href}"
|
134
134
|
else
|
135
|
-
@path_name ||=
|
136
|
-
_href = "#{@path_name}
|
135
|
+
@path_name ||= @index_url[/.*\//]
|
136
|
+
_href = "#{@path_name}#{_href}"
|
137
137
|
end
|
138
138
|
|
139
139
|
book[:files] << {label: item.text, url: _href}
|
@@ -188,6 +188,7 @@ module EpubBook
|
|
188
188
|
private
|
189
189
|
#is valid encoding
|
190
190
|
def judge_encoding(str)
|
191
|
+
str.scrub! unless str.valid_encoding?
|
191
192
|
/<meta.*?charset\s*=[\s\"\']?utf-8/i =~ str ? str : str.force_encoding('gbk').encode('utf-8')
|
192
193
|
end
|
193
194
|
|
data/lib/epub_book/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epub_book
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- qmliu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|