postdoc 0.3.3 → 0.3.4

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: 866cf4c6e0cfe521087c96c5aea85b003a139d55467ccd77e757c6c45084cb17
4
- data.tar.gz: c2789db75c33ede4a402e06c815d7e9a33689960d53773940fca96f350ec1f2c
3
+ metadata.gz: a6a52e2638a2925d5834959e3a716295aaf5a66e8be797452c507b72f4fa7e0a
4
+ data.tar.gz: cca67e571e577b9ac1b770a4b9049b66953beab03ab13d6046d90684af0daf91
5
5
  SHA512:
6
- metadata.gz: d8fedb4b38ebc3fbb45577423c478211c7d801bb917742b2493c1f57869b51aaba1877efac94383e1fbdfb77bd07d3c0ec5eb9edb2a8e6f732453045e865a797
7
- data.tar.gz: af3070ea0e915b3f44349f926e5fe08d1c2270f4bc7143a1352145a679e0882392b5f1e02800e6a7240612c16fa182fa1282424262498e171d89a6b7726d656b
6
+ metadata.gz: e7ccb76057f1cf0112dc9150fba8de4b9aef0261ed0f229a15af3030a4e4b10bb80fb8929dddf40aa16af10bf0133778da3cb7d5ed99f81a93b73267cb4e3b21
7
+ data.tar.gz: 7e5b5c6eca2c4020b4e8c27078aed985bcfb4e1b4f0e4bd0c3a7f8585e094069a8eb723619045f1fe2971c9cc9d3c4bff92205b6225dacdfc9e1849f10dee3be
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Postdoc
3
4
  class ChromeProcess
4
5
  attr_reader :pid, :port
@@ -11,7 +12,7 @@ module Postdoc
11
12
 
12
13
  def alive?
13
14
  @alive ||= test_socket!
14
- rescue
15
+ rescue Errno::ECONNREFUSED
15
16
  false
16
17
  end
17
18
 
@@ -9,6 +9,7 @@ module Postdoc
9
9
  def initialize(port)
10
10
  @port = port
11
11
  100.times { setup_connection_or_wait && break }
12
+ raise 'ChromeClient couldn\'t launch' if @client.blank?
12
13
  end
13
14
 
14
15
  def print_pdf_from_html(file_path,
@@ -25,6 +26,8 @@ module Postdoc
25
26
  printBackground: true,
26
27
  marginTop: options[:margin_top] || 1,
27
28
  marginBottom: options[:margin_bottom] || 1,
29
+ marginLeft: options[:margin_left] || 1,
30
+ marginRight: options[:margin_right] || 1,
28
31
  displayHeaderFooter: !!(header_template || footer_template),
29
32
  headerTemplate: header_template || '',
30
33
  footerTemplate: footer_template || ''
@@ -38,7 +41,7 @@ module Postdoc
38
41
  def setup_connection_or_wait
39
42
  @client = ChromeRemote.client(port: @port)
40
43
  true
41
- rescue
44
+ rescue Errno::ECONNREFUSED
42
45
  sleep(0.1)
43
46
  false
44
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Groeneveld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-03 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chrome_remote