grover 1.1.4 → 1.1.6

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: 605a1ddd3d51f652e03c28d8f6ab97b45e9f026884da2ea4772b57fc83287dd2
4
- data.tar.gz: c4bc0069f551b4e15df0b59b42175b20bc3d8130fb2981b947b832e0f2e48e14
3
+ metadata.gz: a1de71127ef3e7173bce45deeec104ec9c876dea335ad73dfc80016da64c64f7
4
+ data.tar.gz: 50dce7d9aa7ef01e12144f303868667e4d6587d0dc9a7be337c34d9679e483c0
5
5
  SHA512:
6
- metadata.gz: cfdb35168bba8db20bc0ba7cf027d13ebb61670f2a89f059710129cdd3c7460f0b95f80a0cc7fbd2f334ca25348e733eccd1ce00bd380e6d65282e3018161572
7
- data.tar.gz: '08cdc3c9c5ce2bf8c3d9c7d155db3cb558dd77e718008f7c8d5662188bf78071b611e3ad3aa2b3f32800b6595c492222c6f1a99768a2be983aa4e5e7f37b12f5'
6
+ metadata.gz: '084b8e564818202eead00cb7faef9c181e5bd394e41113fb4b87233fa9fe44ed434318240034a375f20799af909a647fc8dd816f9d74aa79ad101efaa329387f'
7
+ data.tar.gz: 5f03611f7f945dac5b75424bc879f90e639f4a97430759028f3cf36727c4c490813dc15fc68271767b1996716278484eae0d7383a42741fbd24f2d572124d4e2
@@ -16,35 +16,46 @@ const path = require('path');
16
16
 
17
17
  const _processPage = (async (convertAction, urlOrHtml, options) => {
18
18
  let browser, errors = [], tmpDir;
19
- try {
20
- tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'grover-'));
21
-
22
- const launchParams = {
23
- args: process.env.GROVER_NO_SANDBOX === 'true' ? ['--no-sandbox', '--disable-setuid-sandbox'] : [],
24
- userDataDir: tmpDir
25
- };
26
19
 
20
+ try {
27
21
  // Configure puppeteer debugging options
28
22
  const debug = options.debug; delete options.debug;
29
- if (typeof debug === 'object' && !!debug) {
30
- if (debug.headless !== undefined) { launchParams.headless = debug.headless; }
31
- if (debug.devtools !== undefined) { launchParams.devtools = debug.devtools; }
32
- }
33
-
34
- // Configure additional launch arguments
35
- const args = options.launchArgs; delete options.launchArgs;
36
- if (Array.isArray(args)) {
37
- launchParams.args = launchParams.args.concat(args);
38
- }
23
+ const browserWsEndpoint = options.browserWsEndpoint; delete options.browserWsEndpoint;
24
+ if (typeof browserWsEndpoint === "string") {
25
+ const connectParams = {
26
+ browserWSEndpoint: browserWsEndpoint,
27
+ };
39
28
 
40
- // Set executable path if given
41
- const executablePath = options.executablePath; delete options.executablePath;
42
- if (executablePath) {
43
- launchParams.executablePath = executablePath;
29
+ browser = await puppeteer.connect(connectParams);
30
+ } else {
31
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'grover-'));
32
+
33
+ const launchParams = {
34
+ args: process.env.GROVER_NO_SANDBOX === 'true' ? ['--no-sandbox', '--disable-setuid-sandbox'] : [],
35
+ userDataDir: tmpDir
36
+ };
37
+
38
+ if (typeof debug === 'object' && !!debug) {
39
+ if (debug.headless !== undefined) { launchParams.headless = debug.headless; }
40
+ if (debug.devtools !== undefined) { launchParams.devtools = debug.devtools; }
41
+ }
42
+
43
+ // Configure additional launch arguments
44
+ const args = options.launchArgs; delete options.launchArgs;
45
+ if (Array.isArray(args)) {
46
+ launchParams.args = launchParams.args.concat(args);
47
+ }
48
+
49
+ // Set executable path if given
50
+ const executablePath = options.executablePath; delete options.executablePath;
51
+ if (executablePath) {
52
+ launchParams.executablePath = executablePath;
53
+ }
54
+
55
+ // Launch the browser and create a page
56
+ browser = await puppeteer.launch(launchParams);
44
57
  }
45
58
 
46
- // Launch the browser and create a page
47
- browser = await puppeteer.launch(launchParams);
48
59
  const page = await browser.newPage();
49
60
 
50
61
  // Basic auth
@@ -70,7 +70,7 @@ class Grover
70
70
 
71
71
  def ignore_request?
72
72
  ignore_request = Grover.configuration.ignore_request
73
- return unless ignore_request.is_a?(Proc)
73
+ return false unless ignore_request.is_a?(Proc)
74
74
 
75
75
  ignore_request.call @request
76
76
  end
@@ -8,7 +8,8 @@ class Grover
8
8
  # Build options from Grover.configuration, meta_options, and passed-in options
9
9
  #
10
10
  class OptionsBuilder < Hash
11
- def initialize(options, url) # rubocop:disable Lint/MissingSuper
11
+ def initialize(options, url)
12
+ super()
12
13
  @url = url
13
14
  combined = grover_configuration
14
15
  Utils.deep_merge! combined, Utils.deep_stringify_keys(options)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Grover
4
- VERSION = '1.1.4'
4
+ VERSION = '1.1.6'
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.1.4
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Bromwich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-05 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: combine_pdf
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: childprocess
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: mini_magick
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '2.11'
83
+ - !ruby/object:Gem::Dependency
84
+ name: puma
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '6.4'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '6.4'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: rack-test
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -150,6 +178,20 @@ dependencies:
150
178
  - - "~>"
151
179
  - !ruby/object:Gem::Version
152
180
  version: '2.18'
181
+ - !ruby/object:Gem::Dependency
182
+ name: sinatra
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '3.2'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '3.2'
153
195
  - !ruby/object:Gem::Dependency
154
196
  name: simplecov
155
197
  requirement: !ruby/object:Gem::Requirement
@@ -208,14 +250,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
250
  version: 2.7.0
209
251
  - - "<"
210
252
  - !ruby/object:Gem::Version
211
- version: 3.3.0
253
+ version: 3.4.0
212
254
  required_rubygems_version: !ruby/object:Gem::Requirement
213
255
  requirements:
214
256
  - - ">="
215
257
  - !ruby/object:Gem::Version
216
258
  version: '0'
217
259
  requirements: []
218
- rubygems_version: 3.4.4
260
+ rubygems_version: 3.3.7
219
261
  signing_key:
220
262
  specification_version: 4
221
263
  summary: A Ruby gem to transform HTML into PDF, PNG or JPEG by wrapping the NodeJS