wkhtmltopdf_runner 0.6.0 → 0.7.0
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 +4 -5
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +7 -3
- data/LICENSE +1 -1
- data/README.md +27 -1
- data/lib/wkhtmltopdf_runner/version.rb +1 -1
- data/wkhtmltopdf_runner.gemspec +1 -6
- metadata +5 -65
- data/Gemfile.lock +0 -77
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf085ac93408ba0b78ad24218f26f8692d35d33ef44bbee373b29d0435f96347
|
|
4
|
+
data.tar.gz: 6b3b0fa21234402bfb87a959d3a38ccf2fe4cd7c385c5f0581f68c0945f22715
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b3a2463b28aa054233f6805fb3f3aef2bb89585717b5c8d52411cacdec0e52c88f61da025e6881cc01cff1f220951a3bb80cdbe13d766e9a12bda1f7ababdff
|
|
7
|
+
data.tar.gz: 7b0dff5f9508d4d470f6dc6fc548a07314bfb25dcc56c045302b458f39d0409bea20568ee06e68a1d3ae53d06fe49c2f25aa824b641e6aad84e36adafaa07572
|
data/.github/workflows/test.yml
CHANGED
|
@@ -6,24 +6,23 @@ jobs:
|
|
|
6
6
|
test:
|
|
7
7
|
strategy:
|
|
8
8
|
matrix:
|
|
9
|
-
ruby: [2.
|
|
9
|
+
ruby: [2.7, '3.0', 3.1, 3.2, 3.3, 3.4]
|
|
10
10
|
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
14
|
- name: Checkout
|
|
15
|
-
uses: actions/checkout@
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
16
|
|
|
17
17
|
- name: Set up Ruby ${{ matrix.ruby }}
|
|
18
|
-
uses:
|
|
18
|
+
uses: ruby/setup-ruby@v1
|
|
19
19
|
with:
|
|
20
20
|
ruby-version: ${{ matrix.ruby }}
|
|
21
21
|
|
|
22
22
|
- name: Install libpng
|
|
23
|
-
run: sudo apt-get install libpng-dev
|
|
23
|
+
run: sudo apt-get install -y libpng-dev
|
|
24
24
|
|
|
25
25
|
- name: Test
|
|
26
26
|
run: |
|
|
27
|
-
gem install bundler
|
|
28
27
|
bundle install --jobs 4 --retry 3
|
|
29
28
|
bundle exec rspec
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
source 'https://rubygems.org'
|
|
4
4
|
|
|
5
5
|
group :development do
|
|
6
|
-
gem 'pry'
|
|
7
|
-
gem 'rubocop', require: false
|
|
8
|
-
gem 'rubocop-rspec', require: false
|
|
6
|
+
gem 'pry', '~> 0.15'
|
|
7
|
+
gem 'rubocop', '~> 1.71', require: false
|
|
8
|
+
gem 'rubocop-rspec', '~> 3.4', require: false
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
group :development, :test do
|
|
12
12
|
gem 'simplecov'
|
|
13
|
+
|
|
14
|
+
gem 'rake', '~> 13.2'
|
|
15
|
+
gem 'rspec', '~> 3.13'
|
|
16
|
+
gem 'wkhtmltopdf-binary', '~> 0.12.6'
|
|
13
17
|
end
|
|
14
18
|
|
|
15
19
|
# Specify your gem's dependencies in wkhtmltopdf_runner.gemspec
|
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -11,6 +11,7 @@ gem 'wkhtmltopdf_runner'
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
You also need to have installed `wkhtmltopdf`. Easy way to do that is to add binary files to your Gemfile.
|
|
14
|
+
|
|
14
15
|
```ruby
|
|
15
16
|
gem 'wkhtmltopdf-binary' # or 'wkhtmltopdf-binary-edge'
|
|
16
17
|
```
|
|
@@ -21,8 +22,11 @@ If you have custom path for `wkhtmltopdf` please see [Configuration](#configurat
|
|
|
21
22
|
|
|
22
23
|
### Write to File
|
|
23
24
|
|
|
24
|
-
Use block which has File argument that will be returned after PDF generation.
|
|
25
|
+
Use in a block which has File argument that will be returned after PDF generation as a TempFile.
|
|
26
|
+
|
|
27
|
+
#### ActiveStorage in Rails
|
|
25
28
|
|
|
29
|
+
These examples show how to attach a file to a user with [ActiveStorage::Attach](https://api.rubyonrails.org/classes/ActiveStorage/Attached/One.html).
|
|
26
30
|
You can render PDF from HTML string:
|
|
27
31
|
|
|
28
32
|
```rb
|
|
@@ -51,6 +55,28 @@ You can render PDF from URL:
|
|
|
51
55
|
end
|
|
52
56
|
```
|
|
53
57
|
|
|
58
|
+
### Sinatra
|
|
59
|
+
|
|
60
|
+
You can send the resultant file as a download.
|
|
61
|
+
|
|
62
|
+
```rb
|
|
63
|
+
WkhtmltopdfRunner.pdf_from_url('https://github.com') do |file|
|
|
64
|
+
send_file file, { filename: 'document.pdf' }
|
|
65
|
+
end
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Save to file
|
|
69
|
+
|
|
70
|
+
You can also just save it to a file.
|
|
71
|
+
|
|
72
|
+
```rb
|
|
73
|
+
WkhtmltopdfRunner.pdf_from_url('https://github.com') do |file|
|
|
74
|
+
doc = File.open('document.pdf', 'w')
|
|
75
|
+
doc.write(file.read)
|
|
76
|
+
doc.close
|
|
77
|
+
end
|
|
78
|
+
```
|
|
79
|
+
|
|
54
80
|
### Render to String
|
|
55
81
|
|
|
56
82
|
If you will not provide block, PDF string will be returned.
|
data/wkhtmltopdf_runner.gemspec
CHANGED
|
@@ -34,10 +34,5 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
spec.require_paths = ['lib']
|
|
35
35
|
|
|
36
36
|
spec.requirements << 'wkhtmltopdf'
|
|
37
|
-
spec.required_ruby_version = '>= 2.
|
|
38
|
-
|
|
39
|
-
spec.add_development_dependency 'bundler', '~> 2.2'
|
|
40
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
|
41
|
-
spec.add_development_dependency 'rspec', '~> 3.11'
|
|
42
|
-
spec.add_development_dependency 'wkhtmltopdf-binary-edge', '~> 0.12.6'
|
|
37
|
+
spec.required_ruby_version = '>= 2.7.0'
|
|
43
38
|
end
|
metadata
CHANGED
|
@@ -1,71 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wkhtmltopdf_runner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justas Palumickas
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: bundler
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.2'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '2.2'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '13.0'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '13.0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: rspec
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '3.11'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '3.11'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: wkhtmltopdf-binary-edge
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: 0.12.6
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: 0.12.6
|
|
10
|
+
date: 2025-02-05 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
69
12
|
description: This gem is a wrapper for a popular wkhtmltopdf library to generate PDF
|
|
70
13
|
files from HTML.
|
|
71
14
|
email:
|
|
@@ -80,7 +23,6 @@ files:
|
|
|
80
23
|
- ".rubocop.yml"
|
|
81
24
|
- CODE_OF_CONDUCT.md
|
|
82
25
|
- Gemfile
|
|
83
|
-
- Gemfile.lock
|
|
84
26
|
- LICENSE
|
|
85
27
|
- README.md
|
|
86
28
|
- Rakefile
|
|
@@ -106,7 +48,6 @@ metadata:
|
|
|
106
48
|
changelog_uri: https://github.com/jpalumickas/wkhtmltopdf_runner/releases
|
|
107
49
|
bug_tracker_uri: https://github.com/jpalumickas/wkhtmltopdf_runner/issues
|
|
108
50
|
rubygems_mfa_required: 'true'
|
|
109
|
-
post_install_message:
|
|
110
51
|
rdoc_options: []
|
|
111
52
|
require_paths:
|
|
112
53
|
- lib
|
|
@@ -114,7 +55,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
114
55
|
requirements:
|
|
115
56
|
- - ">="
|
|
116
57
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 2.
|
|
58
|
+
version: 2.7.0
|
|
118
59
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
60
|
requirements:
|
|
120
61
|
- - ">="
|
|
@@ -122,8 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
122
63
|
version: '0'
|
|
123
64
|
requirements:
|
|
124
65
|
- wkhtmltopdf
|
|
125
|
-
rubygems_version: 3.
|
|
126
|
-
signing_key:
|
|
66
|
+
rubygems_version: 3.6.3
|
|
127
67
|
specification_version: 4
|
|
128
68
|
summary: Wrapper for wkhtmltopdf to generate PDF from HTML.
|
|
129
69
|
test_files: []
|
data/Gemfile.lock
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
wkhtmltopdf_runner (0.6.0)
|
|
5
|
-
|
|
6
|
-
GEM
|
|
7
|
-
remote: https://rubygems.org/
|
|
8
|
-
specs:
|
|
9
|
-
ast (2.4.2)
|
|
10
|
-
coderay (1.1.3)
|
|
11
|
-
diff-lcs (1.5.0)
|
|
12
|
-
docile (1.4.0)
|
|
13
|
-
json (2.6.2)
|
|
14
|
-
method_source (1.0.0)
|
|
15
|
-
parallel (1.22.1)
|
|
16
|
-
parser (3.1.2.1)
|
|
17
|
-
ast (~> 2.4.1)
|
|
18
|
-
pry (0.14.1)
|
|
19
|
-
coderay (~> 1.1)
|
|
20
|
-
method_source (~> 1.0)
|
|
21
|
-
rainbow (3.1.1)
|
|
22
|
-
rake (13.0.6)
|
|
23
|
-
regexp_parser (2.6.0)
|
|
24
|
-
rexml (3.2.5)
|
|
25
|
-
rspec (3.11.0)
|
|
26
|
-
rspec-core (~> 3.11.0)
|
|
27
|
-
rspec-expectations (~> 3.11.0)
|
|
28
|
-
rspec-mocks (~> 3.11.0)
|
|
29
|
-
rspec-core (3.11.0)
|
|
30
|
-
rspec-support (~> 3.11.0)
|
|
31
|
-
rspec-expectations (3.11.1)
|
|
32
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
33
|
-
rspec-support (~> 3.11.0)
|
|
34
|
-
rspec-mocks (3.11.2)
|
|
35
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
36
|
-
rspec-support (~> 3.11.0)
|
|
37
|
-
rspec-support (3.11.1)
|
|
38
|
-
rubocop (1.37.1)
|
|
39
|
-
json (~> 2.3)
|
|
40
|
-
parallel (~> 1.10)
|
|
41
|
-
parser (>= 3.1.2.1)
|
|
42
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
43
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
44
|
-
rexml (>= 3.2.5, < 4.0)
|
|
45
|
-
rubocop-ast (>= 1.23.0, < 2.0)
|
|
46
|
-
ruby-progressbar (~> 1.7)
|
|
47
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
|
48
|
-
rubocop-ast (1.23.0)
|
|
49
|
-
parser (>= 3.1.1.0)
|
|
50
|
-
rubocop-rspec (2.14.1)
|
|
51
|
-
rubocop (~> 1.33)
|
|
52
|
-
ruby-progressbar (1.11.0)
|
|
53
|
-
simplecov (0.21.2)
|
|
54
|
-
docile (~> 1.1)
|
|
55
|
-
simplecov-html (~> 0.11)
|
|
56
|
-
simplecov_json_formatter (~> 0.1)
|
|
57
|
-
simplecov-html (0.12.3)
|
|
58
|
-
simplecov_json_formatter (0.1.4)
|
|
59
|
-
unicode-display_width (2.3.0)
|
|
60
|
-
wkhtmltopdf-binary-edge (0.12.6.0)
|
|
61
|
-
|
|
62
|
-
PLATFORMS
|
|
63
|
-
ruby
|
|
64
|
-
|
|
65
|
-
DEPENDENCIES
|
|
66
|
-
bundler (~> 2.2)
|
|
67
|
-
pry
|
|
68
|
-
rake (~> 13.0)
|
|
69
|
-
rspec (~> 3.11)
|
|
70
|
-
rubocop
|
|
71
|
-
rubocop-rspec
|
|
72
|
-
simplecov
|
|
73
|
-
wkhtmltopdf-binary-edge (~> 0.12.6)
|
|
74
|
-
wkhtmltopdf_runner!
|
|
75
|
-
|
|
76
|
-
BUNDLED WITH
|
|
77
|
-
2.2.32
|