wicked_pdf 1.0.3 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3a9bd19353fd98c1329694e7e28958e05dd01d97
4
- data.tar.gz: 33413fa1202def89fa910d38996ea732ac86b706
2
+ SHA256:
3
+ metadata.gz: b6fc82b54d2e17d53f2e9c8b23d4987dccb18e38a20f8aadaa57cd2b7c263bcb
4
+ data.tar.gz: bb936e81af7719b89e6878c891b9bb2d5a3fd8742a24640e2508773c9b2be0dc
5
5
  SHA512:
6
- metadata.gz: a7c925ec176e0976cede93924098016466bd8627a99af611b89c283792ccbd9a154a450a2d9370079d9f6f72d1d48c8c57e0ef5ab3d25f235b242222aa4deabe
7
- data.tar.gz: 44b674f5bc1efd1bdb54354f0cc05d13442af7427c53c903821951491f17923466d9d8223303e0519d6b37ba8e2fce8ba534b1d88fcda33c139f61db9d7e1b61
6
+ metadata.gz: 3fe8ce87aa78a2d6d1d1e6590d1f069762b56f363aad561c255f7d1f0ba461fabcfb63177a34a547d4de7f1d6bebc9d3f2a17fa0095b7f36d0fb7a0f1c28a657
7
+ data.tar.gz: d2a74408e9a7b90046c3c6ecada7af16f7ccacf0fbe787a25b99b218c17ba42945d5854cd4c0631d2c73b2b306e55ca97a424ee6d313fc357d20378696a4945a
@@ -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
+
data/.rubocop.yml CHANGED
@@ -1,9 +1,14 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
+ TargetRubyVersion: 1.9
4
5
  Exclude:
5
6
  - 'test/dummy/**/*'
6
7
 
8
+ Metrics/BlockLength:
9
+ Exclude:
10
+ - 'wicked_pdf.gemspec'
11
+
7
12
  # I'd like wicked_pdf to keep Ruby 1.8 compatibility for now
8
13
  Style/HashSyntax:
9
14
  EnforcedStyle: hash_rockets
data/.rubocop_todo.yml CHANGED
@@ -5,13 +5,6 @@
5
5
  # Note that changes in the inspected code, or installation of new
6
6
  # versions of RuboCop, may require this file to be generated again.
7
7
 
8
- # Offense count: 2
9
- Lint/AmbiguousRegexpLiteral:
10
- Enabled: false
11
-
12
- # Offense count: 2
13
- Lint/HandleExceptions:
14
- Enabled: false
15
8
 
16
9
  # Offense count: 9
17
10
  Metrics/AbcSize:
@@ -24,11 +17,14 @@ Metrics/BlockNesting:
24
17
  # Offense count: 2
25
18
  # Configuration parameters: CountComments.
26
19
  Metrics/ClassLength:
27
- Max: 279
20
+ Max: 300
21
+
22
+ Metrics/ModuleLength:
23
+ Max: 160
28
24
 
29
25
  # Offense count: 5
30
26
  Metrics/CyclomaticComplexity:
31
- Max: 9
27
+ Max: 11
32
28
 
33
29
  # Offense count: 92
34
30
  # Configuration parameters: AllowURI, URISchemes.
@@ -44,8 +40,8 @@ Metrics/MethodLength:
44
40
  Metrics/PerceivedComplexity:
45
41
  Max: 12
46
42
 
47
- # Offense count: 5
48
- Style/AccessorMethodName:
43
+ # Offense count: 2
44
+ Naming/AccessorMethodName:
49
45
  Enabled: false
50
46
 
51
47
  # Offense count: 1
data/.travis.yml CHANGED
@@ -1,18 +1,12 @@
1
1
  language:
2
2
  - ruby
3
+ git:
4
+ depth: 1
5
+ quiet: true
6
+ before_install:
7
+ - sudo apt-get update -qq
3
8
  bundler_args: --verbose
4
9
  sudo: required
5
- rvm:
6
- - 1.9.2
7
- - 1.9.3
8
- - 2.0
9
- - 2.1
10
- - 2.2
11
- - ruby-head
12
- gemfile:
13
- - gemfiles/3.0.gemfile
14
- - gemfiles/3.1.gemfile
15
- - gemfiles/3.2.gemfile
16
10
  before_script:
17
11
  - bundle list
18
12
  - sudo apt-get install -y wkhtmltopdf
@@ -20,38 +14,67 @@ before_script:
20
14
  - "sh -e /etc/init.d/xvfb start"
21
15
  env: WKHTMLTOPDF_BIN=/usr/bin/wkhtmltopdf
22
16
  script:
23
- - bundle exec rake dummy_generate
24
- - bundle exec rake test
17
+ - bundle exec rake
25
18
  matrix:
26
19
  include:
27
20
  - rvm: 1.8.7
28
21
  before_install:
22
+ - sudo apt-get update -qq
29
23
  - gem update --system 1.8.25
30
24
  - gem --version
31
25
  gemfile: gemfiles/2.3.gemfile
26
+ - rvm: 1.9.2
27
+ gemfile: gemfiles/3.0.gemfile
32
28
  - rvm: 1.9.3
29
+ gemfile: gemfiles/3.1.gemfile
30
+ - rvm: 2.0
31
+ gemfile: gemfiles/3.2.gemfile
32
+ - rvm: 2.0
33
33
  gemfile: gemfiles/4.0.gemfile
34
- - rvm: 1.9.3
35
- gemfile: gemfiles/rails_edge.gemfile
36
- - rvm: 2.0.0
37
- gemfile: gemfiles/4.0.gemfile
38
- - rvm: 2.0.0
39
- gemfile: gemfiles/rails_edge.gemfile
40
- - rvm: 2.2.0
34
+ - rvm: 2.1
41
35
  gemfile: gemfiles/4.1.gemfile
42
- - rvm: 2.2.0
36
+ - rvm: 2.2
43
37
  gemfile: gemfiles/4.2.gemfile
44
- - rvm: 2.2.0
38
+ - rvm: 2.3
39
+ gemfile: gemfiles/5.0.gemfile
40
+ before_install:
41
+ # https://github.com/danmayer/coverband/issues/162
42
+ - "find /home/travis/.rvm/rubies -wholename '*default/bundler-*.gemspec' -delete"
43
+ - rvm @global do gem uninstall bundler -a -x -I || true
44
+ - gem install bundler -v '< 2'
45
+ - rvm: 2.4
46
+ gemfile: gemfiles/5.1.gemfile
47
+ before_install:
48
+ - "find /home/travis/.rvm/rubies -wholename '*default/bundler-*.gemspec' -delete"
49
+ - rvm @global do gem uninstall bundler -a -x -I || true
50
+ - gem install bundler -v '< 2'
51
+ - rvm: 2.5
52
+ gemfile: gemfiles/5.2.gemfile
53
+ - rvm: 2.5
45
54
  gemfile: gemfiles/rails_edge.gemfile
46
- allow_failures:
47
- - rvm: 1.9.2
48
- gemfile: gemfiles/3.1.gemfile
49
- - rvm: 1.9.2
50
- gemfile: gemfiles/3.2.gemfile
51
- - rvm: 1.9.3
55
+ - rvm: 2.6
56
+ gemfile: gemfiles/5.2.gemfile
57
+ before_install:
58
+ - gem update --system
59
+ - gem install bundler
60
+ - rvm: 2.6
52
61
  gemfile: gemfiles/rails_edge.gemfile
53
- - rvm: 2.0.0
62
+ before_install:
63
+ - gem update --system
64
+ - gem install bundler
65
+ - rvm: ruby-head
66
+ gemfile: gemfiles/5.2.gemfile
67
+ before_install:
68
+ - gem install bundler -v '~> 2'
69
+ - rvm: ruby-head
70
+ gemfile: gemfiles/rails_edge.gemfile
71
+ before_install:
72
+ - gem install bundler -v '~> 2'
73
+ allow_failures:
74
+ - rvm: 2.5
54
75
  gemfile: gemfiles/rails_edge.gemfile
55
- - rvm: 2.2.0
76
+ - rvm: 2.6
56
77
  gemfile: gemfiles/rails_edge.gemfile
78
+ - rvm: 2.5.3
79
+ gemfile: gemfiles/3.0.gemfile
57
80
  - rvm: ruby-head
