pdfkit 0.8.7.2 → 0.8.7.3

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: b5277a9f3eef01b48a25763e16c1f2ebb1bd84e9868ad0c5dbd7a09aa1e4b1dc
4
- data.tar.gz: '05039a31dc9ec5927c2dbcc7ba106e590d9e104e390f4740e5106a039120db37'
3
+ metadata.gz: d5a276883efaa6bba1349d1077bee9ed23e466e48006d7b87a8e6c6ffbbd83bb
4
+ data.tar.gz: 33632dc0ae3a917efe7a4d227ea3f1ef52a2901f125b5102f687d8058c32a135
5
5
  SHA512:
6
- metadata.gz: d2faea1df102a9429d63d210f36f6a029f233d236f8bc496bf67c2f737592516d5ddd963039e6069e422a62abbc7d2eff41dbf3657a6de520c2ffd5bc92c874f
7
- data.tar.gz: aae487ef8e56463a37a576bc6eeb8ab42ccd74b4912a1b79e027879481e773b340fd9d6802d4d929200debf5b9634bd121eae0fd9551d449ab0e732d020a3aae
6
+ metadata.gz: 8694cd8411e17b0a960a5a931f84960031a935bfdb2f6fc43b6b460c8434644694e0b8dd764fb151cb722b947c9775c9540bd2b5935a0bbb5021705bbe7f8b52
7
+ data.tar.gz: 55fdc04026f173baa10fc1f349323b243f6ef9d17142a9ab196cdc4302c2444e7a72dcf1ba68c31c3a953ab1559add63c257a1c5c1012e9a3216765ae386457e
@@ -43,6 +43,18 @@ jobs:
43
43
  steps:
44
44
  - uses: actions/checkout@v2
45
45
  - uses: ruby/setup-ruby@v1
46
+ # rubygems-update's latest is no longer compatible with ruby 2.5, so conditionally run ruby-setup setting the
47
+ # rubygem version the most recent valid version for 2.5:
48
+ # https://rubygems.org/gems/rubygems-update/versions/3.3.26
49
+ if: ${{ matrix.ruby == '2.5' }}
50
+ with:
51
+ ruby-version: ${{ matrix.ruby }}
52
+ rubygems: 3.3.26
53
+ bundler: latest
54
+ bundler-cache: true
55
+ - uses: ruby/setup-ruby@v1
56
+ # otherwise, we can use rubygems latest
57
+ if: ${{ matrix.ruby != '2.5' }}
46
58
  with:
47
59
  ruby-version: ${{ matrix.ruby }}
48
60
  rubygems: latest
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ 2023-02-27
2
+ =================
3
+ * Bump to 0.8.7.3
4
+ * Allow passing a `Pathname` object to the `path` argument by @yujideveloper in https://github.com/pdfkit/pdfkit/pull/522
5
+ * Update repeatable options by @mguidetti in https://github.com/pdfkit/pdfkit/pull/524
6
+
1
7
  2022-10-18
2
8
  =================
3
9
  * Bump to 0.8.7.2
data/lib/pdfkit/pdfkit.rb CHANGED
@@ -49,7 +49,7 @@ class PDFKit
49
49
  args = [*executable]
50
50
  args.concat(@renderer.options_for_command)
51
51
  args << @source.to_input_for_command
52
- args << (path ? path : '-')
52
+ args << (path ? path.to_s : '-')
53
53
  args
54
54
  end
55
55
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class PDFKit
4
- VERSION = '0.8.7.2'
4
+ VERSION = '0.8.7.3'
5
5
  end
@@ -3,9 +3,9 @@
3
3
  class PDFKit
4
4
  class WkHTMLtoPDF
5
5
  attr_reader :options
6
- # Pulled from:
7
- # https://github.com/wkhtmltopdf/wkhtmltopdf/blob/ebf9b6cfc4c58a31349fb94c568b254fac37b3d3/README_WKHTMLTOIMAGE#L27
8
- REPEATABLE_OPTIONS = %w[--allow --cookie --custom-header --post --post-file --run-script].freeze
6
+ # Pulled from:
7
+ # https://github.com/wkhtmltopdf/wkhtmltopdf/blob/6a57c1449797d6cb915921fb747f3ac36199241f/docs/usage/wkhtmltopdf.txt#L104
8
+ REPEATABLE_OPTIONS = %w[--allow --bypass-proxy-for --cookie --custom-header --post --post-file --run-script --replace].freeze
9
9
  SPECIAL_OPTIONS = %w[cover toc].freeze
10
10
 
11
11
  def initialize(options)
data/spec/pdfkit_spec.rb CHANGED
@@ -45,8 +45,8 @@ describe PDFKit do
45
45
  end
46
46
 
47
47
  it "transforms complex keys into command-line arguments" do
48
- pdfkit = PDFKit.new('html', :replace => {'value' => 'something else'} )
49
- expect(pdfkit.options).to have_key('--replace')
48
+ pdfkit = PDFKit.new('html', :header_left => {'value' => 'something else'} )
49
+ expect(pdfkit.options).to have_key('--header-left')
50
50
  end
51
51
 
52
52
  it "drops options with false or falsey values" do
@@ -72,8 +72,8 @@ describe PDFKit do
72
72
  end
73
73
 
74
74
  it "parses hash option values into an array" do
75
- pdfkit = PDFKit.new('html', :replace => {'value' => 'something else'} )
76
- expect(pdfkit.options['--replace']).to eql ['value', 'something else']
75
+ pdfkit = PDFKit.new('html', :header_left => {'value' => 'something else'} )
76
+ expect(pdfkit.options['--header-left']).to eql ['value', 'something else']
77
77
  end
78
78
 
79
79
  it "flattens hash options into the key" do
@@ -84,8 +84,8 @@ describe PDFKit do
84
84
  end
85
85
 
86
86
  it "parses array option values into a string" do
87
- pdfkit = PDFKit.new('html', :replace => ['value', 'something else'] )
88
- expect(pdfkit.options['--replace']).to eql ['value', 'something else']
87
+ pdfkit = PDFKit.new('html', :header_left => ['value', 'something else'] )
88
+ expect(pdfkit.options['--header-left']).to eql ['value', 'something else']
89
89
  end
90
90
 
91
91
  it "flattens array options" do
@@ -181,6 +181,20 @@ describe PDFKit do
181
181
  expect(command).to contain %w[--replace foo bar]
182
182
  end
183
183
 
184
+ it "contains a specified by path argument" do
185
+ pdfkit = PDFKit.new('html')
186
+ command = pdfkit.command("/foo/bar")
187
+ expect(command.first).to match(/wkhtmltopdf/)
188
+ expect(command.last).to eq("/foo/bar")
189
+ end
190
+
191
+ it "contains a specified by path argument of Pathname" do
192
+ pdfkit = PDFKit.new('html')
193
+ command = pdfkit.command(Pathname.new("/foo/bar"))
194
+ expect(command.first).to match(/wkhtmltopdf/)
195
+ expect(command.last).to eq("/foo/bar")
196
+ end
197
+
184
198
  it "sets up one cookie when hash has only one cookie" do
185
199
  pdfkit = PDFKit.new('html', cookie: {cookie_name: :cookie_value})
186
200
  command = pdfkit.command
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.7.2
4
+ version: 0.8.7.3
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: 2022-10-18 00:00:00.000000000 Z
12
+ date: 2023-05-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport