chupa-text-decomposer-pdf 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/chupa-text-decomposer-pdf.gemspec +1 -1
- data/doc/text/news.md +6 -0
- data/lib/chupa-text/decomposers/pdf.rb +10 -2
- data/test/test-pdf.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: c22ec29af1551ea0f0b191604892bd822d789ff9
|
4
|
+
data.tar.gz: b7bdb38c1a591eb73c6ccbaedf98b2d6e99fc4cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a73016b65242e1b3fc3fc3f3ea9ec12cf1523ebdae32ccc386793a3622688a2a4934dee94cd6bf3a907f1515f601a2f26202955a00d852c669ca07dab975fa7c
|
7
|
+
data.tar.gz: 9af603e00307e9b68204cafcd2bb56263f8d62f250b893a1d642e055919f8983ac2cb5712f225b1492ae8ab7de8bed8d7fd92616531cf16cb76a548bc3a92e01
|
@@ -22,7 +22,7 @@ end
|
|
22
22
|
|
23
23
|
Gem::Specification.new do |spec|
|
24
24
|
spec.name = "chupa-text-decomposer-pdf"
|
25
|
-
spec.version = "1.0.
|
25
|
+
spec.version = "1.0.4"
|
26
26
|
spec.homepage = "https://github.com/ranguba/chupa-text-decomposer-pdf"
|
27
27
|
spec.authors = ["Kouhei Sutou"]
|
28
28
|
spec.email = ["kou@clear-code.com"]
|
data/doc/text/news.md
CHANGED
@@ -24,8 +24,16 @@ module ChupaText
|
|
24
24
|
registry.register("pdf", self)
|
25
25
|
|
26
26
|
def target?(data)
|
27
|
-
|
28
|
-
|
27
|
+
return true if data.mime_type == "application/pdf"
|
28
|
+
|
29
|
+
return false if data.body.nil?
|
30
|
+
|
31
|
+
case data.extension
|
32
|
+
when nil, "pdf"
|
33
|
+
data.body.start_with?("%PDF-1")
|
34
|
+
else
|
35
|
+
false
|
36
|
+
end
|
29
37
|
end
|
30
38
|
|
31
39
|
def decompose(data)
|
data/test/test-pdf.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chupa-text-decomposer-pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05
|
11
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chupa-text
|