epub-parser 0.1.7 → 0.1.7.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02abe0846123f8f3d218581a102f69c2972a80e1
4
- data.tar.gz: 510bddcca86f789add0ecc4193b424063a5d23d6
3
+ metadata.gz: c1bc11e4506d0cb6d2631a97f894db7fd23d0bc6
4
+ data.tar.gz: bb2243cee7a0113ff16ea513059505471aa2dfad
5
5
  SHA512:
6
- metadata.gz: 8c46c39e8031ab857e968dc3826e4ce0fb6d65588ef8d8e61f05672628feaaa58d25a829c1b39826cf1a04b458dcdcd2f0898578f92768bd9db866b4a5f1f6aa
7
- data.tar.gz: feea20e63185013eea0c9d5bdd0b8c0e80a4e06646b8bd106095a9eb967a0c067113915ad70458d9332d3efab120875447c90032fa4f4dedf2465d72532f1d3e
6
+ metadata.gz: ae1dab828812a9f9491af50b3f7c861082f7d4521b5f1a4ae7f4e224e2d6e33abeb574bb00bf989336be0e92b4cedc264aebf2a9cda786f6b978fdeda847c4f4
7
+ data.tar.gz: 3b64876d7a077daf087d46799a30daa4e58acb6837d04474e713bc4e4e9bf083353c65638c25254cc3aebb8b9fdcc5e318cebd614e0eb29b2504b6c5da58b7c1
@@ -1,6 +1,11 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 0.1.7.1
5
+ -------
6
+
7
+ * Don't set encoding when content is not text
8
+
4
9
  0.1.7
5
10
  -----
6
11
 
@@ -110,6 +110,10 @@ If you find other gems, please tell me or request a pull request.
110
110
  RECENT CHANGES
111
111
  --------------
112
112
 
113
+ ### 0.1.7.1
114
+
115
+ * Don't set encoding when content is not text
116
+
113
117
  ### 0.1.7
114
118
 
115
119
  * [Experimental]Add `EPUB::Searcher` module. See {file:Searcher.markdown} for details
@@ -1,5 +1,5 @@
1
1
  module EPUB
2
2
  class Parser
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.7.1"
4
4
  end
5
5
  end
@@ -95,6 +95,11 @@ module EPUB
95
95
  raw_content = Zip::Archive.open(manifest.package.book.epub_file) {|zip|
96
96
  zip.fopen(entry_name).read
97
97
  }
98
+ unless media_type.start_with?('text/') or
99
+ media_type.end_with?('xml') or
100
+ ['application/json', 'application/javascript', 'application/ecmascript', 'application/xml-dtd'].include?(media_type)
101
+ return raw_content
102
+ end
98
103
  # CharDet.detect doesn't raise Encoding::CompatibilityError
99
104
  # that is caused when trying compare CharDet's internal
100
105
  # ASCII-8BIT RegExp with a String with other encoding
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epub-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - KITAITI Makoto