pdfkit 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pdfkit might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bed642993a544476d0b9ed06d2b6dcdb6bcac722eee1c3decbc0a6c0d307668d
4
- data.tar.gz: 4ad6010df3d11509774cee9d74477c463258db0e4a845e77243d42ad1d517353
3
+ metadata.gz: de215391f5d6f31b3bb381eca4662d19fda9c628d582862388e5d8180b10c73e
4
+ data.tar.gz: 402ec1719d3548fce4550ae150d48090951c1597b7b0ac7f8482682aadacf381
5
5
  SHA512:
6
- metadata.gz: 7dd8eee00c8793c11011056b7cc4f4ae83f487972aabddd3a55f14341d75b2263baf09501202ace3921417d50bc902be616fd75268bc0c395fcab0a071b041c4
7
- data.tar.gz: 4b0ecd0f3ca2ba8ad8b5eb7beca56a1c15ba72902664dfe602daeb8e3fb8bf880496e77566d5bfe0d1159b5690599001fd6c4523a95aa2c3b73aa39abbdc9c50
6
+ metadata.gz: 48e4d2d1460b51560536001e7e9c7874e297b8d365ec4b3c57bf8831d0becbc8f6b381d876ca64f8ae8066084f94db50ddc1289b22f0218e396da8c918289638
7
+ data.tar.gz: c785e6cde8040feb20c5d48fa94dc7e736b1d8350441c7418fc542a233b08d92031d00608f0bac47d4d230fb5bed84b4b70fe16b085bfae1c96cc6a90e92746a
@@ -1,8 +1,8 @@
1
1
  rvm:
2
- - 1.9.2
3
- - 1.9.3
4
- - 2.0
5
- - 2.1
2
+ - 2.2
3
+ - 2.3
4
+ - 2.4
5
+ - 2.5
6
6
 
7
7
  before_install:
8
8
  - gem update --system
@@ -12,5 +12,5 @@ before_script:
12
12
  - "export DISPLAY=:99.0"
13
13
  - "sh -e /etc/init.d/xvfb start"
14
14
  - "sudo apt-get -qq -y install fontconfig libxrender1"
15
- - "wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-precise-amd64.deb"
16
- - "sudo dpkg -i wkhtmltox-0.12.1_linux-precise-amd64.deb"
15
+ - "wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.trusty_amd64.deb"
16
+ - "sudo apt-get install ./wkhtmltox_0.12.5-1.trusty_amd64.deb"
@@ -1,3 +1,8 @@
1
+ 2019-02-21
2
+ =================
3
+ * Bump to 0.8.4
4
+ * Removed support for Ruby < 2.2
5
+
1
6
  2015-08-26
2
7
  =================
3
8
  * Bump to 0.8.2
data/README.md CHANGED
@@ -76,7 +76,6 @@ PDFKit.configure do |config|
76
76
  }
77
77
  # Use only if your external hostname is unavailable on the server.
78
78
  config.root_url = "http://localhost"
79
- config.protocol = 'http'
80
79
  config.verbose = false
81
80
  end
82
81
  ```
@@ -1,10 +1,11 @@
1
1
  class PDFKit
2
2
  class Configuration
3
3
  attr_accessor :meta_tag_prefix, :default_options, :root_url
4
- attr_writer :verbose
4
+ attr_writer :use_xvfb, :verbose
5
5
 
6
6
  def initialize
7
7
  @verbose = false
8
+ @use_xvfb = false
8
9
  @meta_tag_prefix = 'pdfkit-'
9
10
  @default_options = {
10
11
  :disable_smart_shrinking => false,
@@ -35,6 +36,14 @@ class PDFKit
35
36
  end
36
37
  end
37
38
 
39
+ def executable
40
+ using_xvfb? ? "xvfb-run #{wkhtmltopdf}" : wkhtmltopdf
41
+ end
42
+
43
+ def using_xvfb?
44
+ @use_xvfb
45
+ end
46
+
38
47
  def quiet?
39
48
  !@verbose
40
49
  end
@@ -54,6 +63,7 @@ class PDFKit
54
63
  # @example
55
64
  # PDFKit.configure do |config|
56
65
  # config.wkhtmltopdf = '/usr/bin/wkhtmltopdf'
66
+ # config.use_xvfb = true
57
67
  # config.verbose = true
58
68
  # end
59
69
 
@@ -53,7 +53,7 @@ class PDFKit
53
53
  end
54
54
 
55
55
  def executable
56
- PDFKit.configuration.wkhtmltopdf
56
+ PDFKit.configuration.executable
57
57
  end
58
58
 
59
59
  def to_pdf(path=nil)
@@ -1,3 +1,3 @@
1
1
  class PDFKit
2
- VERSION = "0.8.3"
2
+ VERSION = '0.8.4'
3
3
  end
@@ -12,6 +12,17 @@ describe PDFKit::Configuration do
12
12
  end
13
13
  end
14
14
 
15
+ describe "#executable" do
16
+ it "returns wkhtmltopdf by default" do
17
+ expect(subject.executable).to eql subject.wkhtmltopdf
18
+ end
19
+
20
+ it "uses xvfb-run wrapper when option of using xvfb is configured" do
21
+ expect(subject).to receive(:using_xvfb?).and_return(true)
22
+ expect(subject.executable).to include 'xvfb-run'
23
+ end
24
+ end
25
+
15
26
  describe "#default_options" do
16
27
  it "sets defaults for the command options" do
17
28
  expect(subject.default_options[:disable_smart_shrinking]).to eql false
@@ -53,6 +64,22 @@ describe PDFKit::Configuration do
53
64
  end
54
65
  end
55
66
 
67
+ describe "#using_xvfb?" do
68
+ it "can be configured to true" do
69
+ subject.use_xvfb = true
70
+ expect(subject.using_xvfb?).to eql true
71
+ end
72
+
73
+ it "defaults to false" do
74
+ expect(subject.using_xvfb?).to eql false
75
+ end
76
+
77
+ it "can be configured to false" do
78
+ subject.use_xvfb = false
79
+ expect(subject.using_xvfb?).to eql false
80
+ end
81
+ end
82
+
56
83
  describe "#verbose?" do
57
84
  it "can be configured to true" do
58
85
  subject.verbose = true
@@ -384,6 +384,24 @@ describe PDFKit do
384
384
  end
385
385
  end
386
386
 
387
+ it "does not use xvfb-run wrapper by default" do
388
+ pdfkit = PDFKit.new('html')
389
+ expect(pdfkit.command).not_to include 'xvfb-run'
390
+ end
391
+
392
+ it "uses xvfb-run wrapper when option of using xvfb is configured" do
393
+ PDFKit.configure do |config|
394
+ config.use_xvfb = true
395
+ end
396
+
397
+ pdfkit = PDFKit.new('html')
398
+ expect(pdfkit.command).to include 'xvfb-run'
399
+
400
+ PDFKit.configure do |config|
401
+ config.use_xvfb = false
402
+ end
403
+ end
404
+
387
405
  context "on windows" do
388
406
  before do
389
407
  allow(PDFKit::OS).to receive(:host_is_windows?).and_return(true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Pace
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-14 00:00:00.000000000 Z
12
+ date: 2019-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport