hypdf 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hypdf/version.rb +1 -1
  3. data/lib/hypdf.rb +19 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f51f828068df8baab4735b1d000d8671219b648
4
- data.tar.gz: 1fe8f4b72146d677d496779c9d21b6a1b7e5b6de
3
+ metadata.gz: 81c9cdc70adf46dc47fb5fe52137f2224b37a59e
4
+ data.tar.gz: 42ffed84690a062161d381436ea091db7a51e6ac
5
5
  SHA512:
6
- metadata.gz: 55780072f8382b256cc48d2adf35877cd35b1ad483762cd4f446ba007fd87bf5dce3b2406333580e6e0af78c4477b727595986a73b09ce3d7d77365cfdffb4ba
7
- data.tar.gz: 0c6b3a2f79718fd2b23a7f5e7932296d9af9e50975f5a6ab13b55c495eca6efb952fa68b1d3f437aae1f653d6350c170388298ef8e0f3d506b1d336a24fad64f
6
+ metadata.gz: 7af4b182f612e1f4975f512c7093b0282b3506764d98b8d5db73178bb4baba3fb7b2dbafe095d47443a6c36f069d0c9745ba446608b6d616aa0b30d89e2a9e1e
7
+ data.tar.gz: f44ff2ac7059b1cba8cac4be765362160e664855cb21d46fb6f8761bd199debd321e82a35896c3fc9d57743387db5f182258df7b3cece1c12ac89b5a3c0239cd
data/lib/hypdf/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class HyPDF
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
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
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-09-26 00:00:00.000000000 Z
11
+ date: 2013-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httmultiparty