wicked_pdf 1.1.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +5 -5
  2. data/.github/issue_template.md +15 -0
  3. data/.github/workflows/ci.yml +56 -0
  4. data/.rubocop.yml +62 -0
  5. data/.rubocop_todo.yml +81 -39
  6. data/CHANGELOG.md +194 -45
  7. data/README.md +136 -28
  8. data/Rakefile +12 -9
  9. data/gemfiles/5.0.gemfile +3 -1
  10. data/gemfiles/5.1.gemfile +8 -0
  11. data/gemfiles/5.2.gemfile +9 -0
  12. data/gemfiles/6.0.gemfile +10 -0
  13. data/gemfiles/6.1.gemfile +11 -0
  14. data/gemfiles/7.0.gemfile +11 -0
  15. data/generators/wicked_pdf/templates/wicked_pdf.rb +14 -5
  16. data/lib/generators/wicked_pdf_generator.rb +5 -9
  17. data/lib/wicked_pdf/binary.rb +65 -0
  18. data/lib/wicked_pdf/middleware.rb +1 -1
  19. data/lib/wicked_pdf/option_parser.rb +230 -0
  20. data/lib/wicked_pdf/pdf_helper.rb +35 -42
  21. data/lib/wicked_pdf/progress.rb +33 -0
  22. data/lib/wicked_pdf/railtie.rb +6 -44
  23. data/lib/wicked_pdf/tempfile.rb +33 -3
  24. data/lib/wicked_pdf/version.rb +1 -1
  25. data/lib/wicked_pdf/wicked_pdf_helper/assets.rb +200 -17
  26. data/lib/wicked_pdf/wicked_pdf_helper.rb +2 -1
  27. data/lib/wicked_pdf.rb +64 -275
  28. data/test/fixtures/database.yml +4 -0
  29. data/test/fixtures/manifest.js +3 -0
  30. data/test/functional/pdf_helper_test.rb +71 -0
  31. data/test/functional/wicked_pdf_helper_assets_test.rb +61 -0
  32. data/test/test_helper.rb +13 -8
  33. data/test/unit/wicked_pdf_binary_test.rb +26 -0
  34. data/test/unit/wicked_pdf_option_parser_test.rb +133 -0
  35. data/test/unit/wicked_pdf_test.rb +25 -146
  36. data/test/unit/wkhtmltopdf_location_test.rb +48 -0
  37. data/wicked_pdf.gemspec +20 -13
  38. metadata +79 -36
  39. data/.travis.yml +0 -57
  40. data/gemfiles/2.3.gemfile +0 -10
  41. data/gemfiles/3.0.gemfile +0 -12
  42. data/gemfiles/3.1.gemfile +0 -13
  43. data/gemfiles/3.2.gemfile +0 -12
  44. data/gemfiles/4.0.gemfile +0 -6
  45. data/gemfiles/4.1.gemfile +0 -6
  46. data/gemfiles/4.2.gemfile +0 -6
  47. data/gemfiles/rails_edge.gemfile +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9c29352b7951b2cb5013de56cc41c3929362a248
4
- data.tar.gz: 7fe7fa7843fc6b9ac7bfe6ec98cf0676c274fef8
2
+ SHA256:
3
+ metadata.gz: ad0741c1e5c8b253601a248d448f53fe359547238517a6340c7ac340f4bf2e15
4
+ data.tar.gz: 1da781d4aa577dd9afb1e90c734c1507d4458d85d7a381dc0f005582dcd064a5
5
5
  SHA512:
