prawn-rails 1.2.0 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -7
  3. data/README.md +36 -13
  4. data/lib/prawn-rails.rb +13 -2
  5. data/lib/prawn-rails/document.rb +5 -4
  6. data/lib/prawn-rails/rails_helper.rb +22 -11
  7. data/lib/prawn-rails/renderer.rb +2 -11
  8. data/lib/prawn-rails/version.rb +1 -1
  9. data/test/dummy_app/app/assets/config/manifest.js +3 -0
  10. data/test/dummy_app/app/controllers/reports_controller.rb +21 -2
  11. data/test/dummy_app/app/views/reports/custom.pdf.prawn +3 -0
  12. data/test/dummy_app/app/views/reports/custom_disposition.pdf.prawn +3 -0
  13. data/test/dummy_app/app/views/reports/custom_filename.pdf.prawn +3 -0
  14. data/test/dummy_app/config/application.rb +0 -7
  15. data/test/dummy_app/config/routes.rb +5 -0
  16. data/test/dummy_app/log/test.log +436 -76
  17. data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0/Ac/AcCgT9z272BU3f9VmSXyH6aXg0-fBwSzc8apjB9C0T4.cache → v4.0.0/0o/0og-K-ORl6wO02dgU3z8beSXSGOCdnEFcX6KEtXqG2Q.cache} +0 -0
  18. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/2V/2VONmeO4ClBgY1gjdZLYo9wQjDG9Ef9sAuwWVxceLEk.cache +1 -0
  19. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/34/34uQaon4nFa_kXcNF-1ac-QhL_HKtstSnb2pGjYCb6w.cache +1 -0
  20. data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +0 -0
  21. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/43/43Xh_xLNBt5kEi4-pWc5m0pFDLIhkNAxyiBf-3E2UJw.cache +1 -0
  22. data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache +0 -0
  23. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8x/8x5zY49XOU4gtdILE9T8l00lhs-lUJ6zzl5hyxjaFzw.cache +0 -0
  24. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/AT/ATEwOxnm0kBLQ6bdeFkXutl92AMg1dA40zmBqy2f2Ng.cache +0 -0
  25. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ag/AgeZ6zQVNy2sDfEUqjxoVLoCsGo6rA27SUQoJFjqCqY.cache +1 -0
  26. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Dj/DjIeso8fWA-cG6Y9zSr3T0rPtpS6V73u3Q234QgSLa8.cache +1 -0
  27. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache +2 -0
  28. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/E_/E_ZbvXNGsLYdwZdD1F159gQCYVGJrWgaip0GlUx9B68.cache +1 -0
  29. data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache +0 -0
  30. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Lk/LkuzadDEF5r9a_QBFvWJ5krc5aerVbxs4zJ19iztB38.cache +0 -0
  31. data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +0 -0
  32. data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0/EG/EGPvvBJ-Qo0bhB9ro0HZH9s4Ln-PNqgz-uYTi5tV_88.cache → v4.0.0/Uc/UcQ6dMoNX10N68Sv8qxPf7kahPOJ5pqzYWkbjDKyF1k.cache} +0 -0
  33. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cp/cp36yIX2yPJBfhw6EA0u-BWnvFazmGC8zKxglna59TI.cache +1 -0
  34. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dt/dteXKuRtjT5JiLleDPqnTNJFalNEbck9vA19hE6rGyw.cache +1 -0
  35. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/hy/hyxqCkBWzkpfHLCqW3YJeQq93KRADVcxEEMz0o0We_w.cache +0 -0
  36. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/k6/k6DfQWIBNnOJUNVvE59mXcoCzMB9D6i0p1WuJZGANoQ.cache +1 -0
  37. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/kR/kRjL0yRqyeZXZk93BSxxJULpCv-rJ3QvC23X4W94RNA.cache +0 -0
  38. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache +2 -0
  39. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vt/vtslB-h9sglaV55iVgO8l86UBTtzDnuA6qzCy-vzujk.cache +0 -0
  40. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/xD/xDLUWV68gWaS7IJWKWBAPzLcA0ALSjQHns0tsk0zY3s.cache +0 -0
  41. data/test/integration/prawn_rails_test.rb +52 -25
  42. data/test/prawn_rails_test.rb +7 -2
  43. data/test/test_helper.rb +10 -0
  44. metadata +124 -55
  45. data/lib/prawn-rails/engine.rb +0 -14
  46. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/-T/-Ty2Lif1RQ31LfQ3sdBLOYNu3fwjefNQWZXg61o7S0Q.cache +0 -1
  47. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/-m/-mGgwBQ39pkjNoHzuM7XVbFYsHOyv_6SOM_CmI-kLnw.cache +0 -0
  48. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/3j/3jV3hjwp5k_C7riQHMv6rtrQUfKwPXzFkJ32sUJuN_E.cache +0 -0
  49. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/7b/7bJ7ytF6vF1igkdeslMStlJ0FX-qsua3IF_1YPq8oCw.cache +0 -1
  50. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/SJ/SJ3C0iDdYBBG_yOrab-Sw62moViXQPI90mwV-VCda_o.cache +0 -0
  51. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/ie/ieDr67bZ5kFv-ENcBz8Q7TiuRQETGYgdgzYHyXqVcoI.cache +0 -0
  52. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/qW/qWT2nJzx5CDYl-mSJ0WXKcYzB6yu_HDoZLsoO5mWh7g.cache +0 -1
  53. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/se/seL12R6emubM_qf0qkqUQp8lYPC0Sv3ALlPVz2lH5OM.cache +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcdfd9339a473a4b6ffac041d0d1b42c0630711b5784145b558e5050490ddebf
4
- data.tar.gz: 6251f2b7ae1ab549bf54986e5ea217221001e2e5dfd7761fac45958e62aee44b
3
+ metadata.gz: 0ac0f78d8a8a1a3b0a4ed9fc10663d2932deb2297adba3b95ba6572de2218148
4
+ data.tar.gz: e5ca3d10154db2cd49d0408248a19c4501ad4f95001ad9e6ba4295a2baaede6e
5
5
  SHA512:
6
- metadata.gz: 14961e5d174b0380f6bc763e52ee641f4d7867f4fc1987edf0c54d21399a0a98d8940fa14bfef33fa108f1ca6e447a35f73b25f1aeccf8ffa0af6bbcb944c9c1
7
- data.tar.gz: 41842b2616f8b7ae572085fc25fc538845e667c856cf20f54535963073123b8fa3c6c42a6193ef9b069e468474cd7f324e734f64d36e89c970dc57e4d6808cb8
6
+ metadata.gz: dbdbf5da9ca6bab323d9a5c6a2efaad5eed7c9506f1e5953986b1f885c93fbc75a1854ba09b52de2c86dd379b2b39a42389e81f48a9123c200de5d65e36d00e6
7
+ data.tar.gz: 5ff405b51522c7c906e62d3fbc8eaa95ae51a595de245cb1a2cde692fbba85cc2c9e62075a38d2828c06f98b5c67ab0e811f99d8dac6713ecff125e30a0046b7
data/CHANGELOG.md CHANGED
@@ -1,22 +1,39 @@
1
1
  # Changelog
2
2
 
3
- * `Unreleased`
3
+ * `Unreleased` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.2...master)
4
4
  - Nothing yet
5
-
6
- * `v1.2.0`
5
+
6
+ * `v1.4.2` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.1...v1.4.2)
7
+ - Remove dependency on `railsties` and instead only depend on `actionview`
8
+
9
+ * `v1.4.1` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.0...v1.4.1)
10
+ - [7575606](https://github.com/cortiz/prawn-rails/commit/7575606) - Complete switch to Railsties from [PR #41](https://github.com/cortiz/prawn-rails/pull/41)
11
+
12
+ * `v1.4.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.3.0...v1.4.0)
13
+ - [PR #41](https://github.com/cortiz/prawn-rails/pull/41) - Depend on `railsties` instead of `rails` gem to avoid pulling in unnecessary dependencies such as action_cable, etc.
14
+
15
+ * `v1.3.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.2.1...v1.3.0)
16
+ - [PR #40](https://github.com/cortiz/prawn-rails/pull/40) - Add `:filename` and `:disposition` options for `prawn_document
17
+ - [PR #40](https://github.com/cortiz/prawn-rails/pull/40) - Do not override existing`Content-Disposition` headers
18
+
19
+ * `v1.2.1` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.2.0...v1.2.1)
20
+ - [PR #39](https://github.com/cortiz/prawn-rails/pull/39) - Fix Rails 6 deprecation warning for single arity template handlers
21
+ - Remove unnecessary option logic from `prawn_document` method
22
+
23
+ * `v1.2.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.1.0...v1.2.0)
7
24
  - [PR #31](https://github.com/cortiz/prawn-rails/pull/31) - Use Prawn::Document.extensions in favor of custom plug-in loading. This removes all changes made in PR #29 and should behave much more appropriately now.
8
25
  - [Undo PR #29](https://github.com/cortiz/prawn-rails/pull/31) - Use Prawn::Document.extensions in favor of custom plug-in loading
9
26
  - [PR #30](https://github.com/cortiz/prawn-rails/pull/30) - Allow rendering in ActionMailer
10
27
 
11
- * `v1.1.0`
28
+ * `v1.1.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.0.2...v1.1.0)
12
29
  - [PR #29](https://github.com/cortiz/prawn-rails/pull/29) - Require all installed prawn extensions
13
30
  - Removed unnecessary `html_strip` helper method. If you were using this feature, instead use Rails built in `strip_tags(html_str)` or `ActionView::Base.full_sanitizer.sanitize(html_str)`
14
31
  - Add legitimate tests
15
32
 
16
- * `v1.0.1`
33
+ * `v1.0.1` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.0.0...v1.0.1)
17
34
  - Fix error when using `ActionController.render_to_string`
18
35
 
19
- * `v1.0.0`
36
+ * `v1.0.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.0.0...v0.1.1)
20
37
  - Support `@filename`
21
38
  - Set PDF Title metadata based on `@filename` if not specified
22
39
  - Fix for Ruby 1.9.3+
@@ -24,5 +41,5 @@
24
41
 
25
42
  * `v0.1.1`
26
43
  * `v0.1.0`
27
- * `v0.0.2`
44
+ * `v0.0.2`
28
45
  * `v0.0.1`
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
- # Prawn-Rails [![Gem Version](https://badge.fury.io/rb/prawn-rails.svg)](http://badge.fury.io/rb/prawn-rails)
2
- <a href='http://ko-fi.com/A552JBK' target='_blank'><img height='32' style='border:0px;height:32px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=a' border='0' alt='Buy Me a Coffee' /></a>
1
+ # Prawn-Rails
2
+ <a href="https://badge.fury.io/rb/prawn-rails" target="_blank"><img height="21" style='border:0px;height:21px;' border='0' src="https://badge.fury.io/rb/prawn-rails.svg" alt="Gem Version"></a>
3
+ <a href='https://github.com/cortiz/prawn-rails/actions' target='_blank'><img src="https://github.com/cortiz/prawn-rails/workflows/Tests/badge.svg" style="max-width:100%;" height='21' style='border:0px;height:21px;' border='0' alt="CI Status"></a>
4
+ <a href='https://rubygems.org/gems/prawn-rails' target='_blank'><img height='21' style='border:0px;height:21px;' src='https://ruby-gem-downloads-badge.herokuapp.com/prawn-rails?label=rubygems&type=total&total_label=downloads&color=brightgreen' border='0' alt='RubyGems Downloads' /></a>
5
+
3
6
 
4
7
  # Install
5
8
  ```ruby
@@ -9,7 +12,7 @@ gem 'prawn-rails'
9
12
  Note: `prawn` and `prawn-table` are dependencies of `prawn-rails` so there is no need to mention it in the projects Gemfile unless you want to use a specific version of either of those libraries.
10
13
 
11
14
  # Usage
12
- Create a view with `pdf` as format and `prawn` as handler so filename should look like `example.pdf.prawn`
15
+ Create a view with `pdf` as format and `prawn` as handler so filename should look like `example.pdf.prawn`.
13
16
 
14
17
  It provides a helper called `prawn_document` which builds a PrawnRails::Document with default options. You can override any options as you please. Example:
15
18
 
@@ -19,19 +22,41 @@ prawn_document do |pdf|
19
22
  end
20
23
  ```
21
24
 
22
- No need to call `pdf.render`, it is called by `prawn_document`
25
+ No need to call `pdf.render`, it is called by `prawn_document`.
26
+
27
+ You can customize the name of the generated PDF and the file's delivery format with the `:filename` and `:disposition` keys:
28
+
29
+ ```ruby
30
+ prawn_document(filename: "my-file.pdf", disposition: "attachment") do |pdf|
31
+ pdf.text "Direct download incoming!"
32
+ end
33
+ ```
34
+
35
+ You can also override the content disposition using the [`Content-Disposition` HTTP header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#As_a_response_header_for_the_main_body). If you've already set this, `prawn-rails` will *not* override it. Here's an example of setting the header directly:
23
36
 
24
- If you want to customize the name of the file should a user try to save it, you can specify the filename in your action:
37
+ ```ruby
38
+ def download
39
+ respond_to do |format|
40
+ format.pdf do
41
+ headers["Content-Disposition"] = "attachment; filename=\"charts-#{Time.now.to_i}.pdf\""
42
+ end
43
+ end
44
+ end
45
+ ```
46
+
47
+ You can also override the file's name from the controller via `@filename`:
25
48
 
26
49
  ```ruby
27
50
  def show
28
- @filename = 'my_report.pdf'
51
+ @filename = "my_report.pdf"
29
52
  end
30
53
  ```
31
54
 
55
+ If no options are given, the file's name will match to your browser's default and the delivery format will default to `inline`.
56
+
32
57
  # Default configuration
33
58
 
34
- Add a `prawn-rails.rb` config to your Rails app under `config/initializers` like this
59
+ Add a `prawn-rails.rb` config to your Rails app under `config/initializers` like this:
35
60
 
36
61
  ```ruby
37
62
  PrawnRails.config do |config|
@@ -41,11 +66,11 @@ PrawnRails.config do |config|
41
66
  end
42
67
  ```
43
68
 
44
- Please note that these are the defaults.
69
+ Please note that these are the defaults.
45
70
 
46
- For a list of all available options: [http://www.rubydoc.info/gems/prawn/Prawn%2FDocument:initialize](http://www.rubydoc.info/gems/prawn/Prawn%2FDocument:initialize).
71
+ For a list of all available options: [http://www.rubydoc.info/gems/prawn/Prawn%2FDocument:initialize](http://www.rubydoc.info/gems/prawn/Prawn%2FDocument:initialize).
47
72
 
48
- For a list of all metadata the the `:info` option supports, please see [https://github.com/prawnpdf/prawn/blob/master/manual/document_and_page_options/metadata.rb](https://github.com/prawnpdf/prawn/blob/master/manual/document_and_page_options/metadata.rb)
73
+ For a list of all metadata the the `:info` option supports, please see [https://github.com/prawnpdf/prawn/blob/master/manual/document_and_page_options/metadata.rb](https://github.com/prawnpdf/prawn/blob/master/manual/document_and_page_options/metadata.rb).
49
74
 
50
75
  If `skip_page_creation` is set to true then you have to create the first page yourself. Example:
51
76
 
@@ -59,7 +84,7 @@ pdf.start_new_page size: "A4", page_layout: :portrait
59
84
 
60
85
  #### Hello World
61
86
 
62
- ```ruby
87
+ ```ruby
63
88
  # hello.pdf.prawn
64
89
 
65
90
  prawn_document do |pdf|
@@ -93,5 +118,3 @@ end
93
118
  Maintained by Weston Ganger - @westonganger
94
119
 
95
120
  Created by Carlos Ortiz - @cortiz
96
-
97
- <a href='http://ko-fi.com/A552JBK' target='_blank'><img height='32' style='border:0px;height:32px;' src='https://az743702.vo.msecnd.net/cdn/kofi1.png?v=a' border='0' alt='Buy Me a Coffee' /></a>
data/lib/prawn-rails.rb CHANGED
@@ -1,6 +1,17 @@
1
- require "prawn-rails/config"
2
- require "prawn-rails/engine"
1
+ require "prawn"
2
+
3
3
  require "prawn-rails/version"
4
+ require "prawn-rails/config"
5
+
6
+ require "prawn-rails/rails_helper"
7
+ require "prawn-rails/renderer"
8
+
9
+ ActionView::Base.send(:include, PrawnRails::RailsHelper)
10
+ ActionView::Template.register_template_handler(:prawn, PrawnRails::Renderer)
11
+
12
+ unless Mime::Type.lookup_by_extension(:pdf)
13
+ Mime::Type.register_alias("application/pdf", :pdf)
14
+ end
4
15
 
5
16
  module PrawnRails
6
17
  end
@@ -10,13 +10,14 @@ module PrawnRails
10
10
  Prawn::Document.extensions
11
11
  end
12
12
 
13
- def initialize(opts = {})
13
+ def initialize(options = {})
14
14
  if PrawnRails.config.respond_to?(:to_h)
15
- default = PrawnRails.config.to_h.merge(opts)
15
+ options.reverse_merge!(PrawnRails.config.to_h)
16
16
  else
17
- default = PrawnRails.config.marshal_dump.merge(opts)
17
+ options.reverse_merge!(PrawnRails.config.marshal_dump)
18
18
  end
19
- super(default)
19
+
20
+ super(options)
20
21
  end
21
22
 
22
23
  # Typically text expects a string. But Rails views have this interesting concept that they implicitly call `to_s` on all the variables before rendering. So, passing an integer to text fails:
@@ -4,23 +4,34 @@ module PrawnRails
4
4
  module RailsHelper
5
5
 
6
6
  def prawn_document(options={})
7
- options.reverse_merge!({
8
- page_layout: PrawnRails.config.page_layout,
9
- page_size: PrawnRails.config.page_size,
10
- info: {
11
- Title: @filename.sub(/\.(p|P)(d|D)(f|F)$/, '')
12
- }
13
- })
7
+ @filename ||= options[:filename]
14
8
 
15
- if PrawnRails.config.skip_page_creation
16
- options.reverse_merge!(skip_page_creation: true)
17
- end
9
+ options.reverse_merge!(get_metadata)
18
10
 
19
11
  pdf = PrawnRails::Document.new(options)
20
12
 
13
+ # Ignore headers when we're not rendering from an ActionController context.
14
+ if defined?(controller) && controller.respond_to?(:response) && !controller.response.nil?
15
+ disposition = options[:disposition] || "inline"
16
+ disposition += "; filename=\"#{@filename}\"" if @filename
17
+
18
+ # Don't override 'Content-Disposition' if we've chosen to set it elsewhere.
19
+ controller.response.headers['Content-Disposition'] ||= disposition
20
+ end
21
+
21
22
  yield pdf if block_given?
22
23
 
23
- pdf.render
24
+ return pdf.render
25
+ end
26
+
27
+ def get_metadata
28
+ return {} unless @filename
29
+
30
+ {
31
+ info: {
32
+ Title: @filename.sub(/\.pdf$/i, '')
33
+ }
34
+ }
24
35
  end
25
36
 
26
37
  end
@@ -3,17 +3,8 @@ require "prawn-rails/document"
3
3
  module PrawnRails
4
4
  class Renderer
5
5
 
6
- ### WARNING: BE VERY CAREFUL IF EDITING THIS METHOD
7
- def self.call(template)
8
- %{
9
- @filename ||= "\#{controller.action_name}.pdf"
10
-
11
- if controller.respond_to?(:response) && !controller.response.nil?
12
- controller.response.headers['Content-Disposition'] = "inline; filename=\\\"\#{@filename}\\\""
13
- end
14
-
15
- #{template.source.strip}
16
- }
6
+ def self.call(template, source = nil)
7
+ (source || template.source).strip
17
8
  end
18
9
 
19
10
  end
@@ -1,3 +1,3 @@
1
1
  module PrawnRails
2
- VERSION = "1.2.0"
2
+ VERSION = "1.4.2"
3
3
  end
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -1,5 +1,5 @@
1
1
  class ReportsController < ApplicationController
2
-
2
+
3
3
  def sample
4
4
  @items = [
5
5
  {name: "Hello"},
@@ -14,5 +14,24 @@ class ReportsController < ApplicationController
14
14
  [7,8,9],
15
15
  ]
16
16
  end
17
-
17
+
18
+ def custom_filename
19
+ end
20
+
21
+ def custom_disposition
22
+ end
23
+
24
+ def custom
25
+ end
26
+
27
+ def ivar_filename
28
+ @filename = "ivar-filename.pdf"
29
+ render :custom
30
+ end
31
+
32
+ def custom_headers
33
+ headers['Content-Disposition'] = "attachment;filename=\"custom-headers.pdf\""
34
+ render :custom
35
+ end
36
+
18
37
  end
@@ -0,0 +1,3 @@
1
+ prawn_document(filename: "from-options.pdf", disposition: "attachment") do |pdf|
2
+ pdf.text "Hello World!"
3
+ end
@@ -0,0 +1,3 @@
1
+ prawn_document(disposition: "attachment") do |pdf|
2
+ pdf.text "Hello World!"
3
+ end
@@ -0,0 +1,3 @@
1
+ prawn_document(filename: "from-options.pdf") do |pdf|
2
+ pdf.text "Hello World!"
3
+ end
@@ -48,12 +48,5 @@ module Dummy
48
48
  config.generators.helper = false
49
49
  config.generators.stylesheets = false
50
50
  config.generators.javascripts = false
51
-
52
- if ActiveRecord.respond_to?(:gem_version)
53
- gem_version = ActiveRecord.gem_version
54
- if gem_version >= Gem::Version.new("5.2")
55
- config.active_record.sqlite3.represent_boolean_as_integer = true
56
- end
57
- end
58
51
  end
59
52
  end
@@ -1,4 +1,9 @@
1
1
  Dummy::Application.routes.draw do
2
+ get "reports/custom"
3
+ get "reports/custom_disposition"
4
+ get "reports/custom_filename"
5
+ get "reports/custom_headers"
6
+ get "reports/ivar_filename"
2
7
  get "reports/sample"
3
8
  get "reports/table"
4
9
  end
@@ -1,124 +1,484 @@
1
-  (0.1ms) begin transaction
2
- ------------------------------------------
3
- NavigationTest: test_Renders_pdf_to_string
4
- ------------------------------------------
1
+  (1.0ms) SELECT sqlite_version(*)
2
+  (0.1ms) SELECT sqlite_version(*)
3
+ TRANSACTION (0.1ms) begin transaction
4
+ --------------------------------------------------------------
5
+ PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
6
+ --------------------------------------------------------------
7
+ TRANSACTION (0.0ms) rollback transaction
8
+ TRANSACTION (0.0ms) begin transaction
9
+ ----------------------------------------------
10
+ PrawnRailsTest: test_text_can_take_non_strings
11
+ ----------------------------------------------
12
+ TRANSACTION (0.0ms) rollback transaction
13
+ TRANSACTION (0.0ms) begin transaction
14
+ ------------------------------------------------------------
15
+ NavigationTest: test_Respects_the_'disposition'_option_alone
16
+ ------------------------------------------------------------
17
+ Started GET "/reports/custom_disposition.pdf" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
18
+ Processing by ReportsController#custom_disposition as PDF
19
+ Rendering reports/custom_disposition.pdf.prawn
20
+ Rendered reports/custom_disposition.pdf.prawn (Duration: 2.3ms | Allocations: 1793)
21
+ Completed 200 OK in 10ms (Views: 6.1ms | ActiveRecord: 0.0ms | Allocations: 4958)
22
+ TRANSACTION (0.0ms) rollback transaction
23
+ TRANSACTION (0.0ms) begin transaction
24
+ -----------------------------------------------
25
+ NavigationTest: test_render_to_string_in_mailer
26
+ -----------------------------------------------
5
27
  Rendering reports/sample.pdf.prawn
6
- Rendered reports/sample.pdf.prawn (87.9ms)
7
-  (0.1ms) rollback transaction
8
-  (0.2ms) begin transaction
9
- ------------------------------------------------------
10
- NavigationTest: test_Registers_:prawn_template_handler
11
- ------------------------------------------------------
12
-  (0.1ms) rollback transaction
13
-  (0.1ms) begin transaction
14
- ---------------------------------------------
15
- NavigationTest: test_Registers_:pdf_mime_type
16
- ---------------------------------------------
17
-  (0.1ms) rollback transaction
18
-  (0.1ms) begin transaction
28
+ Rendered reports/sample.pdf.prawn (Duration: 13.2ms | Allocations: 15750)
29
+ Rendering reports_mailer/send_report.html.erb
30
+ Rendered reports_mailer/send_report.html.erb (Duration: 0.4ms | Allocations: 79)
31
+ ReportsMailer#send_report: processed outbound mail in 21.7ms
32
+ TRANSACTION (0.0ms) rollback transaction
33
+ TRANSACTION (0.0ms) begin transaction
34
+ -----------------------------------------------------------------
35
+ NavigationTest: test_Sets_file_name_from_'@filename'_when_present
36
+ -----------------------------------------------------------------
37
+ Started GET "/reports/ivar_filename.pdf" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
38
+ Processing by ReportsController#ivar_filename as PDF
39
+ Rendering reports/custom.pdf.prawn
40
+ Rendered reports/custom.pdf.prawn (Duration: 1.9ms | Allocations: 1664)
41
+ Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms | Allocations: 2031)
42
+ TRANSACTION (0.0ms) rollback transaction
43
+ TRANSACTION (0.0ms) begin transaction
19
44
  ----------------------------------------------
20
45
  NavigationTest: test_Renders_sample_pdf_action
21
46
  ----------------------------------------------
22
- Started GET "/reports/sample?format=pdf" for 127.0.0.1 at 2018-06-28 06:47:20 -0700
47
+ Started GET "/reports/sample?format=pdf" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
23
48
  Processing by ReportsController#sample as PDF
24
49
  Rendering reports/sample.pdf.prawn
25
- Rendered reports/sample.pdf.prawn (17.0ms)
26
- Completed 200 OK in 22ms (Views: 19.7ms | ActiveRecord: 0.0ms)
27
-  (0.2ms) rollback transaction
28
-  (0.1ms) begin transaction
50
+ Rendered reports/sample.pdf.prawn (Duration: 29.2ms | Allocations: 12640)
51
+ Completed 200 OK in 30ms (Views: 29.5ms | ActiveRecord: 0.0ms | Allocations: 13029)
52
+ TRANSACTION (0.0ms) rollback transaction
53
+ TRANSACTION (0.0ms) begin transaction
54
+ -----------------------------------------------------------------------
55
+ NavigationTest: test_Respects_both_options_on_'prawn-document'_together
56
+ -----------------------------------------------------------------------
57
+ Started GET "/reports/custom.pdf" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
58
+ Processing by ReportsController#custom as PDF
59
+ Rendering reports/custom.pdf.prawn
60
+ Rendered reports/custom.pdf.prawn (Duration: 1.6ms | Allocations: 1601)
61
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms | Allocations: 1856)
62
+ TRANSACTION (0.0ms) rollback transaction
63
+ TRANSACTION (0.0ms) begin transaction
29
64
  ------------------------------------------------------------------------------------
30
65
  NavigationTest: test_Renders_table_pdf_action_using_auto-required_plugin_Prawn-Table
31
66
  ------------------------------------------------------------------------------------
32
- Started GET "/reports/table?format=pdf" for 127.0.0.1 at 2018-06-28 06:47:20 -0700
67
+ Started GET "/reports/table?format=pdf" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
33
68
  Processing by ReportsController#table as PDF
34
69
  Rendering reports/table.pdf.prawn
35
- Rendered reports/table.pdf.prawn (22.8ms)
36
- Completed 200 OK in 27ms (Views: 23.6ms | ActiveRecord: 0.0ms)
37
-  (0.1ms) rollback transaction
38
-  (0.0ms) begin transaction
70
+ Rendered reports/table.pdf.prawn (Duration: 8.7ms | Allocations: 10711)
71
+ Completed 200 OK in 9ms (Views: 9.0ms | ActiveRecord: 0.0ms | Allocations: 11096)
72
+ TRANSACTION (0.1ms) rollback transaction
73
+ TRANSACTION (0.0ms) begin transaction
74
+ ------------------------------------------
75
+ NavigationTest: test_Renders_pdf_to_string
76
+ ------------------------------------------
77
+ Rendering reports/sample.pdf.prawn
78
+ Rendered reports/sample.pdf.prawn (Duration: 23.6ms | Allocations: 12632)
79
+ TRANSACTION (0.1ms) rollback transaction
80
+ TRANSACTION (0.1ms) begin transaction
81
+ --------------------------------------------------------------------
82
+ NavigationTest: test_Maintains_existing_'Content-Disposition'_header
83
+ --------------------------------------------------------------------
84
+ Started GET "/reports/custom_headers.pdf" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
85
+ Processing by ReportsController#custom_headers as PDF
86
+ Rendering reports/custom.pdf.prawn
87
+ Rendered reports/custom.pdf.prawn (Duration: 1.5ms | Allocations: 1603)
88
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms | Allocations: 1842)
89
+ TRANSACTION (0.2ms) rollback transaction
90
+ TRANSACTION (0.1ms) begin transaction
39
91
  ----------------------------------------
40
92
  NavigationTest: test_Renders_html_action
41
93
  ----------------------------------------
42
- Started GET "/reports/sample" for 127.0.0.1 at 2018-06-28 06:47:20 -0700
94
+ Started GET "/reports/sample" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
43
95
  Processing by ReportsController#sample as HTML
96
+ Rendering layout layouts/application.html.erb
44
97
  Rendering reports/sample.html.erb within layouts/application
45
- Rendered reports/sample.html.erb within layouts/application (1.6ms)
46
- Completed 200 OK in 325ms (Views: 321.7ms | ActiveRecord: 0.0ms)
47
-  (0.1ms) rollback transaction
48
-  (0.1ms) begin transaction
98
+ Rendered reports/sample.html.erb within layouts/application (Duration: 0.7ms | Allocations: 74)
99
+ Rendered layout layouts/application.html.erb (Duration: 15.9ms | Allocations: 7026)
100
+ Completed 200 OK in 20ms (Views: 17.5ms | ActiveRecord: 0.0ms | Allocations: 7788)
101
+ TRANSACTION (0.0ms) rollback transaction
102
+ TRANSACTION (0.0ms) begin transaction
103
+ ---------------------------------------------
104
+ NavigationTest: test_Registers_:pdf_mime_type
105
+ ---------------------------------------------
106
+ TRANSACTION (0.0ms) rollback transaction
107
+ TRANSACTION (0.0ms) begin transaction
108
+ ---------------------------------------------------------
109
+ NavigationTest: test_Respects_the_'filename'_option_alone
110
+ ---------------------------------------------------------
111
+ Started GET "/reports/custom_filename.pdf" for 127.0.0.1 at 2021-05-26 22:02:25 -0700
112
+ Processing by ReportsController#custom_filename as PDF
113
+ Rendering reports/custom_filename.pdf.prawn
114
+ Rendered reports/custom_filename.pdf.prawn (Duration: 2.0ms | Allocations: 1662)
115
+ Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms | Allocations: 2042)
116
+ TRANSACTION (0.0ms) rollback transaction
117
+ TRANSACTION (0.0ms) begin transaction
118
+ ------------------------------------------------------
119
+ NavigationTest: test_Registers_:prawn_template_handler
120
+ ------------------------------------------------------
121
+ TRANSACTION (0.0ms) rollback transaction
122
+  (0.7ms) SELECT sqlite_version(*)
123
+  (0.0ms) SELECT sqlite_version(*)
124
+ TRANSACTION (0.1ms) begin transaction
125
+ --------------------------------------------------------------------
126
+ NavigationTest: test_Maintains_existing_'Content-Disposition'_header
127
+ --------------------------------------------------------------------
128
+ Started GET "/reports/custom_headers.pdf" for 127.0.0.1 at 2021-05-26 22:02:59 -0700
129
+ Processing by ReportsController#custom_headers as PDF
130
+ Rendering reports/custom.pdf.prawn
131
+ Rendered reports/custom.pdf.prawn (Duration: 19.9ms | Allocations: 34835)
132
+ Completed 200 OK in 27ms (Views: 25.1ms | ActiveRecord: 0.0ms | Allocations: 37994)
133
+ TRANSACTION (0.0ms) rollback transaction
134
+ TRANSACTION (0.1ms) begin transaction
135
+ ---------------------------------------------------------
136
+ NavigationTest: test_Respects_the_'filename'_option_alone
137
+ ---------------------------------------------------------
138
+ Started GET "/reports/custom_filename.pdf" for 127.0.0.1 at 2021-05-26 22:02:59 -0700
139
+ Processing by ReportsController#custom_filename as PDF
140
+ Rendering reports/custom_filename.pdf.prawn
141
+ Rendered reports/custom_filename.pdf.prawn (Duration: 1.6ms | Allocations: 1660)
142
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms | Allocations: 2049)
143
+ TRANSACTION (0.0ms) rollback transaction
144
+ TRANSACTION (0.0ms) begin transaction
49
145
  -----------------------------------------------
50
146
  NavigationTest: test_render_to_string_in_mailer
51
147
  -----------------------------------------------
52
148
  Rendering reports/sample.pdf.prawn
53
- Rendered reports/sample.pdf.prawn (18.9ms)
149
+ Rendered reports/sample.pdf.prawn (Duration: 13.5ms | Allocations: 15750)
54
150
  Rendering reports_mailer/send_report.html.erb
55
- Rendered reports_mailer/send_report.html.erb (0.4ms)
56
- ReportsMailer#send_report: processed outbound mail in 367.1ms
57
-  (0.1ms) rollback transaction
58
-  (0.1ms) begin transaction
59
- ----------------------------------------------
60
- PrawnRailsTest: test_text_can_take_non_strings
61
- ----------------------------------------------
62
-  (0.1ms) rollback transaction
63
-  (0.1ms) begin transaction
64
- ----------------------------------------------
65
- PrawnRailsTest: test_text_can_take_non_strings
66
- ----------------------------------------------
67
-  (0.1ms) rollback transaction
68
-  (0.0ms) begin transaction
151
+ Rendered reports_mailer/send_report.html.erb (Duration: 0.2ms | Allocations: 79)
152
+ ReportsMailer#send_report: processed outbound mail in 22.2ms
153
+ TRANSACTION (0.0ms) rollback transaction
154
+ TRANSACTION (0.0ms) begin transaction
155
+ ------------------------------------------------------
156
+ NavigationTest: test_Registers_:prawn_template_handler
157
+ ------------------------------------------------------
158
+ TRANSACTION (0.0ms) rollback transaction
159
+ TRANSACTION (0.0ms) begin transaction
69
160
  ------------------------------------------------------------------------------------
70
161
  NavigationTest: test_Renders_table_pdf_action_using_auto-required_plugin_Prawn-Table
71
162
  ------------------------------------------------------------------------------------
72
- Started GET "/reports/table?format=pdf" for 127.0.0.1 at 2018-06-28 06:53:41 -0700
163
+ Started GET "/reports/table?format=pdf" for 127.0.0.1 at 2021-05-26 22:02:59 -0700
73
164
  Processing by ReportsController#table as PDF
74
165
  Rendering reports/table.pdf.prawn
75
- Rendered reports/table.pdf.prawn (16.8ms)
76
- Completed 200 OK in 31ms (Views: 27.5ms | ActiveRecord: 0.0ms)
77
-  (0.1ms) rollback transaction
78
-  (0.1ms) begin transaction
166
+ Rendered reports/table.pdf.prawn (Duration: 8.3ms | Allocations: 10706)
167
+ Completed 200 OK in 9ms (Views: 8.6ms | ActiveRecord: 0.0ms | Allocations: 11097)
168
+ TRANSACTION (0.0ms) rollback transaction
169
+ TRANSACTION (0.0ms) begin transaction
170
+ -----------------------------------------------------------------------
171
+ NavigationTest: test_Respects_both_options_on_'prawn-document'_together
172
+ -----------------------------------------------------------------------
173
+ Started GET "/reports/custom.pdf" for 127.0.0.1 at 2021-05-26 22:02:59 -0700
174
+ Processing by ReportsController#custom as PDF
175
+ Rendering reports/custom.pdf.prawn
176
+ Rendered reports/custom.pdf.prawn (Duration: 1.9ms | Allocations: 1599)
177
+ Completed 200 OK in 2ms (Views: 2.3ms | ActiveRecord: 0.0ms | Allocations: 1859)
178
+ TRANSACTION (0.0ms) rollback transaction
179
+ TRANSACTION (0.0ms) begin transaction
180
+ ---------------------------------------------
181
+ NavigationTest: test_Registers_:pdf_mime_type
182
+ ---------------------------------------------
183
+ TRANSACTION (0.0ms) rollback transaction
184
+ TRANSACTION (0.0ms) begin transaction
185
+ ------------------------------------------------------------
186
+ NavigationTest: test_Respects_the_'disposition'_option_alone
187
+ ------------------------------------------------------------
188
+ Started GET "/reports/custom_disposition.pdf" for 127.0.0.1 at 2021-05-26 22:02:59 -0700
189
+ Processing by ReportsController#custom_disposition as PDF
190
+ Rendering reports/custom_disposition.pdf.prawn
191
+ Rendered reports/custom_disposition.pdf.prawn (Duration: 1.8ms | Allocations: 1632)
192
+ Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms | Allocations: 2014)
193
+ TRANSACTION (0.0ms) rollback transaction
194
+ TRANSACTION (0.0ms) begin transaction
195
+ -----------------------------------------------------------------
196
+ NavigationTest: test_Sets_file_name_from_'@filename'_when_present
197
+ -----------------------------------------------------------------
198
+ Started GET "/reports/ivar_filename.pdf" for 127.0.0.1 at 2021-05-26 22:02:59 -0700
199
+ Processing by ReportsController#ivar_filename as PDF
200
+ Rendering reports/custom.pdf.prawn
201
+ Rendered reports/custom.pdf.prawn (Duration: 1.7ms | Allocations: 1599)
202
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms | Allocations: 1841)
203
+ TRANSACTION (0.0ms) rollback transaction
204
+ TRANSACTION (0.0ms) begin transaction
79
205
  ------------------------------------------
80
206
  NavigationTest: test_Renders_pdf_to_string
81
207
  ------------------------------------------
82
208
  Rendering reports/sample.pdf.prawn
83
- Rendered reports/sample.pdf.prawn (23.4ms)
84
-  (0.1ms) rollback transaction
85
-  (0.1ms) begin transaction
209
+ Rendered reports/sample.pdf.prawn (Duration: 39.5ms | Allocations: 12636)
210
+ TRANSACTION (0.0ms) rollback transaction
211
+ TRANSACTION (0.0ms) begin transaction
212
+ ----------------------------------------------
213
+ NavigationTest: test_Renders_sample_pdf_action
214
+ ----------------------------------------------
215
+ Started GET "/reports/sample?format=pdf" for 127.0.0.1 at 2021-05-26 22:02:59 -0700
216
+ Processing by ReportsController#sample as PDF
217
+ Rendering reports/sample.pdf.prawn
218
+ Rendered reports/sample.pdf.prawn (Duration: 13.6ms | Allocations: 12633)
219
+ Completed 200 OK in 15ms (Views: 14.0ms | ActiveRecord: 0.0ms | Allocations: 13029)
220
+ TRANSACTION (0.1ms) rollback transaction
221
+ TRANSACTION (0.0ms) begin transaction
222
+ ----------------------------------------
223
+ NavigationTest: test_Renders_html_action
224
+ ----------------------------------------
225
+ Started GET "/reports/sample" for 127.0.0.1 at 2021-05-26 22:03:00 -0700
226
+ Processing by ReportsController#sample as HTML
227
+ Rendering layout layouts/application.html.erb
228
+ Rendering reports/sample.html.erb within layouts/application
229
+ Rendered reports/sample.html.erb within layouts/application (Duration: 0.3ms | Allocations: 72)
230
+ Rendered layout layouts/application.html.erb (Duration: 4.8ms | Allocations: 3237)
231
+ Completed 200 OK in 7ms (Views: 6.0ms | ActiveRecord: 0.0ms | Allocations: 4000)
232
+ TRANSACTION (0.0ms) rollback transaction
233
+ TRANSACTION (0.0ms) begin transaction
234
+ ----------------------------------------------
235
+ PrawnRailsTest: test_text_can_take_non_strings
236
+ ----------------------------------------------
237
+ TRANSACTION (0.0ms) rollback transaction
238
+ TRANSACTION (0.0ms) begin transaction
239
+ --------------------------------------------------------------
240
+ PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
241
+ --------------------------------------------------------------
242
+ TRANSACTION (0.0ms) rollback transaction
243
+  (1.2ms) SELECT sqlite_version(*)
244
+  (0.0ms) SELECT sqlite_version(*)
245
+ TRANSACTION (0.0ms) begin transaction
246
+ --------------------------------------------------------------
247
+ PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
248
+ --------------------------------------------------------------
249
+ TRANSACTION (0.0ms) rollback transaction
250
+ TRANSACTION (0.0ms) begin transaction
251
+ ----------------------------------------------
252
+ PrawnRailsTest: test_text_can_take_non_strings
253
+ ----------------------------------------------
254
+ TRANSACTION (0.0ms) rollback transaction
255
+ TRANSACTION (0.0ms) begin transaction
256
+ -----------------------------------------------------------------
257
+ NavigationTest: test_Sets_file_name_from_'@filename'_when_present
258
+ -----------------------------------------------------------------
259
+ Started GET "/reports/ivar_filename.pdf" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
260
+ Processing by ReportsController#ivar_filename as PDF
261
+ Rendering reports/custom.pdf.prawn
262
+ Rendered reports/custom.pdf.prawn (Duration: 3.5ms | Allocations: 1819)
263
+ Completed 200 OK in 18ms (Views: 13.1ms | ActiveRecord: 0.0ms | Allocations: 4974)
264
+ TRANSACTION (0.1ms) rollback transaction
265
+ TRANSACTION (0.0ms) begin transaction
266
+ ---------------------------------------------------------
267
+ NavigationTest: test_Respects_the_'filename'_option_alone
268
+ ---------------------------------------------------------
269
+ Started GET "/reports/custom_filename.pdf" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
270
+ Processing by ReportsController#custom_filename as PDF
271
+ Rendering reports/custom_filename.pdf.prawn
272
+ Rendered reports/custom_filename.pdf.prawn (Duration: 1.7ms | Allocations: 1660)
273
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms | Allocations: 2049)
274
+ TRANSACTION (0.0ms) rollback transaction
275
+ TRANSACTION (0.0ms) begin transaction
86
276
  ----------------------------------------------
87
277
  NavigationTest: test_Renders_sample_pdf_action
88
278
  ----------------------------------------------
89
- Started GET "/reports/sample?format=pdf" for 127.0.0.1 at 2018-06-28 06:53:41 -0700
279
+ Started GET "/reports/sample?format=pdf" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
90
280
  Processing by ReportsController#sample as PDF
91
281
  Rendering reports/sample.pdf.prawn
92
- Rendered reports/sample.pdf.prawn (20.2ms)
93
- Completed 200 OK in 24ms (Views: 21.0ms | ActiveRecord: 0.0ms)
94
-  (0.1ms) rollback transaction
95
-  (0.0ms) begin transaction
282
+ Rendered reports/sample.pdf.prawn (Duration: 13.6ms | Allocations: 15757)
283
+ Completed 200 OK in 14ms (Views: 13.9ms | ActiveRecord: 0.0ms | Allocations: 16152)
284
+ TRANSACTION (0.0ms) rollback transaction
285
+ TRANSACTION (0.0ms) begin transaction
286
+ ------------------------------------------------------
287
+ NavigationTest: test_Registers_:prawn_template_handler
288
+ ------------------------------------------------------
289
+ TRANSACTION (0.0ms) rollback transaction
290
+ TRANSACTION (0.0ms) begin transaction
291
+ -----------------------------------------------------------------------
292
+ NavigationTest: test_Respects_both_options_on_'prawn-document'_together
293
+ -----------------------------------------------------------------------
294
+ Started GET "/reports/custom.pdf" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
295
+ Processing by ReportsController#custom as PDF
296
+ Rendering reports/custom.pdf.prawn
297
+ Rendered reports/custom.pdf.prawn (Duration: 1.5ms | Allocations: 1604)
298
+ Completed 200 OK in 2ms (Views: 1.7ms | ActiveRecord: 0.0ms | Allocations: 1865)
299
+ TRANSACTION (0.0ms) rollback transaction
300
+ TRANSACTION (0.0ms) begin transaction
96
301
  -----------------------------------------------
97
302
  NavigationTest: test_render_to_string_in_mailer
98
303
  -----------------------------------------------
99
304
  Rendering reports/sample.pdf.prawn
100
- Rendered reports/sample.pdf.prawn (18.0ms)
305
+ Rendered reports/sample.pdf.prawn (Duration: 11.7ms | Allocations: 12630)
101
306
  Rendering reports_mailer/send_report.html.erb
102
- Rendered reports_mailer/send_report.html.erb (2.3ms)
103
- ReportsMailer#send_report: processed outbound mail in 479.1ms
104
-  (0.1ms) rollback transaction
105
-  (0.1ms) begin transaction
106
- ------------------------------------------------------
107
- NavigationTest: test_Registers_:prawn_template_handler
108
- ------------------------------------------------------
109
-  (0.1ms) rollback transaction
110
-  (0.1ms) begin transaction
307
+ Rendered reports_mailer/send_report.html.erb (Duration: 0.5ms | Allocations: 80)
308
+ ReportsMailer#send_report: processed outbound mail in 19.3ms
309
+ TRANSACTION (0.0ms) rollback transaction
310
+ TRANSACTION (0.0ms) begin transaction
311
+ ------------------------------------------
312
+ NavigationTest: test_Renders_pdf_to_string
313
+ ------------------------------------------
314
+ Rendering reports/sample.pdf.prawn
315
+ Rendered reports/sample.pdf.prawn (Duration: 15.9ms | Allocations: 12634)
316
+ TRANSACTION (0.1ms) rollback transaction
317
+ TRANSACTION (0.0ms) begin transaction
318
+ --------------------------------------------------------------------
319
+ NavigationTest: test_Maintains_existing_'Content-Disposition'_header
320
+ --------------------------------------------------------------------
321
+ Started GET "/reports/custom_headers.pdf" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
322
+ Processing by ReportsController#custom_headers as PDF
323
+ Rendering reports/custom.pdf.prawn
324
+ Rendered reports/custom.pdf.prawn (Duration: 1.5ms | Allocations: 1597)
325
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms | Allocations: 1841)
326
+ TRANSACTION (0.0ms) rollback transaction
327
+ TRANSACTION (0.0ms) begin transaction
328
+ ------------------------------------------------------------
329
+ NavigationTest: test_Respects_the_'disposition'_option_alone
330
+ ------------------------------------------------------------
331
+ Started GET "/reports/custom_disposition.pdf" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
332
+ Processing by ReportsController#custom_disposition as PDF
333
+ Rendering reports/custom_disposition.pdf.prawn
334
+ Rendered reports/custom_disposition.pdf.prawn (Duration: 2.0ms | Allocations: 1632)
335
+ Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.0ms | Allocations: 2014)
336
+ TRANSACTION (0.0ms) rollback transaction
337
+ TRANSACTION (0.0ms) begin transaction
111
338
  ----------------------------------------
112
339
  NavigationTest: test_Renders_html_action
113
340
  ----------------------------------------
114
- Started GET "/reports/sample" for 127.0.0.1 at 2018-06-28 06:53:42 -0700
341
+ Started GET "/reports/sample" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
115
342
  Processing by ReportsController#sample as HTML
343
+ Rendering layout layouts/application.html.erb
116
344
  Rendering reports/sample.html.erb within layouts/application
117
- Rendered reports/sample.html.erb within layouts/application (0.5ms)
118
- Completed 200 OK in 279ms (Views: 273.8ms | ActiveRecord: 0.0ms)
119
-  (0.1ms) rollback transaction
120
-  (0.1ms) begin transaction
345
+ Rendered reports/sample.html.erb within layouts/application (Duration: 0.4ms | Allocations: 70)
346
+ Rendered layout layouts/application.html.erb (Duration: 6.8ms | Allocations: 3235)
347
+ Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.0ms | Allocations: 3998)
348
+ TRANSACTION (0.0ms) rollback transaction
349
+ TRANSACTION (0.0ms) begin transaction
350
+ ------------------------------------------------------------------------------------
351
+ NavigationTest: test_Renders_table_pdf_action_using_auto-required_plugin_Prawn-Table
352
+ ------------------------------------------------------------------------------------
353
+ Started GET "/reports/table?format=pdf" for 127.0.0.1 at 2021-05-26 22:41:10 -0700
354
+ Processing by ReportsController#table as PDF
355
+ Rendering reports/table.pdf.prawn
356
+ Rendered reports/table.pdf.prawn (Duration: 13.2ms | Allocations: 10706)
357
+ Completed 200 OK in 14ms (Views: 13.5ms | ActiveRecord: 0.0ms | Allocations: 11097)
358
+ TRANSACTION (0.0ms) rollback transaction
359
+ TRANSACTION (0.0ms) begin transaction
121
360
  ---------------------------------------------
122
361
  NavigationTest: test_Registers_:pdf_mime_type
123
362
  ---------------------------------------------
124
-  (0.0ms) rollback transaction
363
+ TRANSACTION (0.0ms) rollback transaction
364
+  (1.3ms) SELECT sqlite_version(*)
365
+  (0.0ms) SELECT sqlite_version(*)
366
+ TRANSACTION (0.0ms) begin transaction
367
+ --------------------------------------------------------------
368
+ PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
369
+ --------------------------------------------------------------
370
+ TRANSACTION (0.0ms) rollback transaction
371
+ TRANSACTION (0.0ms) begin transaction
372
+ ----------------------------------------------
373
+ PrawnRailsTest: test_text_can_take_non_strings
374
+ ----------------------------------------------
375
+ TRANSACTION (0.0ms) rollback transaction
376
+ TRANSACTION (0.0ms) begin transaction
377
+ ------------------------------------------
378
+ NavigationTest: test_Renders_pdf_to_string
379
+ ------------------------------------------
380
+ Rendering reports/sample.pdf.prawn
381
+ Rendered reports/sample.pdf.prawn (Duration: 21.3ms | Allocations: 15911)
382
+ TRANSACTION (0.0ms) rollback transaction
383
+ TRANSACTION (0.0ms) begin transaction
384
+ -----------------------------------------------------------------------
385
+ NavigationTest: test_Respects_both_options_on_'prawn-document'_together
386
+ -----------------------------------------------------------------------
387
+ Started GET "/reports/custom.pdf" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
388
+ Processing by ReportsController#custom as PDF
389
+ Rendering reports/custom.pdf.prawn
390
+ Rendered reports/custom.pdf.prawn (Duration: 2.3ms | Allocations: 1669)
391
+ Completed 200 OK in 7ms (Views: 3.8ms | ActiveRecord: 0.0ms | Allocations: 3365)
392
+ TRANSACTION (0.1ms) rollback transaction
393
+ TRANSACTION (0.0ms) begin transaction
394
+ -----------------------------------------------
395
+ NavigationTest: test_render_to_string_in_mailer
396
+ -----------------------------------------------
397
+ Rendering reports/sample.pdf.prawn
398
+ Rendered reports/sample.pdf.prawn (Duration: 12.4ms | Allocations: 12629)
399
+ Rendering reports_mailer/send_report.html.erb
400
+ Rendered reports_mailer/send_report.html.erb (Duration: 0.4ms | Allocations: 79)
401
+ ReportsMailer#send_report: processed outbound mail in 22.5ms
402
+ TRANSACTION (0.1ms) rollback transaction
403
+ TRANSACTION (0.0ms) begin transaction
404
+ ------------------------------------------------------------------------------------
405
+ NavigationTest: test_Renders_table_pdf_action_using_auto-required_plugin_Prawn-Table
406
+ ------------------------------------------------------------------------------------
407
+ Started GET "/reports/table?format=pdf" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
408
+ Processing by ReportsController#table as PDF
409
+ Rendering reports/table.pdf.prawn
410
+ Rendered reports/table.pdf.prawn (Duration: 9.0ms | Allocations: 10707)
411
+ Completed 200 OK in 10ms (Views: 9.4ms | ActiveRecord: 0.0ms | Allocations: 11098)
412
+ TRANSACTION (0.1ms) rollback transaction
413
+ TRANSACTION (0.0ms) begin transaction
414
+ ------------------------------------------------------------
415
+ NavigationTest: test_Respects_the_'disposition'_option_alone
416
+ ------------------------------------------------------------
417
+ Started GET "/reports/custom_disposition.pdf" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
418
+ Processing by ReportsController#custom_disposition as PDF
419
+ Rendering reports/custom_disposition.pdf.prawn
420
+ Rendered reports/custom_disposition.pdf.prawn (Duration: 2.2ms | Allocations: 1636)
421
+ Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms | Allocations: 2019)
422
+ TRANSACTION (0.0ms) rollback transaction
423
+ TRANSACTION (0.1ms) begin transaction
424
+ -----------------------------------------------------------------
425
+ NavigationTest: test_Sets_file_name_from_'@filename'_when_present
426
+ -----------------------------------------------------------------
427
+ Started GET "/reports/ivar_filename.pdf" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
428
+ Processing by ReportsController#ivar_filename as PDF
429
+ Rendering reports/custom.pdf.prawn
430
+ Rendered reports/custom.pdf.prawn (Duration: 1.6ms | Allocations: 1599)
431
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms | Allocations: 1841)
432
+ TRANSACTION (0.0ms) rollback transaction
433
+ TRANSACTION (0.0ms) begin transaction
434
+ --------------------------------------------------------------------
435
+ NavigationTest: test_Maintains_existing_'Content-Disposition'_header
436
+ --------------------------------------------------------------------
437
+ Started GET "/reports/custom_headers.pdf" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
438
+ Processing by ReportsController#custom_headers as PDF
439
+ Rendering reports/custom.pdf.prawn
440
+ Rendered reports/custom.pdf.prawn (Duration: 1.6ms | Allocations: 1597)
441
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms | Allocations: 1840)
442
+ TRANSACTION (0.0ms) rollback transaction
443
+ TRANSACTION (0.0ms) begin transaction
444
+ ---------------------------------------------
445
+ NavigationTest: test_Registers_:pdf_mime_type
446
+ ---------------------------------------------
447
+ TRANSACTION (0.0ms) rollback transaction
448
+ TRANSACTION (0.0ms) begin transaction
449
+ ----------------------------------------
450
+ NavigationTest: test_Renders_html_action
451
+ ----------------------------------------
452
+ Started GET "/reports/sample" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
453
+ Processing by ReportsController#sample as HTML
454
+ Rendering layout layouts/application.html.erb
455
+ Rendering reports/sample.html.erb within layouts/application
456
+ Rendered reports/sample.html.erb within layouts/application (Duration: 0.5ms | Allocations: 70)
457
+ Rendered layout layouts/application.html.erb (Duration: 8.8ms | Allocations: 3235)
458
+ Completed 200 OK in 10ms (Views: 9.9ms | ActiveRecord: 0.0ms | Allocations: 3997)
459
+ TRANSACTION (0.1ms) rollback transaction
460
+ TRANSACTION (0.0ms) begin transaction
461
+ ---------------------------------------------------------
462
+ NavigationTest: test_Respects_the_'filename'_option_alone
463
+ ---------------------------------------------------------
464
+ Started GET "/reports/custom_filename.pdf" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
465
+ Processing by ReportsController#custom_filename as PDF
466
+ Rendering reports/custom_filename.pdf.prawn
467
+ Rendered reports/custom_filename.pdf.prawn (Duration: 2.0ms | Allocations: 1660)
468
+ Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.0ms | Allocations: 2045)
469
+ TRANSACTION (0.0ms) rollback transaction
470
+ TRANSACTION (0.0ms) begin transaction
471
+ ------------------------------------------------------
472
+ NavigationTest: test_Registers_:prawn_template_handler
473
+ ------------------------------------------------------
474
+ TRANSACTION (0.0ms) rollback transaction
475
+ TRANSACTION (0.0ms) begin transaction
476
+ ----------------------------------------------
477
+ NavigationTest: test_Renders_sample_pdf_action
478
+ ----------------------------------------------
479
+ Started GET "/reports/sample?format=pdf" for 127.0.0.1 at 2021-05-26 22:44:19 -0700
480
+ Processing by ReportsController#sample as PDF
481
+ Rendering reports/sample.pdf.prawn
482
+ Rendered reports/sample.pdf.prawn (Duration: 13.6ms | Allocations: 12633)
483
+ Completed 200 OK in 15ms (Views: 13.9ms | ActiveRecord: 0.0ms | Allocations: 13027)
484
+ TRANSACTION (0.1ms) rollback transaction