pdfmonkey 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b013f0822a5527e71c4cdc59db5db57db55f99a211385794edee27cc7d80136
4
- data.tar.gz: 2bd5e46799f7f211bfc113108c5a6bdcf8e6149c9d8584f7c7af907f168348cb
3
+ metadata.gz: 843327045d2dbf9a6b334691b4bfe2f7829aa762742e43ff300da4489fe31cd4
4
+ data.tar.gz: 0474d3b3aa3ab6211412530fae2cce07bea0a3c1efcf2160c49385cfe5abd422
5
5
  SHA512:
6
- metadata.gz: be01b68099f078ab891f171abcdb8ad4f87db248235fe4cc1a93d5fc382a99dc097e9d72d06a3dc687be399ddd58713d01d1467fbc3c255e6ddcececc39aa517
7
- data.tar.gz: d4f5cab8cebf933b09860df3b60829bd3b4d8a43cb316c5058125881ac46f85b5ed84cde22ed9766df71e659d84d0521df1201fa7b1dd9d55181c0122ce641b7
6
+ metadata.gz: f1be649b5126163a455569c0790344ff9b35fecfb45689af0591fa0f6de890b662240ae546bd3c5e1d43c44c081b43285ce634bd78b7ea7a02ee01520116ed49
7
+ data.tar.gz: e80f9186f53f1144676084f3c8b88d4e2200f98cb9fb3c8f9d18e7d0a9c00e9aa2f2fd8dc4cd0bbd2df19f213e2ebe96d035f6b524aceeef960067571e45860f
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ specs:
7
+ name: Run specs with Ruby ${{matrix.ruby}}
8
+ runs-on: ubuntu-latest
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby: ['2.6', '2.7', '3.0', '3.1']
13
+ include:
14
+ - ruby: head
15
+ experimental: true
16
+ steps:
17
+ - uses: actions/checkout@v3
18
+ - uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{matrix.ruby}}
21
+ bundler-cache: true
22
+ - name: Run specs
23
+ run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.1
4
+
5
+ * Fixing the handling of validation errors to expose errors correctly
6
+
3
7
  ## 0.8.0
4
8
 
5
9
  * Adding support for single error responses
data/Gemfile.lock CHANGED
@@ -1,73 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pdfmonkey (0.8.0)
4
+ pdfmonkey (0.8.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.2)
10
- coveralls (0.8.23)
11
- json (>= 1.8, < 3)
12
- simplecov (~> 0.16.1)
13
- term-ansicolor (~> 1.3)
14
- thor (>= 0.19.4, < 2.0)
15
- tins (~> 1.6)
16
- diff-lcs (1.4.4)
17
- docile (1.4.0)
18
- jaro_winkler (1.5.4)
19
- json (2.6.1)
20
- parallel (1.21.0)
21
- parser (3.0.2.0)
10
+ diff-lcs (1.5.0)
11
+ parallel (1.22.0)
12
+ parser (3.1.1.0)
22
13
  ast (~> 2.4.1)
23
- powerpack (0.1.3)
24
- rainbow (3.0.0)
14
+ rainbow (3.1.1)
25
15
  rake (13.0.6)
26
- rspec (3.10.0)
27
- rspec-core (~> 3.10.0)
28
- rspec-expectations (~> 3.10.0)
29
- rspec-mocks (~> 3.10.0)
30
- rspec-core (3.10.1)
31
- rspec-support (~> 3.10.0)
32
- rspec-expectations (3.10.1)
16
+ regexp_parser (2.2.1)
17
+ rexml (3.2.5)
18
+ rspec (3.11.0)
19
+ rspec-core (~> 3.11.0)
20
+ rspec-expectations (~> 3.11.0)
21
+ rspec-mocks (~> 3.11.0)
22
+ rspec-core (3.11.0)
23
+ rspec-support (~> 3.11.0)
24
+ rspec-expectations (3.11.0)
33
25
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.10.0)
35
- rspec-mocks (3.10.2)
26
+ rspec-support (~> 3.11.0)
27
+ rspec-mocks (3.11.0)
36
28
  diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.10.0)
