grover 1.0.6 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grover/js/{processor.js → processor.cjs} +11 -4
- data/lib/grover/middleware.rb +1 -1
- data/lib/grover/processor.rb +1 -1
- data/lib/grover/version.rb +1 -1
- data/lib/grover.rb +1 -1
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b99e2ab2724c1384347e40dd33199bd943fd4ec371f0cbf1c539ce6e3cca81f7
|
4
|
+
data.tar.gz: eb96813f2e5ef10d50ce5b1dfe4bb0cfaffc54d7dd212c10901e7f85ff8b9fdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633d31ee5053ec6d6c00f0e0ac2e68c0a5768cfbf201be61b56e35b6912d1f8f1720e56457eb8fb212bd85842a74a16e3a4d806f2dccfd166223df0ffae3163d
|
7
|
+
data.tar.gz: 714be51eb85beae33685cf8d11812fbb62fa3dfaec16a5da599ec96b26982c3dacdf916630eed9775567275cdee229c780a00a79435be9b1237ba38ec6e72381
|
@@ -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/middleware.rb
CHANGED
data/lib/grover/processor.rb
CHANGED
data/lib/grover/version.rb
CHANGED
data/lib/grover.rb
CHANGED
@@ -32,7 +32,7 @@ class Grover
|
|
32
32
|
# @param [Hash] options Optional parameters to pass to PDF processor
|
33
33
|
# see https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions
|
34
34
|
#
|
35
|
-
def initialize(url, options
|
35
|
+
def initialize(url, **options)
|
36
36
|
@url = url.to_s
|
37
37
|
@options = OptionsBuilder.new(options, @url)
|
38
38
|
@root_path = @options.delete 'root_path'
|
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.
|
4
|
+
version: 1.1.2
|
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:
|
11
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: combine_pdf
|
@@ -170,7 +170,7 @@ files:
|
|
170
170
|
- lib/grover/configuration.rb
|
171
171
|
- lib/grover/errors.rb
|
172
172
|
- lib/grover/html_preprocessor.rb
|
173
|
-
- lib/grover/js/processor.
|
173
|
+
- lib/grover/js/processor.cjs
|
174
174
|
- lib/grover/middleware.rb
|
175
175
|
- lib/grover/options_builder.rb
|
176
176
|
- lib/grover/options_fixer.rb
|
@@ -180,8 +180,10 @@ files:
|
|
180
180
|
homepage: https://github.com/Studiosity/grover
|
181
181
|
licenses:
|
182
182
|
- MIT
|
183
|
-
metadata:
|
184
|
-
|
183
|
+
metadata:
|
184
|
+
allowed_push_host: https://rubygems.org
|
185
|
+
rubygems_mfa_required: 'true'
|
186
|
+
post_install_message:
|
185
187
|
rdoc_options: []
|
186
188
|
require_paths:
|
187
189
|
- lib
|
@@ -189,18 +191,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
189
191
|
requirements:
|
190
192
|
- - ">="
|
191
193
|
- !ruby/object:Gem::Version
|
192
|
-
version: 2.
|
194
|
+
version: 2.6.0
|
193
195
|
- - "<"
|
194
196
|
- !ruby/object:Gem::Version
|
195
|
-
version: 3.
|
197
|
+
version: 3.2.0
|
196
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
199
|
requirements:
|
198
200
|
- - ">="
|
199
201
|
- !ruby/object:Gem::Version
|
200
202
|
version: '0'
|
201
203
|
requirements: []
|
202
|
-
rubygems_version: 3.
|
203
|
-
signing_key:
|
204
|
+
rubygems_version: 3.3.7
|
205
|
+
signing_key:
|
204
206
|
specification_version: 4
|
205
207
|
summary: A Ruby gem to transform HTML into PDF, PNG or JPEG by wrapping the NodeJS
|
206
208
|
Google Puppeteer driver for Chromium
|