data/CHANGELOG.md ADDED
@@ -0,0 +1,148 @@
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
+ ## [master branch] - Unreleased
6
+ ### Breaking Changes
7
+ - None
8
+ ### New Features
9
+ - None
10
+ ### Fixes
11
+ - None
12
+
13
+ ## [1.4.0] - 2019-05-23
14
+ ### New Features
15
+ - [Add support for `log_level` and `quiet` options](https://github.com/mileszs/wicked_pdf/pull/834)
16
+
17
+ ## [1.3.0] - 2019-05-20
18
+ ### New Features
19
+ - [Add support for Webpacker provided bundles](https://github.com/mileszs/wicked_pdf/pull/739)
20
+
21
+ ## [1.2.2] - 2019-04-13
22
+ ### Fixes
23
+ - [Fix issue loading Pty on Windows](https://github.com/mileszs/wicked_pdf/pull/820)
24
+ - [Fix conflict with remotipart causing SystemStackError](https://github.com/mileszs/wicked_pdf/pull/821)
25
+
26
+ ## [1.2.1] - 2019-03-16
27
+ ### Fixes
28
+ - [Fix `SystemStackError` in some setups](https://github.com/mileszs/wicked_pdf/pull/813)
29
+
30
+ ## [1.2.0] - 2019-03-16
31
+ ### New Features
32
+ - [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)
33
+ - [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)
34
+ - [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.
35
+
36
+ ### Fixes
37
+ - [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
38
+ - [Fix issue using the shell to locate `wkhtmltopdf` in a Bundler environment](https://github.com/mileszs/wicked_pdf/pull/728)
39
+ - [Fix `wkhtmltopdf` path detection when HOME environment variable is unset](https://github.com/mileszs/wicked_pdf/pull/568)
40
+ - [Fix error when the `Rails` constant is defined but not actually using Rails](https://github.com/mileszs/wicked_pdf/pull/613)
41
+ - [Fix compatibility issue with Sprockets 4](https://github.com/mileszs/wicked_pdf/pull/615)
42
+ - [Fix compatibility issue with `Mime::JS` in Rails 5.1+](https://github.com/mileszs/wicked_pdf/pull/627)
43
+ - [Fix deprecation warning by using `after_action` instead of `after_filter` when available](https://github.com/mileszs/wicked_pdf/pull/663)
44
+ - [Provide Rails `base_path` to `find_asset` calls for Sprockets file lookup](https://github.com/mileszs/wicked_pdf/pull/688)
45
+ - Logger changes:
46
+ - [Use `Rails.logger.debug` instead of `p`](https://github.com/mileszs/wicked_pdf/pull/575)
47
+ - [Change logger message to prepend `[wicked_pdf]` instead of nonstandard `****************WICKED****************`](https://github.com/mileszs/wicked_pdf/pull/589)
48
+ - Documentation changes:
49
+ - [Update link to wkhtmltopdf homepage](https://github.com/mileszs/wicked_pdf/pull/582)
50
+ - [Update link to `wkhtmltopdf_binary_gem`](https://github.com/mileszs/wicked_pdf/commit/59e6c5fca3985f2fa2f345089596250df5da2682)
51
+ - [Update documentation for usage with the Asset Pipeline](https://github.com/mileszs/wicked_pdf/commit/690d00157706699a71b7dcd71834759f4d84702f)
52
+ - [Document `default_protocol` option](https://github.com/mileszs/wicked_pdf/pull/585)
53
+ - [Document `image` and `no_image` options](https://github.com/mileszs/wicked_pdf/pull/689)
54
+ - [Document issue with DPI/scaling on various platforms](https://github.com/mileszs/wicked_pdf/pull/715)
55
+ - [Document creating and attaching a PDF in a mailer](https://github.com/mileszs/wicked_pdf/pull/746)
56
+ - [Document dependency on `wkhtmltopdf` with RubyGems](https://github.com/mileszs/wicked_pdf/pull/656)
57
+ - [Add example using WickedPDF with Rails in an API-only configuration](https://github.com/mileszs/wicked_pdf/pull/796)
58
+ - [Add example for rending a template as a header/footer](https://github.com/mileszs/wicked_pdf/pull/603)
59
+ - [Add GitHub issue template](https://github.com/mileszs/wicked_pdf/pull/805)
60
+ - [Add CodeClimate Badge](https://github.com/mileszs/wicked_pdf/pull/646)
61
+ - RuboCop cleanup
62
+ - Updates to Travis CI pipeline to support newer versions of Ruby & Rails
63
+
64
+ ## [1.1.0] - 2016-08-30
65
+ ### New Features
66
+ - Support Rails 5.x and Sprockets 3.x
67
+ - 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/)
68
+ - Support `no_stop_slow_scripts: true` to let slow running scripts delay rendering
69
+ - [Changes to asset finding to support Rails 5](https://github.com/mileszs/wicked_pdf/pull/561)
70
+
71
+ ### Fixes
72
+ - [Improved error handling](https://github.com/mileszs/wicked_pdf/pull/543)
73
+ - [Namespace helper classes under WickedPdf namespace](https://github.com/mileszs/wicked_pdf/pull/538)
74
+
75
+ ## [1.0.6] - 2016-04-04
76
+ ### Fixes
77
+ - 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.
78
+
79
+ ## [1.0.5] - 2016-03-28
80
+ ### Fixes
81
+ - 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!
82
+ - 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.
83
+
84
+ ## [1.0.4] - 2016-01-26
85
+ ### Fixes
86
+ - 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`.
87
+ - [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.
88
+
89
+ ## [1.0.3] - 2015-12-02
90
+ ### Fixes
91
+ - 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.
92
+
93
+ ## [1.0.2] - 2015-11-30
94
+ ### Fixes
95
+ - 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)
96
+
97
+ ## [1.0.1] - 2015-11-19
98
+ ### Fixes
99
+ - Made minor RuboCop style tweaks.
100
+ - Added default [RuboCop](https://github.com/bbatsov/rubocop) config and run after test suite.
101
+ - Issue with `nil.basename` from asset helpers.
102
+
103
+ ## [1.0.0] - 2015-11-03
104
+ ### Breaking Changes
105
+ - 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)).
106
+ - Stopped attempting to track with version number of `wkhtmltopdf` binary releases (`wkhtmltopdf` v9.x == `WickedPDF` v9.x)
107
+ - Adopted [Semantic Versioning](http://semver.org/) for release numbering
108
+ - Added a CHANGELOG (based on [keepachangelog.com](http://keepachangelog.com/))
109
+ - Misc code tweaks as suggested by [RuboCop](https://github.com/bbatsov/rubocop)
110
+
111
+ ### New Features
112
+ - Check version of `wkhtmltopdf` before deciding to pass arguments with or without dashes
113
+ - 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`
114
+ - Merge in global options to `pdf_from_html_file` and `pdf_from_string`
115
+ - Add ability to generate pdf from a web resource: `pdf_from_url(url)`
116
+ - Removed explicit dependency on [Rails](https://github.com/rails/rails), since parts of this library may be used without it.
117
+
118
+ ### Fixes
119
+ - Comment out the `:exe_path` option in the generated initalizer by default (since many systems won't have `wkthmltopdf` installed in that specific location)
120
+ - Issues with `file://` paths on Windows-based systems
121
+ - Issues with parsed options/argument ordering on versions of `wkthmltopdf` > 0.9
122
+ - Issues with middleware headers when running Rails app mounted in a subdirectory
123
+ - Issues with options that have a `key: 'value'` syntax when passed to `wkthmltopdf`
124
+ - Issue with `:temp_path` option being deleted from original options hash
125
+ - Issue with header/footer `:content` being deleted after the first page
126
+ - Issues with options being modified during processing (including global config options)
127
+ - Issues with asset helpers recognizing assets specified without a protocol
128
+ - Issues with `url()` references and embedded `data:base64` assests in stylesheets rendered with `wicked_pdf_stylesheet_link_tag`
129
+ - Asset helpers no longer add a file extension if it already is specified with one
130
+
131
+ # Compare Releases
132
+ - [1.2.2...HEAD](https://github.com/mileszs/wicked_pdf/compare/1.2.2...HEAD)
133
+ - [1.2.2...1.3.0](https://github.com/mileszs/wicked_pdf/compare/1.2.2...1.3.0)
134
+ - [1.2.1...1.2.2](https://github.com/mileszs/wicked_pdf/compare/1.2.1...1.2.2)
135
+ - [1.2.0...1.2.1](https://github.com/mileszs/wicked_pdf/compare/1.1.0...1.2.0)
136
+ - [1.1.0...1.2.0](https://github.com/mileszs/wicked_pdf/compare/1.1.0...1.2.0)
137
+ - [1.0.6...1.1.0](https://github.com/mileszs/wicked_pdf/compare/1.0.6...1.1.0)
138
+ - [1.0.5...1.0.6](https://github.com/mileszs/wicked_pdf/compare/1.0.5...1.0.6)
139
+ - [1.0.4...1.0.5](https://github.com/mileszs/wicked_pdf/compare/1.0.4...1.0.5)
140
+ - [1.0.3...1.0.4](https://github.com/mileszs/wicked_pdf/compare/1.0.3...1.0.4)
141
+ - [1.0.2...1.0.3](https://github.com/mileszs/wicked_pdf/compare/1.0.2...1.0.3)
142
+ - [1.0.1...1.0.2](https://github.com/mileszs/wicked_pdf/compare/1.0.1...1.0.2)
143
+ - [1.0.0...1.0.1](https://github.com/mileszs/wicked_pdf/compare/1.0.0...1.0.1)
144
+ - [0.11.0...1.0.0](https://github.com/mileszs/wicked_pdf/compare/0.11.0...1.0.0)
145
+ - [0.10.2...0.11.0](https://github.com/mileszs/wicked_pdf/compare/0.10.2...0.11.0)
146
+ - [0.10.1...0.10.2](https://github.com/mileszs/wicked_pdf/compare/0.10.1...0.10.2)
147
+ - [0.10.0...0.10.1](https://github.com/mileszs/wicked_pdf/compare/0.10.0...0.10.1)
148
+ - [0.9.10...0.10.0](https://github.com/mileszs/wicked_pdf/compare/0.9.10...0.10.0)