38
- rspec-support (3.10.3)
39
- rubocop (0.60.0)
40
- jaro_winkler (~> 1.5.1)
29
+ rspec-support (~> 3.11.0)
30
+ rspec-support (3.11.0)
31
+ rubocop (1.26.0)
41
32
  parallel (~> 1.10)
42
- parser (>= 2.5, != 2.5.1.1)
43
- powerpack (~> 0.1)
33
+ parser (>= 3.1.0.0)
44
34
  rainbow (>= 2.2.2, < 4.0)
35
+ regexp_parser (>= 1.8, < 3.0)
36
+ rexml
37
+ rubocop-ast (>= 1.16.0, < 2.0)
45
38
  ruby-progressbar (~> 1.7)
46
- unicode-display_width (~> 1.4.0)
39
+ unicode-display_width (>= 1.4.0, < 3.0)
40
+ rubocop-ast (1.16.0)
41
+ parser (>= 3.1.1.0)
47
42
  ruby-progressbar (1.11.0)
48
- simplecov (0.16.1)
49
- docile (~> 1.1)
50
- json (>= 1.8, < 3)
51
- simplecov-html (~> 0.10.0)
52
- simplecov-html (0.10.2)
53
- sync (0.5.0)
54
- term-ansicolor (1.7.1)
55
- tins (~> 1.0)
56
- thor (1.1.0)
57
- tins (1.29.1)
58
- sync
59
- unicode-display_width (1.4.1)
43
+ unicode-display_width (2.1.0)
60
44
 
61
45
  PLATFORMS
62
46
  ruby
63
47
 
64
48
  DEPENDENCIES
65
49
  bundler (~> 2.2)
66
- coveralls (~> 0.8)
67
50
  pdfmonkey!
68
51
  rake (~> 13.0)
69
52
  rspec (~> 3.8)
70
- rubocop (~> 0.60.0)
53
+ rubocop (~> 1.26)
71
54
 
72
55
  BUNDLED WITH
73
56
  2.2.30
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # PDFMonkey
2
2
 
