hypdf 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hypdf/version.rb +1 -1
- data/lib/hypdf.rb +19 -0
- 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: 81c9cdc70adf46dc47fb5fe52137f2224b37a59e
|
4
|
+
data.tar.gz: 42ffed84690a062161d381436ea091db7a51e6ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7af4b182f612e1f4975f512c7093b0282b3506764d98b8d5db73178bb4baba3fb7b2dbafe095d47443a6c36f069d0c9745ba446608b6d616aa0b30d89e2a9e1e
|
7
|
+
data.tar.gz: f44ff2ac7059b1cba8cac4be765362160e664855cb21d46fb6f8761bd199debd321e82a35896c3fc9d57743387db5f182258df7b3cece1c12ac89b5a3c0239cd
|
data/lib/hypdf/version.rb
CHANGED
data/lib/hypdf.rb
CHANGED
@@ -26,6 +26,25 @@ class HyPDF
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def jobstatus(job_id, options = {})
|
30
|
+
options[:job_id] = job_id
|
31
|
+
options[:user] ||= ENV["HYPDF_USER"]
|
32
|
+
options[:password] ||= ENV["HYPDF_PASSWORD"]
|
33
|
+
|
34
|
+
response = HTTMultiParty.get(
|
35
|
+
"#{HyPDF::HOST}/jobstatus",
|
36
|
+
query: options
|
37
|
+
)
|
38
|
+
case response.code
|
39
|
+
when 200 then JSON.parse(response.body)
|
40
|
+
when 400 then raise HyPDF::ContentRequired
|
41
|
+
when 401 then raise HyPDF::AuthorizationRequired
|
42
|
+
when 402 then raise HyPDF::PaymentRequired
|
43
|
+
when 404 then raise HyPDF::NoSuchBucket
|
44
|
+
when 500 then raise HyPDF::InternalServerError
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
29
48
|
def pdfinfo(file, options = {})
|
30
49
|
options.merge!(file: File.new(file))
|
31
50
|
JSON.parse(request('pdfinfo', options).body)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hypdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- redfield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httmultiparty
|