6
- metadata.gz: 8d83f67d5a93d3579f81786d2aeaca8b8f0332afa48f3cee3274614ef051f6edff25a8486bcd2965ec5b1e6996c6dbf700ab71d678d3bf83f6ec2a391811c1d8
7
- data.tar.gz: 41c7b3744daa9bcd60f4bd68f2c13173d44496be0dc7668b42de651e91c9eaa0ad68d826583c1475cd88e587f6eb3efcc4a376b8ca9e6e31554efec5812390c9
6
+ metadata.gz: dd1a3651d3ad14d2c0c8515e81f9cc75bbe617633e956127f77e6d287a761402f5b8d1448641772bf7e69cb16fefd5b38547da9628df43fdb0e6623b11527e9d
7
+ data.tar.gz: f4d1cd6cd91e60f4874e4ad269056a5af32da101e0e03a54231d701958d304f14beacfa9b262559fb56c5375b6899046c8a23090afde226721613d4e0db4f118
@@ -0,0 +1,15 @@
1
+ ## Issue description
2
+
3
+ ## Expected or desired behavior
4
+
5
+ ## System specifications
6
+
7
+ wicked_pdf gem version (output of `cat Gemfile.lock | grep wicked_pdf`):
8
+
9
+ wkhtmltopdf version (output of `wkhtmltopdf --version`):
10
+
11
+ whtmltopdf [provider gem](https://rubygems.org/search?utf8=%E2%9C%93&query=wkhtmltopdf) and version if one is used:
12
+
13
+ platform/distribution and version (e.g. Windows 10 / Ubuntu 16.04 / Heroku cedar):
14
+
15
+
@@ -0,0 +1,56 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request, workflow_dispatch]
4
+
5
+ jobs:
6
+ tests:
7
+ name: Tests with Ruby ${{ matrix.ruby-version }} and Rails ${{ matrix.gemfile }}
8
+ runs-on: ubuntu-latest
9
+ strategy:
10
+ matrix:
11
+ gemfile: ["5.0"]
12
+ ruby-version: [2.6]
13
+ include:
14
+ - gemfile: "5.0"
15
+ ruby-version: 2.7
16
+ - gemfile: "5.1"
17
+ ruby-version: 2.6
18
+ - gemfile: "5.1"
19
+ ruby-version: 2.7
20
+ - gemfile: "5.2"
21
+ ruby-version: 2.6
22
+ - gemfile: "5.2"
23
+ ruby-version: 2.7
24
+ - gemfile: "6.0"
25
+ ruby-version: 2.6
26
+ - gemfile: "6.0"
27
+ ruby-version: 2.7
28
+ - gemfile: "6.1"
29
+ ruby-version: 2.7
30
+ - gemfile: "6.1"
31
+ ruby-version: '3.0'
32
+ - gemfile: "7.0"
33
+ ruby-version: 3.1
34
+ - gemfile: "7.0"
35
+ ruby-version: 3.2
36
+
37
+ env:
38
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
39
+ WKHTMLTOPDF_BIN: /usr/bin/wkhtmltopdf
40
+
41
+ steps:
42
+ - uses: actions/checkout@v3
43
+
44
+ - name: Install OS dependencies
45
+ run: |
46
+ sudo apt-get update -y -qq
47
+ sudo apt-get install -y wkhtmltopdf
48
+
49
+ - name: Install Ruby ${{ matrix.ruby-version }}
50
+ uses: ruby/setup-ruby@v1
51
+ with:
52
+ ruby-version: ${{ matrix.ruby-version }}
53
+ bundler-cache: true
54
+
55
+ - name: Run tests with Ruby ${{ matrix.ruby-version }} and Rails ${{ matrix.gemfile }}
56
+ run: bundle exec rake
data/.rubocop.yml CHANGED
@@ -1,8 +1,70 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
+ NewCops: disable
5
+ SuggestExtensions: false
6
+ TargetRubyVersion: 2.6
4
7
  Exclude:
8
+ - 'gemfiles/bin/*'
5
9
  - 'test/dummy/**/*'
10
+ - 'vendor/**/*'
11
+
12
+ Metrics/PerceivedComplexity:
13
+ Enabled: false
14
+
15
+ Gemspec/RequiredRubyVersion:
16
+ Enabled: false
17
+
18
+ Bundler/OrderedGems:
19
+ Enabled: false
20
+
21
+ Style/FrozenStringLiteralComment:
22
+ Enabled: false
23
+
24
+ Style/RedundantBegin:
25
+ Enabled: false
26
+
27
+ Style/NumericPredicate:
28
+ Enabled: false
29
+
30
+ Style/RedundantRegexpEscape:
31
+ Enabled: false
32
+
33
+ Style/SafeNavigation:
34
+ Enabled: false
35
+
36
+ Lint/SendWithMixinArgument:
37
+ Enabled: false
38
+
39
+ Lint/RedundantCopDisableDirective:
40
+ Enabled: false
41
+
42
+ Metrics/AbcSize:
43
+ Enabled: false
44
+
45
+ Style/StringConcatenation:
46
+ Enabled: false
47
+
48
+ Style/RedundantFetchBlock:
49
+ Enabled: false
50
+
51
+ Style/CaseLikeIf:
52
+ Enabled: false
53
+
54
+ Style/SoleNestedConditional:
55
+ Enabled: false
56
+
57
+ Style/RedundantReturn:
58
+ Enabled: false
59
+
60
+ Metrics/BlockLength:
61
+ Exclude:
62
+ - 'wicked_pdf.gemspec'
63
+
64
+ Metrics/ModuleLength:
65
+ Exclude:
66
+ # Excluding to keep the logic in one module for the time being.
67
+ - 'lib/wicked_pdf/wicked_pdf_helper/assets.rb'
6
68
 
7
69
  # I'd like wicked_pdf to keep Ruby 1.8 compatibility for now
8
70
  Style/HashSyntax:
data/.rubocop_todo.yml CHANGED
@@ -1,63 +1,105 @@
1
- # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-11-08 18:41:57 -0500 using RuboCop version 0.32.1.
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2023-01-24 11:24:49 UTC using RuboCop version 1.44.0.
3
4
  # The point is for the user to remove these configuration records
