pdfkit 0.8.7.2 → 0.8.7.3
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 +4 -4
- data/.github/workflows/test.yml +12 -0
- data/CHANGELOG.md +6 -0
- data/lib/pdfkit/pdfkit.rb +1 -1
- data/lib/pdfkit/version.rb +1 -1
- data/lib/pdfkit/wkhtmltopdf.rb +3 -3
- data/spec/pdfkit_spec.rb +20 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5a276883efaa6bba1349d1077bee9ed23e466e48006d7b87a8e6c6ffbbd83bb
|
4
|
+
data.tar.gz: 33632dc0ae3a917efe7a4d227ea3f1ef52a2901f125b5102f687d8058c32a135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8694cd8411e17b0a960a5a931f84960031a935bfdb2f6fc43b6b460c8434644694e0b8dd764fb151cb722b947c9775c9540bd2b5935a0bbb5021705bbe7f8b52
|
7
|
+
data.tar.gz: 55fdc04026f173baa10fc1f349323b243f6ef9d17142a9ab196cdc4302c2444e7a72dcf1ba68c31c3a953ab1559add63c257a1c5c1012e9a3216765ae386457e
|
data/.github/workflows/test.yml
CHANGED
@@ -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
data/lib/pdfkit/version.rb
CHANGED
data/lib/pdfkit/wkhtmltopdf.rb
CHANGED
@@ -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/
|
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', :
|
49
|
-
expect(pdfkit.options).to have_key('--
|
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', :
|
76
|
-
expect(pdfkit.options['--
|
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', :
|
88
|
-
expect(pdfkit.options['--
|
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.
|
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:
|
12
|
+
date: 2023-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|