hyperpdf 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZDVlMWI0NDZiYWE1ZWE4NDU4ZGQ3NTFlZjZmYTlhYWE4ZWVjM2Q3Mw==
5
+ data.tar.gz: !binary |-
6
+ YzBlYzkxNDNhMTRjNjllMTYxNGYxNTU2NWJiYzRlMDZjNWU1YjliOA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NzRhZjVkZGY1ZDM2Y2JiMWUxOTZlMzIzMjFlMDEwMWYxMzZmYzQyMmJkNGQ3
10
+ OTFiYzIwZGIxYzhkYmRkNDFmMDRhM2FhYTBhNTliZDc4MDBmMDU2MWEzZmQ3
11
+ ZWMxNzIyNmY2ZjY1YjdhYWU1OWMyMWYzZGM3YThjZWZjNWI0MmI=
12
+ data.tar.gz: !binary |-
13
+ ZDgxNjExYzMxZWFmOGM1ZjY3NzQxZDg5NmVkMTk3YjFmODc1ZTI2MWIyZDY3
14
+ OGQzNmQyYWMyOTg3Yjc0MTVkZjJjOTY5MzdkNDMzN2I3ZmFkMzQ3NGFjZGE1
15
+ YjI3MDJiZTkwOTk0MjgzODlhOTFmZGMzZDcwNzU2NmMyMTM5Mzg=
@@ -43,10 +43,21 @@ class HyperPDF
43
43
  resp["url"] || resp["id"]
44
44
  end
45
45
 
46
+ # Returns PDF meta information
47
+ # @return [Hash] PDF meta information (nubmer of pages, page size and PDF version)
48
+ def meta
49
+ {
50
+ pages: @last_headers['hyperpdf-pages'].to_i,
51
+ page_size: @last_headers['hyperpdf-page-size'],
52
+ pdf_version: @last_headers['hyperpdf-pdf-version'].to_f
53
+ }
54
+ end
55
+
46
56
  private
47
57
 
48
58
  def make_request(options={})
49
59
  resp = HTTParty.post('https://api.hyper-pdf.com/pdf', options.merge(body: @request_body))
60
+ @last_headers = resp.headers
50
61
  case resp.code
51
62
  when 200 then resp
52
63
  when 400 then raise HyperPDF::ContentRequired
@@ -1,3 +1,3 @@
1
1
  class HyperPDF
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperpdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
5
- prerelease:
4
+ version: 0.2.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - redfield
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-01 00:00:00.000000000 Z
11
+ date: 2013-06-03 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: httparty
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -49,27 +46,26 @@ files:
49
46
  homepage: http://www.hyper-pdf.com
50
47
  licenses:
51
48
  - MIT
49
+ metadata: {}
52
50
  post_install_message:
53
51
  rdoc_options: []
54
52
  require_paths:
55
53
  - lib
56
54
  required_ruby_version: !ruby/object:Gem::Requirement
57
- none: false
58
55
  requirements:
59
56
  - - ! '>='
60
57
  - !ruby/object:Gem::Version
61
58
  version: '0'
62
59
  required_rubygems_version: !ruby/object:Gem::Requirement
63
- none: false
64
60
  requirements:
65
61
  - - ! '>='
66
62
  - !ruby/object:Gem::Version
67
63
  version: '0'
68
64
  requirements: []
69
65
  rubyforge_project:
70
- rubygems_version: 1.8.23
66
+ rubygems_version: 2.0.3
71
67
  signing_key:
72
- specification_version: 3
68
+ specification_version: 4
73
69
  summary: Ruby wrapper around the HyperPDF API
74
70
  test_files:
75
71
  - spec/hyperpdf_spec.rb