postdoc 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/postdoc.rb +6 -0
- data/lib/postdoc/client.rb +0 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8805f0d630a0bb6aacb1370839faec84c781d556c0f2f21a62f82cfb0127513
|
4
|
+
data.tar.gz: b0767fa2999a50cab5aa58204e4c43c16e38c0ee941c1389660c35cf6062fb15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dbb3519424aef59b75c1951599be4a91e1b9fc722c5ef75e0dd9197cd58f8f455f0db5cc0e0bcfe9efb076c8797fc8fab48d6d745cd91a5b31bf7ea97c26769
|
7
|
+
data.tar.gz: 8c33f0a51a2127c1289095c6e43031e7fa988b410da1c94aa14d7caa1b33185398553000ef5e2ca4836a7cdcc77be5339aa9a71f2f70991f36228050df190870
|
data/lib/postdoc.rb
CHANGED
@@ -20,6 +20,9 @@ module Postdoc
|
|
20
20
|
.print_pdf_from_html(html_file.path,
|
21
21
|
settings: print_settings)
|
22
22
|
ensure
|
23
|
+
if server.client.client.present?
|
24
|
+
server.client.client.send_cmd 'Browser.close'
|
25
|
+
end
|
23
26
|
server.kill
|
24
27
|
html_file.cleanup
|
25
28
|
end
|
@@ -41,6 +44,9 @@ module Postdoc
|
|
41
44
|
server = ChromeProcess.new
|
42
45
|
batch.result(server.client)
|
43
46
|
ensure
|
47
|
+
if server.client.client.present?
|
48
|
+
server.client.client.send_cmd 'Browser.close'
|
49
|
+
end
|
44
50
|
server.kill
|
45
51
|
batch.cleanup
|
46
52
|
end
|
data/lib/postdoc/client.rb
CHANGED
@@ -23,8 +23,6 @@ module Postdoc
|
|
23
23
|
client.wait_for 'Page.loadEventFired'
|
24
24
|
|
25
25
|
response = client.send_cmd 'Page.printToPDF', settings.to_cmd
|
26
|
-
|
27
|
-
client.send_cmd 'Browser.close'
|
28
26
|
|
29
27
|
Base64.decode64 response['data']
|
30
28
|
end
|
@@ -35,8 +33,6 @@ module Postdoc
|
|
35
33
|
client.wait_for 'Page.loadEventFired'
|
36
34
|
response = client.send_cmd 'Page.printToPDF', settings.to_cmd
|
37
35
|
|
38
|
-
client.send_cmd 'Browser.close'
|
39
|
-
|
40
36
|
Base64.decode64 response['data']
|
41
37
|
end
|
42
38
|
|