palapala_pdf 0.1.17 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/palapala/chrome_process.rb +2 -2
- data/lib/palapala/version.rb +1 -1
- data/lib/palapala.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 837d0f0eeca4484a6c8e6ccb8f5113889653d6076eb0a25b2ed13997de2c4656
|
4
|
+
data.tar.gz: 34561e1c72d7ff0f363055f0a9264e5a8fe2a30f31888e82679fa62a779fd054
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6402a0c71a59806fd91241118a51a993a1439afdde35f2b969ffb23c6df38bc071685801b08490f4789828536b0f1a10c86f6fe5ce48af79e8a7350fe3ff8b21
|
7
|
+
data.tar.gz: 40f62b4e5c9e14460c92ead8ed7439044a5d69636b670a6cb823349de069cb8e1be855a3cb2480a7dc9ae63d218d2125d2c7708aad856d64e4a06d3b13877e5f
|
@@ -83,7 +83,7 @@ module Palapala
|
|
83
83
|
system("#{chrome_path} --version") if Palapala.debug
|
84
84
|
# Launch chrome-headless-shell with the --remote-debugging-port parameter
|
85
85
|
params = [ "--disable-gpu", "--remote-debugging-port=9222", "--remote-debugging-address=0.0.0.0" ]
|
86
|
-
params.
|
86
|
+
params.concat(Palapala.chrome_params) if Palapala.chrome_params
|
87
87
|
pid = if Palapala.debug
|
88
88
|
spawn(chrome_path, *params)
|
89
89
|
else
|
@@ -98,7 +98,7 @@ module Palapala
|
|
98
98
|
|
99
99
|
def self.spawn_chrome_from_path
|
100
100
|
params = [ "--headless", "--disable-gpu", "--remote-debugging-port=9222" ]
|
101
|
-
params.
|
101
|
+
params.concat(Palapala.chrome_params) if Palapala.chrome_params
|
102
102
|
# Spawn an existing chrome with the path and parameters
|
103
103
|
Process.spawn(chrome_path, *params)
|
104
104
|
end
|
data/lib/palapala/version.rb
CHANGED
data/lib/palapala.rb
CHANGED
@@ -32,4 +32,14 @@ module Palapala
|
|
32
32
|
self.headless_chrome_path = ENV.fetch("HEADLESS_CHROME_PATH", nil)
|
33
33
|
self.headless_chrome_url = ENV.fetch("HEADLESS_CHROME_URL", "http://localhost:9222")
|
34
34
|
self.chrome_headless_shell_version = ENV.fetch("CHROME_HEADLESS_SHELL_VERSION", "stable")
|
35
|
+
self.chrome_params = ENV.fetch("HEADLESS_CHROME_PARAMS", nil)&.split || []
|
36
|
+
|
37
|
+
if !ENV["DYNO"].nil? || File.exist?('/.dockerenv')
|
38
|
+
self.chrome_params ||= []
|
39
|
+
self.chrome_params << "--no-sandbox"
|
40
|
+
end
|
41
|
+
|
42
|
+
if !ENV["DYNO"].nil?
|
43
|
+
self.headless_chrome_path = "chrome"
|
44
|
+
end
|
35
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: palapala_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koen Handekyn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|