epub_book 0.1.23 → 0.1.26

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
  SHA256:
3
- metadata.gz: 44b412b721dc1e443c1a9bb1a685f2e6968ff0c8506bf9be113f94e4827f4da0
4
- data.tar.gz: 8e5344dd88fd9e3f550e6962912dae4fe67057f214f08852188642c9d92bfc6d
3
+ metadata.gz: 946872639cc8cd6cf97fb2933097d26721df9b29648539f9b5ced5c59ea9ac8a
4
+ data.tar.gz: 6c6b7be1de5fabc49cf8f3b207ece01c7896c5daf1e4f1a237b58de65bb57207
5
5
  SHA512:
6
- metadata.gz: cee0921eee24cc47105b595e850612c7cf34f9a8ebd2de1d447867f59eaaf1624847f3526a6313ecb61ef447477df26e6a2d11d2fb1a5827b5b72697bfdf0c9b
7
- data.tar.gz: 6ef82d375814323d227f8c210ae14f2d498aff710ae9268b38c78af32b0723fd8a367cebb40a4f00c7346ebd6ca7789f17be2d6100883b0e99564a2baaa5dbee
6
+ metadata.gz: 6e302741e48eb13886eea0fb109c3c436f89b9a51ef4ea91ff1b16ffc9f9ad3b9994cc769df5d82a55174c6e5c00552ea3f52d543688b58eb9960c36281a53e9
7
+ data.tar.gz: f19b461e0240dd8faf897924f4de5bf1bab19d7e72a2b4dece4f0fc2f9ff68f93187fc7d95114e5dddd060521235f7bb8ba30f069e654858e3ec759ba2bad5c6
data/epub_book.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency 'http','~> 2.1'
30
+ spec.add_dependency 'http','~> 5.0', '>= 5.0.4'
31
31
  spec.add_runtime_dependency 'nokogiri', '~> 1.11', '>= 1.11.4'
32
32
  spec.add_dependency 'eeepub', '~> 0.8.1'
33
33
  spec.add_dependency 'zip-zip', '~> 0.3'
@@ -224,8 +224,10 @@ module EpubBook
224
224
  #is valid encoding
225
225
  def judge_encoding(str)
226
226
  EpubBook.logger.info str.encoding
227
- /<meta.*?charset\s*=[\s\"\']?utf-8/i =~ str ? str : str.force_encoding('gbk').encode!('utf-8',invalid: :replace, undef: :replace)
228
- str.scrub! unless str.valid_encoding?
227
+ #/<meta.*?charset\s*=[\s\"\']?utf-8/i =~ str ? str : str.force_encoding('gbk').encode!('utf-8',invalid: :replace, undef: :replace)
228
+
229
+ str.scrub!('') unless str.valid_encoding?
230
+ str.encode!('utf-8') if str.encoding.name != 'UTF-8'
229
231
 
230
232
  EpubBook.logger.info "-------encode 后 #{str.encoding}"
231
233
  str
@@ -1,3 +1,3 @@
1
1
  module EpubBook
2
- VERSION = "0.1.23"
2
+ VERSION = "0.1.26"
3
3
  end
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.23
4
+ version: 0.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - qmliu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2022-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.1'
19
+ version: '5.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 5.0.4
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '2.1'
29
+ version: '5.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 5.0.4
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: nokogiri
29
35
  requirement: !ruby/object:Gem::Requirement