pdfgen 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -7
  3. data/VERSION +1 -1
  4. data/lib/pdfgen.rb +5 -4
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b15e1c362c296f17ef5cced91eb85d3771ae1bf7
4
- data.tar.gz: b559a21a82d92ca01bfbec59a7847e43a786a38e
3
+ metadata.gz: 46f2787d1d479c943502fde607fb660011b872b4
4
+ data.tar.gz: 0eeb3181ea2b9e49f32aa3aee96e09a4524ab0fe
5
5
  SHA512:
6
- metadata.gz: 8e1199a39edd356c000e58064ff09cc8473aaf800cccb6daa5e2bd6f39fc1418eee0caed69930b6ac98bb2d2459dd34b5aa75d0b8e6a040da4969852ec50613b
7
- data.tar.gz: 700f05c1e96c61fb424f6c43a05aec1456ed6922da8272683c2ab139167e2b94b54f411dd5b95a7ab3e56c19dcff520dbd040725fd061ded4514dcd91531994e
6
+ metadata.gz: 7fdad867f3e1b0a8a59382c77c68a6b10cbf8354a5f798074fae44b9e4b971e07fa55d28fca7b4868d1ad054ca478f4cc5140f37a91b5992c7c27d1f5a1564d9
7
+ data.tar.gz: 90fdc2ad7bfb56d8dfee04712a79ba00c9cb46bd5dabbb872db2f92a38115332a4715f763123b0856f79e28091f777333997b7ee6d36610e6ff0decd544f286f
@@ -1,3 +1,9 @@
1
+ ## Pdfgen 0.6.0 (June 14, 2019)
2
+
3
+ * Use capture3 to also capture stderror which is where Node error messages are output.
4
+
5
+ This allows Pdfgen to include the error from Node in the exception that is raised.
6
+
1
7
  ## Pdfgen 0.5.0 (September 3, 2018)
2
8
 
3
9
  * Changes how the wait for timeout works slightly.
@@ -26,25 +32,25 @@
26
32
  Need to soon add testing for different versions of Node to discover what the
27
33
  compatible versions are.
28
34
 
29
- * Adds handling of any unhandled rejection by logging the error and then exiting.
35
+ - Adds handling of any unhandled rejection by logging the error and then exiting.
30
36
 
31
37
  This change provides better error messaged from Node and also prevents the process
32
38
  from hanging and not exiting when there was an error.
33
39
 
34
- * Fixes bug where launch options were no longer being passed to the Javascript.
40
+ - Fixes bug where launch options were no longer being passed to the Javascript.
35
41
 
36
42
  ## Pdfgen 0.4.1 (May 15, 2018)
37
43
 
38
- * Fixes bug with regex that checks if a URL was passed.
44
+ - Fixes bug with regex that checks if a URL was passed.
39
45
 
40
46
  ## Pdfgen 0.4.0 (May 12, 2018)
41
47
 
42
- * Can now provide a URL to the initializer.
48
+ - Can now provide a URL to the initializer.
43
49
 
44
50
  Providing a URL to the initializer will now nagivate to the URL and then render the
45
51
  page to a PDF.
46
52
 
47
- * Adds a debug mode.
53
+ - Adds a debug mode.
48
54
 
49
55
  Calling debug_mode and passing in a time in milliseconds to wait with the browser
50
56
  not headless. This may change to be forever in the future but that would cause weird
@@ -54,11 +60,11 @@
54
60
 
55
61
  ## Pdfgen 0.3.1 (April 23, 2018)
56
62
 
57
- * Fixes bug by passing the wait_for_timeout to the Javascript script.
63
+ - Fixes bug by passing the wait_for_timeout to the Javascript script.
58
64
 
59
65
  ## Pdfgen 0.3.0 (April 23, 2018)
60
66
 
61
- * Allows optional period in milliseconds to wait for the page to finish rendering.
67
+ - Allows optional period in milliseconds to wait for the page to finish rendering.
62
68
 
63
69
  A new optional wait timeout that will occur after the content has been set,
64
70
  the media emulation set, and the viewport has been set to allow for javascript
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -74,21 +74,22 @@ class Pdfgen
74
74
  end
75
75
 
76
76
  pdf_output = nil
77
+ error_output = nil
77
78
  status = nil
78
79
  if @html
79
80
  file = Tempfile.new('input_html')
80
81
  file.write(@html)
81
82
  file.close
82
- pdf_output, status = Open3.capture2(MAKE_PDF_COMMAND, file.path, stdin_data: stdin_options.to_json)
83
+ pdf_output, error_output, status = Open3.capture3(MAKE_PDF_COMMAND, file.path, stdin_data: stdin_options.to_json)
83
84
  file.unlink
84
85
  else
85
86
  stdin_options = stdin_options.merge(url: @url)
86
87
  stdin_options = stdin_options.merge(url_options: @url_options)
87
- pdf_output, status = Open3.capture2(MAKE_PDF_COMMAND, stdin_data: stdin_options.to_json)
88
+ pdf_output, error_output, status = Open3.capture3(MAKE_PDF_COMMAND, stdin_data: stdin_options.to_json)
88
89
  end
89
90
 
90
91
  unless status.success?
91
- raise 'There was an unknown error running node to create the pdf. Check your logs for output that might assist in debugging.'
92
+ raise "This error was encountered running node to create the pdf: #{error_output}"
92
93
  end
93
94
  unless pdf_output
94
95
  raise 'There was an error creating the temporary file used to pass the HTML to node.'
@@ -98,4 +99,4 @@ class Pdfgen
98
99
  end
99
100
 
100
101
 
101
- # Use a new API that uses method chaining to configure the PDF and that queues up strings to put in a js file to run puppeteer
102
+ # Use a new API that uses method chaining to configure the PDF and that queues up strings to put in a js file to run puppeteer
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Fox