docmago_client 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docmago_client.rb +6 -1
- data/lib/docmago_client/error.rb +1 -0
- data/lib/docmago_client/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: c89287299ea4a9adcee215136397c4e267a4d112
|
4
|
+
data.tar.gz: a2ba36a6770c4cc4e8c00e62feb4d75864c86754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10474ccbe476a4102b2ef29c3f015d59ddf422cd3b5168b53edb867c45f6ea8cb3f7e264963ff306a0693fc8f42b4812113fcc1d17bb89bde5e2c8d070c08857
|
7
|
+
data.tar.gz: 138a91ba6ae4de434fa3028345ef3f597e6d96df9f69c6d599c74520f17840ff024e3133120060ade651a5d2997e855180b1ed1b29e6962f34e743b9091d7c0b
|
data/lib/docmago_client.rb
CHANGED
@@ -42,7 +42,8 @@ module DocmagoClient
|
|
42
42
|
|
43
43
|
default_options = {
|
44
44
|
name: 'default',
|
45
|
-
type: 'pdf'
|
45
|
+
type: 'pdf',
|
46
|
+
integrity_check: true
|
46
47
|
}
|
47
48
|
|
48
49
|
options = default_options.merge(options)
|
@@ -68,6 +69,10 @@ module DocmagoClient
|
|
68
69
|
}
|
69
70
|
end
|
70
71
|
|
72
|
+
if options[:integrity_check] && response.headers['X-Docmago-Checksum'] != Digest::MD5.hexdigest(response.body)
|
73
|
+
raise DocmagoClient::Error::IntegrityCheckError.new, 'File corrupt (invalid MD5 checksum)'
|
74
|
+
end
|
75
|
+
|
71
76
|
if block_given?
|
72
77
|
ret_val = nil
|
73
78
|
Tempfile.open('docmago') do |f|
|
data/lib/docmago_client/error.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docmago_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Habermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|