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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b29220f00e289b012a01c83e1ac3a4d7fe70b034589760f3aea045069127e453
4
- data.tar.gz: f90bcb0e42bab405df3d296d4f70221684652d2e523970b9018b3a38737f8694
3
+ metadata.gz: 5d224c5c20b4f34007c3da6532eeb42a475d0414a3bfda677aecfad7fc088dc9
4
+ data.tar.gz: b4927a9fdc5e36a0a51f84c31fea04272f21a6bf527d9dba17f3d64f4414559a
5
5
  SHA512:
6
- metadata.gz: 2415a80b468c7bbe454cf622fbae3b2cef2b7450577f92845e30fbef54d602a3f46dbf4594258053f07badc847c7ab1f3ac53c72f04a385d993b85e054295448
7
- data.tar.gz: a928a1f0bc91ba18b7059fd60e44d2348d6727e4cd7d37fbc47e13cf56b1a5e9fa04d6136189a1a3e1a673ab3a86572d5ef58e7e2ca54cc797ab355327c2db37
6
+ metadata.gz: a3b24e4d736c50fe1ca8d733ada21012335695449bce33e3f3994966c069f22c93fb519bd7a7a0ca9f681767830cf863e902a718e2318dd7fe76c5e54ac5c882
7
+ data.tar.gz: f1adbfea289dcc577908132f51c609f6c37d9cf2623c6f9c573079a20151c2f49c7a28401e32d50a49f3416c3d340ef08a4608110ab8dd18c844aa6e755974d9
@@ -61,9 +61,10 @@ const _processPage = (async (convertAction, urlOrHtml, options) => {
61
61
 
62
62
  // Setup timeout option (if provided)
63
63
  let requestOptions = {};
64
- const timeout = options.timeout; delete options.timeout;
65
- if (timeout !== undefined) {
66
- requestOptions.timeout = timeout;
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() == 304) && !request.redirectChain().length > 0) {
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);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Grover
4
- VERSION = '1.0.6'
4
+ VERSION = '1.1.0'
5
5
  end
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.6
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-10-12 00:00:00.000000000 Z
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.6
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