3
- [![Build Status](https://travis-ci.com/pdfmonkey/pdfmonkey-ruby.svg?branch=master)](https://travis-ci.com/pdfmonkey/pdfmonkey-ruby)
4
- [![Coverage Status](https://coveralls.io/repos/github/pdfmonkey/pdfmonkey-ruby/badge.svg?branch=master)](https://coveralls.io/github/pdfmonkey/pdfmonkey-ruby?branch=master)
3
+ [![CI](https://github.com/pdfmonkey/pdfmonkey-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/pdfmonkey/pdfmonkey-ruby/actions/workflows/ci.yml)
5
4
 
6
5
  This gem is the quickest way to use the [PDFMonkey](https://www.pdfmonkey.io) API.
7
6
 
@@ -59,7 +58,7 @@ document.status # => 'success'
59
58
  document.download_url # => 'https://…'
60
59
  ```
61
60
 
62
- :warning: The download URL of a document is only valid **for 30 seconds**. Passed this delay, reload the document to obtain a new one:
61
+ :warning: The download URL of a document is only valid **for 1 hour**. Passed this delay, reload the document to obtain a new one:
63
62
 
64
63
  ```ruby
65
64
  document.reload!
@@ -141,6 +140,12 @@ document = Pdfmonkey::Document.generate(template_id, data)
141
140
  document.status # => 'error'
142
141
  document.errors # => ["Document template must exist"]
143
142
 
143
+ # If your quota is depleted
144
+ document = Pdfmonkey::Document.generate(template_id, data)
145
+
146
+ document.status # => 'error'
147
+ document.errors # => { "status" => ["You’ve reached your quota for th..."] }
148
+
144
149
  # If the network is down
145
150
  document = Pdfmonkey::Document.generate(template_id, data)
146
151
 
@@ -44,8 +44,10 @@ module Pdfmonkey
44
44
  errors =
45
45
  if payload['error']
46
46
  [payload['error']]
47
- else
48
- payload['errors'].to_a.map { |error| error['detail'] }
47
+ elsif payload['errors'].is_a?(Array)
48
+ payload['errors'].map { |error| error['detail'] }
49
+ elsif payload['errors'].is_a?(Hash)
50
+ payload['errors']
49
51
  end
50
52
 
51
53
  { errors: errors, status: 'error' }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pdfmonkey
4
- VERSION = '0.8.0'
4
+ VERSION = '0.8.1'
5
5
  end
data/pdfmonkey.gemspec CHANGED
@@ -23,8 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.2'
26
- spec.add_development_dependency 'coveralls', '~> 0.8'
27
26
  spec.add_development_dependency 'rake', '~> 13.0'
28
27
  spec.add_development_dependency 'rspec', '~> 3.8'
29
- spec.add_development_dependency 'rubocop', '~> 0.60.0'
28
+ spec.add_development_dependency 'rubocop', '~> 1.26'
30
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfmonkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Courtois
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-04 00:00:00.000000000 Z
11
+ date: 2022-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.2'
27
- - !ruby/object:Gem::Dependency
28
- name: coveralls
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.8'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.8'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +58,14 @@ dependencies:
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: 0.60.0
61
+ version: '1.26'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: 0.60.0
68
+ version: '1.26'
83
69
  description: Generate awesome PDF with web technologies at pdfmonkey.io
84
70
  email:
85
71
  - scourtois_github@cubyx.fr
@@ -87,10 +73,10 @@ executables: []
87
73
  extensions: []
88
74
  extra_rdoc_files: []
89
75
  files:
76
+ - ".github/workflows/ci.yml"
90
77
  - ".gitignore"
91
78
  - ".rspec"
92
79
  - ".rubocop.yml"
93
- - ".travis.yml"
94
80
  - CHANGELOG.md
95
81
  - CODE_OF_CONDUCT.md
96
82
  - Gemfile
@@ -125,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
111
  - !ruby/object:Gem::Version
126
112
  version: '0'
127
113
  requirements: []
128
- rubygems_version: 3.0.3
114
+ rubygems_version: 3.2.22
129
115
  signing_key:
130
116
  specification_version: 4
131
117
  summary: Connect to the PDFMonkey API
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- language: ruby
2
-
3
- before_install: gem install bundler --version '~> 1.17'
4
- cache: bundler
5
- dist: bionic
6
-
7
- matrix:
8
- allow_failures:
9
- - rvm: ruby-head
10
- - rvm: jruby-head
11
- fast_finish: true
12
-
13
- notifications:
14
- email: false
15
- slack:
16
- secure: YimzUcOW2fIo+CyYB5sBgUydS49JNtTIEowyinPAfDifAYgRNx/8c5kPk0aLk8klbnNBd8pMene/i4MIfApRuUmzAkGLe/1CCbotGn7zN7R6S46tpkGaHyMya5leiQemT6gIeL5+J4mQwDcTppXYh9kNTSYKh6RNLJxS7XUZZrNqOK6R2e/hX71aqUJTA5laSQ5mR5Hvyl9kUaJW5b77myXiU6VdrHmCl3sZ9hMqe6mroyBbVOAf1eFQMo7QX9HuLTUHJA2KIpnA7cLEXLINtnKjkhRVR0hcuGMETJhrJI/Ylqi1kf3PRPqkD/Q9msBo01OcRSoGwTjQ2IS1gOcYDowgvpJhkvx2v17fk4j1w3zR5KHSYJlrYOnr+ayU9K3LTs62X8ppVHff6pkKjOEF+p1Mayk/DqbaaH0PnCxqBqJOqZ5kFSkz6y4DDQzVuYILi6qUfgZFQJ01LNR7zbJAI6v9xDqREPG/Bfh7QI5z4eETlZWF9CVX6OARYm43to/wLLg2AEEduoMjexMoIxXRgzsTyBnxKYW3P+0oXWtiH68PXEKF9qAEl8lK4tTjbPBiEgXgUMDWQIiG0y6M567Rg8s8CUiw5ZsQTGJE+9zn4OkM/3VTce1mNLoZPyF66S5sXTPFXjieHCnMS3vegc3OJzLI/Xpx/lPDEU+8CYBaA1I=
17
-
18
- rvm:
19
- - ruby-head
20
- - 2.6
21
- - 2.5
22
- - 2.4
23
- - jruby-head