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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fe7276f081f1db142ac3e005ac279dd0a35b2396b587ae8bcd209ae97e90c2c
4
- data.tar.gz: 78e368110876e932aeef7b08c1e54f8cdc2f1674e15e85a6e375d9ce3a730146
3
+ metadata.gz: 837d0f0eeca4484a6c8e6ccb8f5113889653d6076eb0a25b2ed13997de2c4656
4
+ data.tar.gz: 34561e1c72d7ff0f363055f0a9264e5a8fe2a30f31888e82679fa62a779fd054
5
5
  SHA512:
6
- metadata.gz: 5641d6158bfb6ca8dfadd9ba108b2a440d5f756396d7636d5b0f78c214f1ec9b9159176e1dd8cf76ff2346cf8234b7969482599cb4a5550ead5ee67fc54ace59
7
- data.tar.gz: ebddc3f997d6b7a1aad9a072685b39a0888ba2854b22d11fda2da78eb4a5354ab5387b851d33e757bf2771346d933001d07bf6065e56d9f45299995ac169824b
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.merge!(Palapala.chrome_params) if Palapala.chrome_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.merge!(Palapala.chrome_params) if Palapala.chrome_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
@@ -1,3 +1,3 @@
1
1
  module Palapala
2
- VERSION = "0.1.17"
2
+ VERSION = "0.1.19"
3
3
  end
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.17
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-04 00:00:00.000000000 Z
11
+ date: 2024-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64