grover 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/grover/js/processor.js +11 -4
- data/lib/grover/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d224c5c20b4f34007c3da6532eeb42a475d0414a3bfda677aecfad7fc088dc9
|
4
|
+
data.tar.gz: b4927a9fdc5e36a0a51f84c31fea04272f21a6bf527d9dba17f3d64f4414559a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3b24e4d736c50fe1ca8d733ada21012335695449bce33e3f3994966c069f22c93fb519bd7a7a0ca9f681767830cf863e902a718e2318dd7fe76c5e54ac5c882
|
7
|
+
data.tar.gz: f1adbfea289dcc577908132f51c609f6c37d9cf2623c6f9c573079a20151c2f49c7a28401e32d50a49f3416c3d340ef08a4608110ab8dd18c844aa6e755974d9
|
data/lib/grover/js/processor.js
CHANGED
@@ -61,9 +61,10 @@ const _processPage = (async (convertAction, urlOrHtml, options) => {
|
|
61
61
|
|
62
62
|
// Setup timeout option (if provided)
|
63
63
|
let requestOptions = {};
|
64
|
-
|
65
|
-
if (
|
66
|
-
|
64
|
+
let requestTimeout = options.requestTimeout; delete options.requestTimeout;
|
65
|
+
if (requestTimeout === undefined) requestTimeout = options.timeout;
|
66
|
+
if (requestTimeout !== undefined) {
|
67
|
+
requestOptions.timeout = requestTimeout;
|
67
68
|
}
|
68
69
|
|
69
70
|
// Setup user agent (if provided)
|
@@ -121,7 +122,7 @@ const _processPage = (async (convertAction, urlOrHtml, options) => {
|
|
121
122
|
const raiseOnRequestFailure = options.raiseOnRequestFailure; delete options.raiseOnRequestFailure;
|
122
123
|
if (raiseOnRequestFailure) {
|
123
124
|
page.on('requestfinished', (request) => {
|
124
|
-
if (request.response() && !(request.response().ok() || request.response().status()
|
125
|
+
if (request.response() && !(request.response().ok() || request.response().status() === 304) && !request.redirectChain().length > 0) {
|
125
126
|
errors.push(request);
|
126
127
|
}
|
127
128
|
});
|
@@ -230,6 +231,12 @@ const _processPage = (async (convertAction, urlOrHtml, options) => {
|
|
230
231
|
throw new RequestFailedError(errors);
|
231
232
|
}
|
232
233
|
|
234
|
+
// Setup conversion timeout
|
235
|
+
if (options.convertTimeout !== undefined) {
|
236
|
+
options.timeout = options.convertTimeout;
|
237
|
+
delete options.convertTimeout;
|
238
|
+
}
|
239
|
+
|
233
240
|
// If we're running puppeteer in headless mode, return the converted PDF
|
234
241
|
if (debug === undefined || (typeof debug === 'object' && (debug.headless === undefined || debug.headless))) {
|
235
242
|
return await page[convertAction](options);
|
data/lib/grover/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Bromwich
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: combine_pdf
|
@@ -181,7 +181,7 @@ homepage: https://github.com/Studiosity/grover
|
|
181
181
|
licenses:
|
182
182
|
- MIT
|
183
183
|
metadata: {}
|
184
|
-
post_install_message:
|
184
|
+
post_install_message:
|
185
185
|
rdoc_options: []
|
186
186
|
require_paths:
|
187
187
|
- lib
|
@@ -199,8 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
201
|
requirements: []
|
202
|
-
rubygems_version: 3.0.
|
203
|
-
signing_key:
|
202
|
+
rubygems_version: 3.0.9
|
203
|
+
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: A Ruby gem to transform HTML into PDF, PNG or JPEG by wrapping the NodeJS
|
206
206
|
Google Puppeteer driver for Chromium
|