pdfmonkey 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +20 -0
- data/.github/workflows/ci.yml +43 -0
- data/CHANGELOG.md +16 -0
- data/Gemfile.lock +32 -47
- data/README.md +8 -3
- data/lib/pdfmonkey/adapter.rb +4 -2
- data/lib/pdfmonkey/version.rb +1 -1
- data/pdfmonkey.gemspec +3 -2
- metadata +16 -15
- data/.travis.yml +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe16723c65c8ec16e6436a54fe172f703ac80ca9179c2742fdcf8c0eefedba7
|
4
|
+
data.tar.gz: 010ea3163095477fe44589a51211ae5cd284a1f88c55bb4186002d4014902f4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f2c3974bc32769ea21190fb7731d6a0c2bb08d6863f6d377bf4ca5fb0ea55d200235c7ebeba81cd9018e571eebb252c6e73774f821e8991eeb197662096e3cd
|
7
|
+
data.tar.gz: 30ac1caeb3a3839f5d0e0da4f3cb1605f929055ac900e7232960dd30279dcc3e33bb6da433ea571b775a85b9e9950a6ce52702bc1bdd217191d1a35b49d59db0
|
@@ -0,0 +1,20 @@
|
|
1
|
+
version: 2
|
2
|
+
|
3
|
+
updates:
|
4
|
+
- package-ecosystem: bundler
|
5
|
+
directory: /
|
6
|
+
open-pull-requests-limit: 10
|
7
|
+
schedule:
|
8
|
+
interval: weekly
|
9
|
+
day: monday
|
10
|
+
time: '00:00'
|
11
|
+
target-branch: master
|
12
|
+
versioning-strategy: increase-if-necessary
|
13
|
+
|
14
|
+
- package-ecosystem: github-actions
|
15
|
+
directory: /
|
16
|
+
schedule:
|
17
|
+
interval: weekly
|
18
|
+
day: monday
|
19
|
+
time: '00:00'
|
20
|
+
target-branch: master
|
@@ -0,0 +1,43 @@
|
|
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
|
+
include:
|
13
|
+
- ruby: '2.6'
|
14
|
+
bundler: 2.2.30
|
15
|
+
- ruby: '2.7'
|
16
|
+
bundler: 2.2.30
|
17
|
+
- ruby: '3.0'
|
18
|
+
bundler: 2.2.30
|
19
|
+
- ruby: '3.1'
|
20
|
+
bundler: 2.6.3
|
21
|
+
- ruby: '3.2'
|
22
|
+
bundler: 2.6.3
|
23
|
+
- ruby: '3.3'
|
24
|
+
bundler: 2.6.3
|
25
|
+
- ruby: '3.4'
|
26
|
+
bundler: 2.6.3
|
27
|
+
- ruby: head
|
28
|
+
bundler: 2.6.3
|
29
|
+
experimental: true
|
30
|
+
steps:
|
31
|
+
- uses: actions/checkout@v4
|
32
|
+
|
33
|
+
- uses: ruby/setup-ruby@v1
|
34
|
+
with:
|
35
|
+
ruby-version: ${{matrix.ruby}}
|
36
|
+
bundler: ${{matrix.bundler}}
|
37
|
+
bundler-cache: true
|
38
|
+
|
39
|
+
- name: Install gems
|
40
|
+
run: bundle _${{matrix.bundler}}_ install
|
41
|
+
|
42
|
+
- name: Run specs
|
43
|
+
run: bundle _${{matrix.bundler}}_ exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
## 0.9.0
|
6
|
+
|
7
|
+
* Testing against Ruby 3.2, 3.3 and 3.4
|
8
|
+
* Adding a Dependabot configuration file
|
9
|
+
* Adding ostruct as a runtime dependency in preparation of Ruby 3.5
|
10
|
+
* Bumping rake from 13.0.6 to 13.2.1
|
11
|
+
* Bumping rexml from 3.2.5 to 3.3.9
|
12
|
+
* Bumping rspec from 3.11 to 3.13
|
13
|
+
* Bumping actions/checkout from 3 to 4
|
14
|
+
|
15
|
+
## 0.8.1
|
16
|
+
|
17
|
+
* Fixing the handling of validation errors to expose errors correctly
|
18
|
+
|
3
19
|
## 0.8.0
|
4
20
|
|
5
21
|
* Adding support for single error responses
|
data/Gemfile.lock
CHANGED
@@ -1,73 +1,58 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pdfmonkey (0.
|
4
|
+
pdfmonkey (0.9.0)
|
5
|
+
ostruct (>= 0.6.0)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
9
10
|
ast (2.4.2)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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)
|
11
|
+
diff-lcs (1.5.1)
|
12
|
+
ostruct (0.6.1)
|
13
|
+
parallel (1.22.0)
|
14
|
+
parser (3.1.1.0)
|
22
15
|
ast (~> 2.4.1)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
rspec-
|
29
|
-
rspec-
|
30
|
-
|
31
|
-
|
32
|
-
|
16
|
+
rainbow (3.1.1)
|
17
|
+
rake (13.2.1)
|
18
|
+
regexp_parser (2.2.1)
|
19
|
+
rexml (3.3.9)
|
20
|
+
rspec (3.13.0)
|
21
|
+
rspec-core (~> 3.13.0)
|
22
|
+
rspec-expectations (~> 3.13.0)
|
23
|
+
rspec-mocks (~> 3.13.0)
|
24
|
+
rspec-core (3.13.2)
|
25
|
+
rspec-support (~> 3.13.0)
|
26
|
+
rspec-expectations (3.13.3)
|
33
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-mocks (3.
|
28
|
+
rspec-support (~> 3.13.0)
|
29
|
+
rspec-mocks (3.13.2)
|
36
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-support (3.
|
39
|
-
rubocop (
|
40
|
-
jaro_winkler (~> 1.5.1)
|
31
|
+
rspec-support (~> 3.13.0)
|
32
|
+
rspec-support (3.13.2)
|
33
|
+
rubocop (1.26.0)
|
41
34
|
parallel (~> 1.10)
|
42
|
-
parser (>=
|
43
|
-
powerpack (~> 0.1)
|
35
|
+
parser (>= 3.1.0.0)
|
44
36
|
rainbow (>= 2.2.2, < 4.0)
|
37
|
+
regexp_parser (>= 1.8, < 3.0)
|
38
|
+
rexml
|
39
|
+
rubocop-ast (>= 1.16.0, < 2.0)
|
45
40
|
ruby-progressbar (~> 1.7)
|
46
|
-
unicode-display_width (
|
41
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
42
|
+
rubocop-ast (1.16.0)
|
43
|
+
parser (>= 3.1.1.0)
|
47
44
|
ruby-progressbar (1.11.0)
|
48
|
-
|
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)
|
45
|
+
unicode-display_width (2.1.0)
|
60
46
|
|
61
47
|
PLATFORMS
|
62
48
|
ruby
|
63
49
|
|
64
50
|
DEPENDENCIES
|
65
51
|
bundler (~> 2.2)
|
66
|
-
coveralls (~> 0.8)
|
67
52
|
pdfmonkey!
|
68
53
|
rake (~> 13.0)
|
69
54
|
rspec (~> 3.8)
|
70
|
-
rubocop (~>
|
55
|
+
rubocop (~> 1.26)
|
71
56
|
|
72
57
|
BUNDLED WITH
|
73
|
-
2.
|
58
|
+
2.6.3
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# PDFMonkey
|
2
2
|
|
3
|
-
[](https://coveralls.io/github/pdfmonkey/pdfmonkey-ruby?branch=master)
|
3
|
+
[](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
|
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
|
|
data/lib/pdfmonkey/adapter.rb
CHANGED
@@ -44,8 +44,10 @@ module Pdfmonkey
|
|
44
44
|
errors =
|
45
45
|
if payload['error']
|
46
46
|
[payload['error']]
|
47
|
-
|
48
|
-
payload['errors'].
|
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' }
|
data/lib/pdfmonkey/version.rb
CHANGED
data/pdfmonkey.gemspec
CHANGED
@@ -22,9 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
+
spec.add_runtime_dependency 'ostruct', '>= 0.6.0'
|
26
|
+
|
25
27
|
spec.add_development_dependency 'bundler', '~> 2.2'
|
26
|
-
spec.add_development_dependency 'coveralls', '~> 0.8'
|
27
28
|
spec.add_development_dependency 'rake', '~> 13.0'
|
28
29
|
spec.add_development_dependency 'rspec', '~> 3.8'
|
29
|
-
spec.add_development_dependency 'rubocop', '~>
|
30
|
+
spec.add_development_dependency 'rubocop', '~> 1.26'
|
30
31
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdfmonkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Courtois
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: ostruct
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: 0.6.0
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: '1.26'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '1.26'
|
83
83
|
description: Generate awesome PDF with web technologies at pdfmonkey.io
|
84
84
|
email:
|
85
85
|
- scourtois_github@cubyx.fr
|
@@ -87,10 +87,11 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/dependabot.yml"
|
91
|
+
- ".github/workflows/ci.yml"
|
90
92
|
- ".gitignore"
|
91
93
|
- ".rspec"
|
92
94
|
- ".rubocop.yml"
|
93
|
-
- ".travis.yml"
|
94
95
|
- CHANGELOG.md
|
95
96
|
- CODE_OF_CONDUCT.md
|
96
97
|
- Gemfile
|
@@ -125,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
126
|
- !ruby/object:Gem::Version
|
126
127
|
version: '0'
|
127
128
|
requirements: []
|
128
|
-
rubygems_version: 3.
|
129
|
+
rubygems_version: 3.4.21
|
129
130
|
signing_key:
|
130
131
|
specification_version: 4
|
131
132
|
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
|