4
5
  # one by one as the offenses are removed from the code base.
5
6
  # Note that changes in the inspected code, or installation of new
6
7
  # versions of RuboCop, may require this file to be generated again.
7
8
 
8
-
9
- # Offense count: 9
10
- Metrics/AbcSize:
11
- Max: 45
12
-
13
- # Offense count: 2
14
- Metrics/BlockNesting:
15
- Max: 4
16
-
17
9
  # Offense count: 2
18
- # Configuration parameters: CountComments.
10
+ # Configuration parameters: CountComments, CountAsOne.
19
11
  Metrics/ClassLength:
20
- Max: 300
21
-
22
- Metrics/ModuleLength:
23
- Max: 120
12
+ Max: 203
24
13
 
25
- # Offense count: 5
14
+ # Offense count: 7
15
+ # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
26
16
  Metrics/CyclomaticComplexity:
27
- Max: 9
28
-
29
- # Offense count: 92
30
- # Configuration parameters: AllowURI, URISchemes.
31
- Metrics/LineLength:
32
- Max: 563
17
+ Max: 13
33
18
 
34
- # Offense count: 14
35
- # Configuration parameters: CountComments.
19
+ # Offense count: 17
20
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
36
21
  Metrics/MethodLength:
37
- Max: 30
22
+ Max: 34
38
23
 
39
- # Offense count: 4
40
- Metrics/PerceivedComplexity:
41
- Max: 12
24
+ # Offense count: 1
25
+ # Configuration parameters: CountComments, CountAsOne.
26
+ Metrics/ModuleLength:
27
+ Max: 104
42
28
 
43
- # Offense count: 2
44
- Style/AccessorMethodName:
45
- Enabled: false
29
+ # Offense count: 1
30
+ Naming/AccessorMethodName:
31
+ Exclude:
32
+ - 'lib/wicked_pdf/middleware.rb'
46
33
 
47
34
  # Offense count: 1
35
+ # This cop supports safe autocorrection (--autocorrect).
36
+ # Configuration parameters: AllowOnConstant, AllowOnSelfClass.
48
37
  Style/CaseEquality:
49
- Enabled: false
38
+ Exclude:
39
+ - 'lib/wicked_pdf/wicked_pdf_helper.rb'
50
40
 
51
41
  # Offense count: 1
52
42
  Style/ClassVars:
53
- Enabled: false
43
+ Exclude:
44
+ - 'lib/wicked_pdf.rb'
54
45
 
55
- # Offense count: 15
46
+ # Offense count: 13
47
+ # Configuration parameters: AllowedConstants.
56
48
  Style/Documentation:
57
- Enabled: false
49
+ Exclude:
50
+ - 'spec/**/*'
51
+ - 'test/**/*'
52
+ - 'generators/wicked_pdf/wicked_pdf_generator.rb'
53
+ - 'lib/wicked_pdf.rb'
54
+ - 'lib/wicked_pdf/binary.rb'
55
+ - 'lib/wicked_pdf/middleware.rb'
56
+ - 'lib/wicked_pdf/option_parser.rb'
57
+ - 'lib/wicked_pdf/pdf_helper.rb'
58
+ - 'lib/wicked_pdf/progress.rb'
59
+ - 'lib/wicked_pdf/railtie.rb'
60
+ - 'lib/wicked_pdf/tempfile.rb'
61
+ - 'lib/wicked_pdf/wicked_pdf_helper.rb'
62
+ - 'lib/wicked_pdf/wicked_pdf_helper/assets.rb'
63
+
64
+ # Offense count: 2
65
+ # This cop supports safe autocorrection (--autocorrect).
66
+ Style/ExpandPathArguments:
67
+ Exclude:
68
+ - 'test/test_helper.rb'
69
+ - 'wicked_pdf.gemspec'
70
+
71
+ # Offense count: 4
72
+ # This cop supports safe autocorrection (--autocorrect).
73
+ # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
74
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
75
+ # SupportedShorthandSyntax: always, never, either, consistent
76
+ Style/HashSyntax:
77
+ Exclude:
78
+ - 'gemfiles/5.0.gemfile'
79
+ - 'gemfiles/5.1.gemfile'
80
+ - 'gemfiles/5.2.gemfile'
81
+ - 'gemfiles/6.0.gemfile'
82
+
83
+ # Offense count: 2
84
+ # This cop supports unsafe autocorrection (--autocorrect-all).
85
+ # Configuration parameters: EnforcedStyle.
86
+ # SupportedStyles: literals, strict
87
+ Style/MutableConstant:
88
+ Exclude:
89
+ - 'lib/wicked_pdf/wicked_pdf_helper/assets.rb'
58
90
 
59
91
  # Offense count: 5
