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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -7
- data/README.md +36 -13
- data/lib/prawn-rails.rb +13 -2
- data/lib/prawn-rails/document.rb +5 -4
- data/lib/prawn-rails/rails_helper.rb +22 -11
- data/lib/prawn-rails/renderer.rb +2 -11
- data/lib/prawn-rails/version.rb +1 -1
- data/test/dummy_app/app/assets/config/manifest.js +3 -0
- data/test/dummy_app/app/controllers/reports_controller.rb +21 -2
- data/test/dummy_app/app/views/reports/custom.pdf.prawn +3 -0
- data/test/dummy_app/app/views/reports/custom_disposition.pdf.prawn +3 -0
- data/test/dummy_app/app/views/reports/custom_filename.pdf.prawn +3 -0
- data/test/dummy_app/config/application.rb +0 -7
- data/test/dummy_app/config/routes.rb +5 -0
- data/test/dummy_app/log/test.log +436 -76
- data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0/Ac/AcCgT9z272BU3f9VmSXyH6aXg0-fBwSzc8apjB9C0T4.cache → v4.0.0/0o/0og-K-ORl6wO02dgU3z8beSXSGOCdnEFcX6KEtXqG2Q.cache} +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/2V/2VONmeO4ClBgY1gjdZLYo9wQjDG9Ef9sAuwWVxceLEk.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/34/34uQaon4nFa_kXcNF-1ac-QhL_HKtstSnb2pGjYCb6w.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/43/43Xh_xLNBt5kEi4-pWc5m0pFDLIhkNAxyiBf-3E2UJw.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8x/8x5zY49XOU4gtdILE9T8l00lhs-lUJ6zzl5hyxjaFzw.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/AT/ATEwOxnm0kBLQ6bdeFkXutl92AMg1dA40zmBqy2f2Ng.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ag/AgeZ6zQVNy2sDfEUqjxoVLoCsGo6rA27SUQoJFjqCqY.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Dj/DjIeso8fWA-cG6Y9zSr3T0rPtpS6V73u3Q234QgSLa8.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache +2 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/E_/E_ZbvXNGsLYdwZdD1F159gQCYVGJrWgaip0GlUx9B68.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Lk/LkuzadDEF5r9a_QBFvWJ5krc5aerVbxs4zJ19iztB38.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/{v3.0 → v4.0.0}/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +0 -0
- 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
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cp/cp36yIX2yPJBfhw6EA0u-BWnvFazmGC8zKxglna59TI.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dt/dteXKuRtjT5JiLleDPqnTNJFalNEbck9vA19hE6rGyw.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/hy/hyxqCkBWzkpfHLCqW3YJeQq93KRADVcxEEMz0o0We_w.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/k6/k6DfQWIBNnOJUNVvE59mXcoCzMB9D6i0p1WuJZGANoQ.cache +1 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/kR/kRjL0yRqyeZXZk93BSxxJULpCv-rJ3QvC23X4W94RNA.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache +2 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vt/vtslB-h9sglaV55iVgO8l86UBTtzDnuA6qzCy-vzujk.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/xD/xDLUWV68gWaS7IJWKWBAPzLcA0ALSjQHns0tsk0zY3s.cache +0 -0
- data/test/integration/prawn_rails_test.rb +52 -25
- data/test/prawn_rails_test.rb +7 -2
- data/test/test_helper.rb +10 -0
- metadata +124 -55
- data/lib/prawn-rails/engine.rb +0 -14
- data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/-T/-Ty2Lif1RQ31LfQ3sdBLOYNu3fwjefNQWZXg61o7S0Q.cache +0 -1
- data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/-m/-mGgwBQ39pkjNoHzuM7XVbFYsHOyv_6SOM_CmI-kLnw.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/3j/3jV3hjwp5k_C7riQHMv6rtrQUfKwPXzFkJ32sUJuN_E.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/7b/7bJ7ytF6vF1igkdeslMStlJ0FX-qsua3IF_1YPq8oCw.cache +0 -1
- data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/SJ/SJ3C0iDdYBBG_yOrab-Sw62moViXQPI90mwV-VCda_o.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/ie/ieDr67bZ5kFv-ENcBz8Q7TiuRQETGYgdgzYHyXqVcoI.cache +0 -0
- data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/qW/qWT2nJzx5CDYl-mSJ0WXKcYzB6yu_HDoZLsoO5mWh7g.cache +0 -1
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ac0f78d8a8a1a3b0a4ed9fc10663d2932deb2297adba3b95ba6572de2218148
|
4
|
+
data.tar.gz: e5ca3d10154db2cd49d0408248a19c4501ad4f95001ad9e6ba4295a2baaede6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
2
|
-
<a href=
|
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
|
-
|
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 =
|
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
|
2
|
-
|
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
|
data/lib/prawn-rails/document.rb
CHANGED
@@ -10,13 +10,14 @@ module PrawnRails
|
|
10
10
|
Prawn::Document.extensions
|
11
11
|
end
|
12
12
|
|
13
|
-
def initialize(
|
13
|
+
def initialize(options = {})
|
14
14
|
if PrawnRails.config.respond_to?(:to_h)
|
15
|
-
|
15
|
+
options.reverse_merge!(PrawnRails.config.to_h)
|
16
16
|
else
|
17
|
-
|
17
|
+
options.reverse_merge!(PrawnRails.config.marshal_dump)
|
18
18
|
end
|
19
|
-
|
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
|
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
|
-
|
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
|
data/lib/prawn-rails/renderer.rb
CHANGED
@@ -3,17 +3,8 @@ require "prawn-rails/document"
|
|
3
3
|
module PrawnRails
|
4
4
|
class Renderer
|
5
5
|
|
6
|
-
|
7
|
-
|
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
|
data/lib/prawn-rails/version.rb
CHANGED
@@ -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
|
@@ -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
|
data/test/dummy_app/log/test.log
CHANGED
@@ -1,124 +1,484 @@
|
|
1
|
-
[1m[35m (
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
[1m[35m (1.0ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
2
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
3
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[36mbegin transaction[0m
|
4
|
+
--------------------------------------------------------------
|
5
|
+
PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
|
6
|
+
--------------------------------------------------------------
|
7
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
8
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
9
|
+
----------------------------------------------
|
10
|
+
PrawnRailsTest: test_text_can_take_non_strings
|
11
|
+
----------------------------------------------
|
12
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
13
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
23
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
24
|
+
-----------------------------------------------
|
25
|
+
NavigationTest: test_render_to_string_in_mailer
|
26
|
+
-----------------------------------------------
|
5
27
|
Rendering reports/sample.pdf.prawn
|
6
|
-
Rendered reports/sample.pdf.prawn (
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
33
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
43
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
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 (
|
26
|
-
Completed 200 OK in
|
27
|
-
[1m[
|
28
|
-
[1m[
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
53
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
63
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
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 (
|
36
|
-
Completed 200 OK in
|
37
|
-
[1m[
|
38
|
-
[1m[
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
73
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
80
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.2ms)[0m [1m[31mrollback transaction[0m
|
90
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[36mbegin transaction[0m
|
39
91
|
----------------------------------------
|
40
92
|
NavigationTest: test_Renders_html_action
|
41
93
|
----------------------------------------
|
42
|
-
Started GET "/reports/sample" for 127.0.0.1 at
|
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 (
|
46
|
-
|
47
|
-
|
48
|
-
[1m[
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
102
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
103
|
+
---------------------------------------------
|
104
|
+
NavigationTest: test_Registers_:pdf_mime_type
|
105
|
+
---------------------------------------------
|
106
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
107
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
117
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
118
|
+
------------------------------------------------------
|
119
|
+
NavigationTest: test_Registers_:prawn_template_handler
|
120
|
+
------------------------------------------------------
|
121
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
122
|
+
[1m[35m (0.7ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
123
|
+
[1m[35m (0.0ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
124
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
134
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
144
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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 (
|
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.
|
56
|
-
ReportsMailer#send_report: processed outbound mail in
|
57
|
-
[1m[
|
58
|
-
[1m[
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
[1m[
|
63
|
-
[1m[
|
64
|
-
----------------------------------------------
|
65
|
-
PrawnRailsTest: test_text_can_take_non_strings
|
66
|
-
----------------------------------------------
|
67
|
-
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
68
|
-
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
151
|
+
Rendered reports_mailer/send_report.html.erb (Duration: 0.2ms | Allocations: 79)
|
152
|
+
ReportsMailer#send_report: processed outbound mail in 22.2ms
|
153
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
154
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
155
|
+
------------------------------------------------------
|
156
|
+
NavigationTest: test_Registers_:prawn_template_handler
|
157
|
+
------------------------------------------------------
|
158
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
159
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
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 (
|
76
|
-
Completed 200 OK in
|
77
|
-
[1m[
|
78
|
-
[1m[
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
169
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
179
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
180
|
+
---------------------------------------------
|
181
|
+
NavigationTest: test_Registers_:pdf_mime_type
|
182
|
+
---------------------------------------------
|
183
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
184
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
194
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
204
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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 (
|
84
|
-
[1m[
|
85
|
-
[1m[
|
209
|
+
Rendered reports/sample.pdf.prawn (Duration: 39.5ms | Allocations: 12636)
|
210
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
211
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
221
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
233
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
234
|
+
----------------------------------------------
|
235
|
+
PrawnRailsTest: test_text_can_take_non_strings
|
236
|
+
----------------------------------------------
|
237
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
238
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
239
|
+
--------------------------------------------------------------
|
240
|
+
PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
|
241
|
+
--------------------------------------------------------------
|
242
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
243
|
+
[1m[35m (1.2ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
244
|
+
[1m[35m (0.0ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
245
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
246
|
+
--------------------------------------------------------------
|
247
|
+
PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
|
248
|
+
--------------------------------------------------------------
|
249
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
250
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
251
|
+
----------------------------------------------
|
252
|
+
PrawnRailsTest: test_text_can_take_non_strings
|
253
|
+
----------------------------------------------
|
254
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
255
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
265
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
275
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
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 (
|
93
|
-
Completed 200 OK in
|
94
|
-
[1m[
|
95
|
-
[1m[
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
285
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
286
|
+
------------------------------------------------------
|
287
|
+
NavigationTest: test_Registers_:prawn_template_handler
|
288
|
+
------------------------------------------------------
|
289
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
290
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
300
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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 (
|
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 (
|
103
|
-
ReportsMailer#send_report: processed outbound mail in
|
104
|
-
[1m[
|
105
|
-
[1m[
|
106
|
-
|
107
|
-
NavigationTest:
|
108
|
-
|
109
|
-
|
110
|
-
|
307
|
+
Rendered reports_mailer/send_report.html.erb (Duration: 0.5ms | Allocations: 80)
|
308
|
+
ReportsMailer#send_report: processed outbound mail in 19.3ms
|
309
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
310
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
317
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
327
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
337
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
111
338
|
----------------------------------------
|
112
339
|
NavigationTest: test_Renders_html_action
|
113
340
|
----------------------------------------
|
114
|
-
Started GET "/reports/sample" for 127.0.0.1 at
|
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.
|
118
|
-
|
119
|
-
|
120
|
-
[1m[
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
349
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
359
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
121
360
|
---------------------------------------------
|
122
361
|
NavigationTest: test_Registers_:pdf_mime_type
|
123
362
|
---------------------------------------------
|
124
|
-
[1m[
|
363
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
364
|
+
[1m[35m (1.3ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
365
|
+
[1m[35m (0.0ms)[0m [1m[34mSELECT sqlite_version(*)[0m
|
366
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
367
|
+
--------------------------------------------------------------
|
368
|
+
PrawnRailsTest: test_matches_.PDF_extension_regardless_of_case
|
369
|
+
--------------------------------------------------------------
|
370
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
371
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
372
|
+
----------------------------------------------
|
373
|
+
PrawnRailsTest: test_text_can_take_non_strings
|
374
|
+
----------------------------------------------
|
375
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
376
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
383
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
393
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
403
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
413
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
423
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
433
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
443
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
444
|
+
---------------------------------------------
|
445
|
+
NavigationTest: test_Registers_:pdf_mime_type
|
446
|
+
---------------------------------------------
|
447
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
448
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|
460
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
470
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
471
|
+
------------------------------------------------------
|
472
|
+
NavigationTest: test_Registers_:prawn_template_handler
|
473
|
+
------------------------------------------------------
|
474
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[31mrollback transaction[0m
|
475
|
+
[1m[36mTRANSACTION (0.0ms)[0m [1m[36mbegin transaction[0m
|
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
|
+
[1m[36mTRANSACTION (0.1ms)[0m [1m[31mrollback transaction[0m
|