60
- # Cop supports --auto-correct.
61
- # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
92
+ # This cop supports safe autocorrection (--autocorrect).
93
+ # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
94
+ # SupportedStyles: slashes, percent_r, mixed
62
95
  Style/RegexpLiteral:
63
- Enabled: false
96
+ Exclude:
97
+ - 'lib/wicked_pdf/middleware.rb'
98
+ - 'lib/wicked_pdf/wicked_pdf_helper/assets.rb'
99
+
100
+ # Offense count: 18
101
+ # This cop supports safe autocorrection (--autocorrect).
102
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
103
+ # URISchemes: http, https
104
+ Layout/LineLength:
105
+ Max: 563
data/CHANGELOG.md CHANGED
@@ -1,73 +1,236 @@
1
1
  # Change Log
2
- All notable changes to this project will be documented in this file.
3
- This project adheres to [Semantic Versioning](http://semver.org/).
4
-
5
- ## [1.1.0] - 2016-09-30
6
- ### Added
2
+ All notable changes to this project should be documented in this file.
3
+ This project attempts to adhere to [Semantic Versioning](http://semver.org/).
4
+
5
+ ## [[master branch] - Unreleased changes](https://github.com/mileszs/wicked_pdf/compare/2.8.0...HEAD)
6
+ ### Breaking Changes
7
+ ### New Features
8
+ ### Fixes
9
+
10
+ ## [2.8.0]
11
+ ### New Features
12
+ - [Add New config option `raise_on_missing_assets`](https://github.com/mileszs/wicked_pdf/pull/1094)
13
+ - [Add support for truffleruby (22.1.0) on Linux](https://github.com/mileszs/wicked_pdf/pull/1028)
14
+
15
+ ### Fixes
16
+ - [Fix Propshaft encoding issue](https://github.com/mileszs/wicked_pdf/pull/1096)
17
+ - [Fix Webpacker & Shakapacker compatibility issue](https://github.com/mileszs/wicked_pdf/pull/1099)
18
+
19
+ ## [2.7.0]
20
+ ### New Features
21
+ - [Support Shakapacker 7](https://github.com/mileszs/wicked_pdf/pull/1067)
22
+ - [Add option `delete_temporary_files` to keep the temporary files generated by `pdf_from_string` method](https://github.com/mileszs/wicked_pdf/pull/1068)
23
+ - [Add support for --allow flag](https://github.com/mileszs/wicked_pdf/pull/1030)
24
+
25
+ ## Fixes
26
+ - [Add require for `stringio`, which is no longer loaded by default in Ruby 3.1+](https://github.com/mileszs/wicked_pdf/pull/1062)
27
+ - [Fix CI build.](https://github.com/mileszs/wicked_pdf/pull/1055)
28
+ - [Fix Header/footer temporary file is removed before `wkhtmltopdf` is called](https://github.com/mileszs/wicked_pdf/pull/1039)
29
+ - [Bump rubocop to 1.46](https://github.com/mileszs/wicked_pdf/pull/1051)
30
+ - [Add Ruby 3.2 to the test matrix](https://github.com/mileszs/wicked_pdf/pull/1046)
31
+
32
+ ## [2.6.3]
33
+ ### Fixes
34
+ - [Fix typo of #possible_binary_locations](https://github.com/mileszs/wicked_pdf/pull/1025)
35
+ - [Drop unused executables gemspec directive](https://github.com/mileszs/wicked_pdf/pull/1024)
36
+
37
+ ## [2.6.2]
38
+ ### Fixes
39
+ - [Fix undefined local variable or method 'block' for render_to_string](https://github.com/mileszs/wicked_pdf/pull/962)
40
+ - [Add require for `delegate`, which is no longer loaded by default in Ruby 2.7+](https://github.com/mileszs/wicked_pdf/pull/1019)
41
+ ## [2.6.0]
42
+ ### New Features
43
+ - [Support Propshaft in find_asset helper](https://github.com/mileszs/wicked_pdf/pull/1010)
44
+ ### Fixes
45
+ - [Update Changelog with changes from 2.1.0](https://github.com/mileszs/wicked_pdf/pull/1013)
46
+ - [Fix CI build for Rails 7.](https://github.com/mileszs/wicked_pdf/pull/1014)
47
+
48
+ ## [2.5.4] December 20th 2021 769f9df487f3c1e31dc91431666baa78d2aa24fb
49
+ ### New Features
50
+ - [Test with Rails 7](https://github.com/mileszs/wicked_pdf/pull/998)
51
+ ### Fixes
52
+ - [Include view helper on view load.](https://github.com/mileszs/wicked_pdf/pull/992)
53
+
54
+ ## [2.5.3] December 15th 2021 7991877de634067b4245fb47fdad65da43761887
55
+ - [Fix check for webpacker version](https://github.com/mileszs/wicked_pdf/pull/964)
56
+ - [Complete transition to Github actions](https://github.com/mileszs/wicked_pdf/pull/987)
57
+
58
+ ## [2.5.2] November 2021 - fix webpacker_source_url bdd0ca3eca759e277ce5461141b1506f56fefcd1
59
+ - [fix: `webpacker_source_url`](https://github.com/mileszs/wicked_pdf/pull/993)
60
+ - [update README](https://github.com/mileszs/wicked_pdf/pull/968)
61
+
62
+ ## [2.5.1] September 2021 - fix webpacker helper, github actions and Readme updates ae725e8055dc8f51a392c27767b4dcdcfffe155d
63
+ - [Add comment about enable_local_file_access to README](https://github.com/mileszs/wicked_pdf/commit/2dc96dde2e0fd7362395064f2480cac1edcc1f48)
64
+ - [README updates](https://github.com/mileszs/wicked_pdf/pull/974) &&
65
+ - [Github actions](https://github.com/mileszs/wicked_pdf/pull/986)
66
+ - [Screencast links](https://github.com/mileszs/wicked_pdf/pull/976)
67
+ - [fix url generating in webpacker helper](https://github.com/mileszs/wicked_pdf/pull/973)
68
+
69
+ ## [2.5.0] November 2020 Release - 2b1d47a84fce3600e7cbe2f50843af1a7b84d4a6
70
+ - [Remove code for unsupported rails and ruby versions](https://github.com/mileszs/wicked_pdf/pull/925)
71
+
72
+ ## [2.4.1] b56c46a05895def395ebc75ed8e822551c2c478f
73
+ - [Extract reading in chunk](https://github.com/mileszs/wicked_pdf/pull/951)
74
+ - [add ruby 2.7 to the test matrix](https://github.com/mileszs/wicked_pdf/pull/952)
75
+
76
+ ## [2.4.0] 8c007a77057e1a6680469d1ef53aa19a108fe209
77
+ ### New Features
78
+ - [Do not unlink HTML temp files immediately (to enable HTML tempfile inspection)](https://github.com/mileszs/wicked_pdf/pull/950)
79
+ - [Read HTML string and generated PDF file in chunks (to reduce memory overhead of generating large PDFs)](https://github.com/mileszs/wicked_pdf/pull/949)
80
+ - [Add `wicked_pdf_url_base64` helper](https://github.com/mileszs/wicked_pdf/pull/947)
81
+
82
+ ## [2.3.1] - Allow bundler 2.x ee6a5e1f807c872af37c1382f629dd4cac3040a8
83
+ - [Adjust gemspec development dependencies](https://github.com/mileszs/wicked_pdf/pull/814)
84
+
85
+ ## [2.3.0] - Remove support for Ruby 1.x and Rails 2.x 66149c67e54cd3a63dd27528f5b78255fdd5ac43
86
+ - [Remove support for Ruby 1.x and Rails 2.x](https://github.com/mileszs/wicked_pdf/pull/859)
87
+
88
+ ## [2.2.0] - October 2020 release f8abe706f5eb6dba2fcded473c81f2176e9d717e
89
+ ### Fixes
90
+ - [Make CI green again](https://github.com/mileszs/wicked_pdf/pull/939)
91
+ - [rubocop fixes](https://github.com/mileszs/wicked_pdf/pull/945)
92
+ ### New Features
93
+ - [Add support for --keep-relative-links flag](https://github.com/mileszs/wicked_pdf/pull/930)
94
+ - [Encapsulate binary path and version handling](https://github.com/mileszs/wicked_pdf/pull/816) && [#815](https://github.com/mileszs/wicked_pdf/pull/815)
95
+
96
+
97
+ ## [2.1.0] - 2020-06-14
98
+ ### Fixes
99
+ - [Document no_stop_slow_scripts in README](https://github.com/mileszs/wicked_pdf/pull/905)
100
+ - [Document how to use locals in README](https://github.com/mileszs/wicked_pdf/pull/915)
101
+
102
+ ### New Features
103
+ - [Improved support for Webpacker assets with `wicked_pdf_asset_pack_path`](https://github.com/mileszs/wicked_pdf/pull/896)
104
+ - [Support enabling/disabling local file access compatible with wkhtmltopdf 0.12.6](https://github.com/mileszs/wicked_pdf/pull/920)
105
+ - [Add option `use_xvfb` to emulate an X server](https://github.com/mileszs/wicked_pdf/pull/909)
106
+
107
+ ## [2.0.2] - 2020-03-17
108
+ ### Fixes
109
+ - [Force UTF-8 encoding in assets helper](https://github.com/mileszs/wicked_pdf/pull/894)
110
+
111
+ ## [2.0.1] - 2020-02-22
112
+ ### Fixes
113
+ - [Replace open-uri with more secure Net:HTTP.get](https://github.com/mileszs/wicked_pdf/pull/864)
114
+
115
+ ## [2.0.0] - 2020-02-22
116
+ ### Breaking changes
117
+ - [Remove support for older Ruby and Rails versions](https://github.com/mileszs/wicked_pdf/pull/854) - This project no longer supports Ruby < 2.2 and Rails < 4. It may work for you, but we are no longer worrying about breaking backwards compatibility for versions older than these. If you are on an affected version, you can continue to use the 1.x releases. Patches to fix broken behavior on old versions may not be accepted unless they are highly decoupled from the rest of the code base.
118
+
119
+ ### New Features
120
+ - [Add Rubygems metadata hash to gemspec](https://github.com/mileszs/wicked_pdf/pull/856)
121
+ - [Add support for Rails 6](https://github.com/mileszs/wicked_pdf/pull/869)
122
+
123
+ ### Fixes
124
+ - [Fix Webpacker helpers in production environment](https://github.com/mileszs/wicked_pdf/pull/837)
125
+ - [Fix unit tests](https://github.com/mileszs/wicked_pdf/pull/852)
126
+
127
+ ## [1.4.0] - 2019-05-23
128
+ ### New Features
129
+ - [Add support for `log_level` and `quiet` options](https://github.com/mileszs/wicked_pdf/pull/834)
130
+
131
+ ## [1.3.0] - 2019-05-20
132
+ ### New Features
133
+ - [Add support for Webpacker provided bundles](https://github.com/mileszs/wicked_pdf/pull/739)
134
+
135
+ ## [1.2.2] - 2019-04-13
136
+ ### Fixes
137
+ - [Fix issue loading Pty on Windows](https://github.com/mileszs/wicked_pdf/pull/820)
138
+ - [Fix conflict with remotipart causing SystemStackError](https://github.com/mileszs/wicked_pdf/pull/821)
139
+
140
+ ## [1.2.1] - 2019-03-16
141
+ ### Fixes
142
+ - [Fix `SystemStackError` in some setups](https://github.com/mileszs/wicked_pdf/pull/813)
143
+
144
+ ## [1.2.0] - 2019-03-16
145
+ ### New Features
146
+ - [Add `raise_on_all_errors: true` option to raise on any error that prints to STDOUT during PDF generation](https://github.com/mileszs/wicked_pdf/pull/751)
147
+ - [Add ability to use the `assigns` option to `render` to assign instance variables to a PDF template](https://github.com/mileszs/wicked_pdf/pull/801)
148
+ - [Add ability to track console progress](https://github.com/mileszs/wicked_pdf/pull/804) with `progress: -> (output) { puts output }`. This is useful to add reporting hooks to show your frontend what page number is being generated.
149
+
150
+ ### Fixes
151
+ - [Fix conflict with other gems that hook into `render`](https://github.com/mileszs/wicked_pdf/pull/574) and avoid using `alias_method_chain` where possible
152
+ - [Fix issue using the shell to locate `wkhtmltopdf` in a Bundler environment](https://github.com/mileszs/wicked_pdf/pull/728)
153
+ - [Fix `wkhtmltopdf` path detection when HOME environment variable is unset](https://github.com/mileszs/wicked_pdf/pull/568)
154
+ - [Fix error when the `Rails` constant is defined but not actually using Rails](https://github.com/mileszs/wicked_pdf/pull/613)
155
+ - [Fix compatibility issue with Sprockets 4](https://github.com/mileszs/wicked_pdf/pull/615)
156
+ - [Fix compatibility issue with `Mime::JS` in Rails 5.1+](https://github.com/mileszs/wicked_pdf/pull/627)
157
+ - [Fix deprecation warning by using `after_action` instead of `after_filter` when available](https://github.com/mileszs/wicked_pdf/pull/663)
158
+ - [Provide Rails `base_path` to `find_asset` calls for Sprockets file lookup](https://github.com/mileszs/wicked_pdf/pull/688)
159
+ - Logger changes:
160
+ - [Use `Rails.logger.debug` instead of `p`](https://github.com/mileszs/wicked_pdf/pull/575)
161
+ - [Change logger message to prepend `[wicked_pdf]` instead of nonstandard `****************WICKED****************`](https://github.com/mileszs/wicked_pdf/pull/589)
162
+ - Documentation changes:
163
+ - [Update link to wkhtmltopdf homepage](https://github.com/mileszs/wicked_pdf/pull/582)
164
+ - [Update link to `wkhtmltopdf_binary_gem`](https://github.com/mileszs/wicked_pdf/commit/59e6c5fca3985f2fa2f345089596250df5da2682)
165
+ - [Update documentation for usage with the Asset Pipeline](https://github.com/mileszs/wicked_pdf/commit/690d00157706699a71b7dcd71834759f4d84702f)
166
+ - [Document `default_protocol` option](https://github.com/mileszs/wicked_pdf/pull/585)
167
+ - [Document `image` and `no_image` options](https://github.com/mileszs/wicked_pdf/pull/689)
168
+ - [Document issue with DPI/scaling on various platforms](https://github.com/mileszs/wicked_pdf/pull/715)
169
+ - [Document creating and attaching a PDF in a mailer](https://github.com/mileszs/wicked_pdf/pull/746)
170
+ - [Document dependency on `wkhtmltopdf` with RubyGems](https://github.com/mileszs/wicked_pdf/pull/656)
171
+ - [Add example using WickedPDF with Rails in an API-only configuration](https://github.com/mileszs/wicked_pdf/pull/796)
172
+ - [Add example for rending a template as a header/footer](https://github.com/mileszs/wicked_pdf/pull/603)
173
+ - [Add GitHub issue template](https://github.com/mileszs/wicked_pdf/pull/805)
174
+ - [Add CodeClimate Badge](https://github.com/mileszs/wicked_pdf/pull/646)
175
+ - RuboCop cleanup
176
+ - Updates to Travis CI pipeline to support newer versions of Ruby & Rails
177
+
178
+ ## [1.1.0] - 2016-08-30
179
+ ### New Features
7
180
  - Support Rails 5.x and Sprockets 3.x
8
181
  - Support `window_status: 'somestring'` option, to instruct wkhtmltopdf to wait until the browser `window.status` is equal to the supplied string. This can be useful to force rendering to wait [as explained quite well here](https://spin.atomicobject.com/2015/08/29/ember-app-done-loading/)
9
182
  - Support `no_stop_slow_scripts: true` to let slow running scripts delay rendering
183
+ - [Changes to asset finding to support Rails 5](https://github.com/mileszs/wicked_pdf/pull/561)
10
184
 
11
- ### Changed
185
+ ### Fixes
12
186
  - [Improved error handling](https://github.com/mileszs/wicked_pdf/pull/543)
13
187
  - [Namespace helper classes under WickedPdf namespace](https://github.com/mileszs/wicked_pdf/pull/538)
14
- - [Changes to asset finding to support Rails 5](https://github.com/mileszs/wicked_pdf/pull/561)
15
188
 
16
189
  ## [1.0.6] - 2016-04-04
17
- ### Changed
18
- - Revert shellescaping of options. The fix was causing more issues than it solved (like "[page] of [topage]" being escaped, and thus not parsed by `wkhtmltopdf`). See #514 for details.
190
+ ### Fixes
191
+ - Revert shell escaping of options. The fix was causing more issues than it solved (like "[page] of [topage]" being escaped, and thus not parsed by `wkhtmltopdf`). See #514 for details.
19
192
 
20
193
  ## [1.0.5] - 2016-03-28
21
- ### Changed
194
+ ### Fixes
22
195
  - Numerous RuboCop style violation fixes, spelling errors, and test-setup issues from [indyrb.org](http://indyrb.org/) hack night. Thank you all for your contributions!
23
-
24
- ### Fixed
25
196
  - Shellescape options. A stray quote in `header` or `footer` would cause PDF to fail to generate, and this should close down many potential attack vectors if you allow user-supplied values to be passed into `wicked_pdf` render options.
26
197
 
27
198
  ## [1.0.4] - 2016-01-26
28
- ### Changed
199
+ ### Fixes
29
200
  - Check that logger responds to info before calling it. It was possible to have a `logger` method defined as a controller helper that would override `Rails.logger`.
30
-
31
- ### Fixed
32
201
  - [Issue with Sprockets 3.0](https://github.com/mileszs/wicked_pdf/issues/476) where an asset referenced in a stylesheet not existing would raise an exception `read_asset` on nil.
33
202
 
34
203
  ## [1.0.3] - 2015-12-02
35
- ### Changed
204
+ ### Fixes
36
205
  - Revert default DPI. Some installs of `wkhtmltopdf` would experience major slowdowns or crashes with it set to 72. It is suggested that a DPI of 75 may be better, but I'm holding off on making it a default without more information.
37
206
 
38
207
  ## [1.0.2] - 2015-11-30
39
- ### Changed
208
+ ### Fixes
40
209
  - The default dpi is now 72. Previously the default would be whatever your `wkhtmltopdf` version specified as the default. This change [speeds up generation of documents that contain `border-radius` dramatically](https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1510)
41
210
 
42
211
  ## [1.0.1] - 2015-11-19
43
- ### Changed
212
+ ### Fixes
44
213
  - Made minor RuboCop style tweaks.
45
-
46
- ### Added
47
214
  - Added default [RuboCop](https://github.com/bbatsov/rubocop) config and run after test suite.
48
-
49
- ### Fixed
50
215
  - Issue with `nil.basename` from asset helpers.
51
216
 
52
217
  ## [1.0.0] - 2015-11-03
53
- ### Changed
218
+ ### Breaking Changes
54
219
  - Accepted that `WickedPDF` cannot guarantee backwards compatibility with older versions of `wkthmltopdf`, and decided to publish a new version with the MAJOR number incremented, signaling that this may have breaking changes for some people, but providing a path forward for progress. This release number also signals that this is a mature (and relatively stable) project, and should be deemed ready for production (since it has been used in production since ~2009, and downloaded over a *million* times on [RubyGems.org](https://rubygems.org/gems/wicked_pdf)).
55
220
  - Stopped attempting to track with version number of `wkhtmltopdf` binary releases (`wkhtmltopdf` v9.x == `WickedPDF` v9.x)
56
221
  - Adopted [Semantic Versioning](http://semver.org/) for release numbering
57
222
  - Added a CHANGELOG (based on [keepachangelog.com](http://keepachangelog.com/))
58
223
  - Misc code tweaks as suggested by [RuboCop](https://github.com/bbatsov/rubocop)
59
224
 
60
- ### Added
225
+ ### New Features
61
226
  - Check version of `wkhtmltopdf` before deciding to pass arguments with or without dashes
62
- - New arguments and options for the table of contents supported in newer versions of wkhtmltopf: `text_size_shrink`, `level_indentation`, `disable_dotted_lines`, `disable_toc_links`, `xsl_style_sheet`
227
+ - New arguments and options for the table of contents supported in newer versions of wkhtmltopdf: `text_size_shrink`, `level_indentation`, `disable_dotted_lines`, `disable_toc_links`, `xsl_style_sheet`
63
228
  - Merge in global options to `pdf_from_html_file` and `pdf_from_string`
64
229
  - Add ability to generate pdf from a web resource: `pdf_from_url(url)`
230
+ - Removed explicit dependency on [Rails](https://github.com/rails/rails), since parts of this library may be used without it.
65
231
 
66
- ### Removed
67
- - Explicit dependency on [Rails](https://github.com/rails/rails), since parts of this library may be used without it.
68
- - Comment out the `:exe_path` option in the generated initalizer by default (since many systems won't have `wkthmltopdf` installed in that specific location)
69
-
70
- ### Fixed
232
+ ### Fixes
233
+ - Comment out the `:exe_path` option in the generated initializer by default (since many systems won't have `wkthmltopdf` installed in that specific location)
71
234
  - Issues with `file://` paths on Windows-based systems
72
235
  - Issues with parsed options/argument ordering on versions of `wkthmltopdf` > 0.9
73
236
  - Issues with middleware headers when running Rails app mounted in a subdirectory
@@ -76,20 +239,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
76
239
  - Issue with header/footer `:content` being deleted after the first page
77
240
  - Issues with options being modified during processing (including global config options)
78
241
  - Issues with asset helpers recognizing assets specified without a protocol
79
- - Issues with `url()` references and embedded `data:base64` assests in stylesheets rendered with `wicked_pdf_stylesheet_link_tag`
242
+ - Issues with `url()` references and embedded `data:base64` assets in stylesheets rendered with `wicked_pdf_stylesheet_link_tag`
80
243
  - Asset helpers no longer add a file extension if it already is specified with one
81
244
 
82
- # Compare Releases
83
- - [1.1.0...HEAD](https://github.com/mileszs/wicked_pdf/compare/1.1.0...HEAD)
84
- - [1.0.6...1.1.0](https://github.com/mileszs/wicked_pdf/compare/1.0.6...1.1.0)
85
- - [1.0.5...1.0.6](https://github.com/mileszs/wicked_pdf/compare/1.0.5...1.0.6)
86
- - [1.0.4...1.0.5](https://github.com/mileszs/wicked_pdf/compare/1.0.4...1.0.5)
87
- - [1.0.3...1.0.4](https://github.com/mileszs/wicked_pdf/compare/1.0.3...1.0.4)
88
- - [1.0.2...1.0.3](https://github.com/mileszs/wicked_pdf/compare/1.0.2...1.0.3)
89
- - [1.0.1...1.0.2](https://github.com/mileszs/wicked_pdf/compare/1.0.1...1.0.2)
90
- - [1.0.0...1.0.1](https://github.com/mileszs/wicked_pdf/compare/1.0.0...1.0.1)
91
- - [0.11.0...1.0.0](https://github.com/mileszs/wicked_pdf/compare/0.11.0...1.0.0)
92
- - [0.10.2...0.11.0](https://github.com/mileszs/wicked_pdf/compare/0.10.2...0.11.0)
93
- - [0.10.1...0.10.2](https://github.com/mileszs/wicked_pdf/compare/0.10.1...0.10.2)
94
- - [0.10.0...0.10.1](https://github.com/mileszs/wicked_pdf/compare/0.10.0...0.10.1)
95
- - [0.9.10...0.10.0](https://github.com/mileszs/wicked_pdf/compare/0.9.10...0.10.0)