prawn-rails 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -1
  3. data/README.md +16 -2
  4. data/Rakefile +0 -0
  5. data/lib/prawn-rails/config.rb +27 -9
  6. data/lib/prawn-rails/document.rb +5 -19
  7. data/lib/prawn-rails/rails_helper.rb +7 -11
  8. data/lib/prawn-rails/version.rb +1 -1
  9. data/lib/prawn-rails.rb +12 -8
  10. metadata +17 -157
  11. data/test/dummy_app/Rakefile +0 -7
  12. data/test/dummy_app/app/assets/config/manifest.js +0 -3
  13. data/test/dummy_app/app/assets/javascripts/application.js +0 -0
  14. data/test/dummy_app/app/assets/stylesheets/application.css +0 -3
  15. data/test/dummy_app/app/controllers/application_controller.rb +0 -3
  16. data/test/dummy_app/app/controllers/reports_controller.rb +0 -37
  17. data/test/dummy_app/app/mailers/reports_mailer.rb +0 -18
  18. data/test/dummy_app/app/views/layouts/application.html.erb +0 -14
  19. data/test/dummy_app/app/views/reports/custom.pdf.prawn +0 -3
  20. data/test/dummy_app/app/views/reports/custom_disposition.pdf.prawn +0 -3
  21. data/test/dummy_app/app/views/reports/custom_filename.pdf.prawn +0 -3
  22. data/test/dummy_app/app/views/reports/sample.html.erb +0 -1
  23. data/test/dummy_app/app/views/reports/sample.pdf.prawn +0 -40
  24. data/test/dummy_app/app/views/reports/table.pdf.prawn +0 -7
  25. data/test/dummy_app/app/views/reports_mailer/send_report.html.erb +0 -1
  26. data/test/dummy_app/config/application.rb +0 -52
  27. data/test/dummy_app/config/boot.rb +0 -10
  28. data/test/dummy_app/config/database.yml +0 -25
  29. data/test/dummy_app/config/environment.rb +0 -5
  30. data/test/dummy_app/config/environments/development.rb +0 -30
  31. data/test/dummy_app/config/environments/production.rb +0 -60
  32. data/test/dummy_app/config/environments/test.rb +0 -41
  33. data/test/dummy_app/config/initializers/backtrace_silencers.rb +0 -7
  34. data/test/dummy_app/config/initializers/inflections.rb +0 -10
  35. data/test/dummy_app/config/initializers/mime_types.rb +0 -5
  36. data/test/dummy_app/config/initializers/prawn-rails.rb +0 -5
  37. data/test/dummy_app/config/initializers/secret_token.rb +0 -11
  38. data/test/dummy_app/config/initializers/session_store.rb +0 -8
  39. data/test/dummy_app/config/initializers/wrap_parameters.rb +0 -14
  40. data/test/dummy_app/config/locales/en.yml +0 -5
  41. data/test/dummy_app/config/routes.rb +0 -9
  42. data/test/dummy_app/config/secrets.yml +0 -22
  43. data/test/dummy_app/config.ru +0 -4
  44. data/test/dummy_app/db/schema.rb +0 -15
  45. data/test/dummy_app/db/test.sqlite3 +0 -0
  46. data/test/dummy_app/log/test.log +0 -484
  47. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/0o/0og-K-ORl6wO02dgU3z8beSXSGOCdnEFcX6KEtXqG2Q.cache +0 -1
  48. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/2V/2VONmeO4ClBgY1gjdZLYo9wQjDG9Ef9sAuwWVxceLEk.cache +0 -1
  49. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/34/34uQaon4nFa_kXcNF-1ac-QhL_HKtstSnb2pGjYCb6w.cache +0 -1
  50. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +0 -2
  51. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/43/43Xh_xLNBt5kEi4-pWc5m0pFDLIhkNAxyiBf-3E2UJw.cache +0 -1
  52. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache +0 -2
  53. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8x/8x5zY49XOU4gtdILE9T8l00lhs-lUJ6zzl5hyxjaFzw.cache +0 -0
  54. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/AT/ATEwOxnm0kBLQ6bdeFkXutl92AMg1dA40zmBqy2f2Ng.cache +0 -0
  55. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ag/AgeZ6zQVNy2sDfEUqjxoVLoCsGo6rA27SUQoJFjqCqY.cache +0 -1
  56. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Dj/DjIeso8fWA-cG6Y9zSr3T0rPtpS6V73u3Q234QgSLa8.cache +0 -1
  57. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache +0 -2
  58. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/E_/E_ZbvXNGsLYdwZdD1F159gQCYVGJrWgaip0GlUx9B68.cache +0 -1
  59. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache +0 -3
  60. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Lk/LkuzadDEF5r9a_QBFvWJ5krc5aerVbxs4zJ19iztB38.cache +0 -0
  61. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +0 -3
  62. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Uc/UcQ6dMoNX10N68Sv8qxPf7kahPOJ5pqzYWkbjDKyF1k.cache +0 -1
  63. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cp/cp36yIX2yPJBfhw6EA0u-BWnvFazmGC8zKxglna59TI.cache +0 -1
  64. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dt/dteXKuRtjT5JiLleDPqnTNJFalNEbck9vA19hE6rGyw.cache +0 -1
  65. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/hy/hyxqCkBWzkpfHLCqW3YJeQq93KRADVcxEEMz0o0We_w.cache +0 -0
  66. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/k6/k6DfQWIBNnOJUNVvE59mXcoCzMB9D6i0p1WuJZGANoQ.cache +0 -1
  67. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/kR/kRjL0yRqyeZXZk93BSxxJULpCv-rJ3QvC23X4W94RNA.cache +0 -0
  68. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache +0 -2
  69. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vt/vtslB-h9sglaV55iVgO8l86UBTtzDnuA6qzCy-vzujk.cache +0 -0
  70. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/xD/xDLUWV68gWaS7IJWKWBAPzLcA0ALSjQHns0tsk0zY3s.cache +0 -0
  71. data/test/integration/prawn_rails_test.rb +0 -105
  72. data/test/prawn_rails_test.rb +0 -28
  73. data/test/test_helper.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ac0f78d8a8a1a3b0a4ed9fc10663d2932deb2297adba3b95ba6572de2218148
4
- data.tar.gz: e5ca3d10154db2cd49d0408248a19c4501ad4f95001ad9e6ba4295a2baaede6e
3
+ metadata.gz: '038a7bc1fd0cf46c805b37358ca5f43f97ea61bd3a9bb2a5f57c93b063735faf'
4
+ data.tar.gz: 44842dfeddbb4e8c525767bd2838ab732d92d350aed9e9d8b8d44c0af14e26d6
5
5
  SHA512:
6
- metadata.gz: dbdbf5da9ca6bab323d9a5c6a2efaad5eed7c9506f1e5953986b1f885c93fbc75a1854ba09b52de2c86dd379b2b39a42389e81f48a9123c200de5d65e36d00e6
7
- data.tar.gz: 5ff405b51522c7c906e62d3fbc8eaa95ae51a595de245cb1a2cde692fbba85cc2c9e62075a38d2828c06f98b5c67ab0e811f99d8dac6713ecff125e30a0046b7
6
+ metadata.gz: 32c30aa630ddba6fb25c4e92520f2a61ed99ac43159729b4064bddbe56ae74e04b18d8823a58020a37f897b3fa281ae049add79ad7e5caf39ad8ed471ba6a289
7
+ data.tar.gz: 16909da459d44bedbe4466c42b6ee080231d7a714f2268227a58e64cb825de1f0dfd5dcc4b9f836839b4520b5e3ae6e2b2463c465ddfe2ded71c792d7d5b6376
data/CHANGELOG.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # Changelog
2
2
 
3
- * `Unreleased` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.2...master)
3
+ * `Unreleased` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.5.0...master)
4
4
  - Nothing yet
5
5
 
6
+ * `v1.5.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.2...v1.5.0)
7
+ - [#52](https://github.com/cortiz/prawn-rails/pull/52) - Add active_support as a dependency and use the active_support lazy load hooks
8
+ - [#51](https://github.com/cortiz/prawn-rails/pull/51) - Remove usage of openstruct for config object
9
+ - Remove unnecessary method `get_metadata` from `PrawnRailsHelper` which was getting included into `ActionView::Base`
10
+ - Remove unnecessary rescue in `PrawnRails.config`
11
+ - Remove redundant method `PrawnRails::Document.extensions`
12
+
6
13
  * `v1.4.2` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.1...v1.4.2)
7
14
  - Remove dependency on `railsties` and instead only depend on `actionview`
8
15
 
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Prawn-Rails
2
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>
3
+ <a href='https://github.com/cortiz/prawn-rails/actions' target='_blank'><img src="https://github.com/cortiz/prawn-rails/actions/workflows/test.yml/badge.svg?branch=master" 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://img.shields.io/gem/dt/prawn-rails?color=brightgreen&label=Rubygems%20Downloads' border='0' alt='RubyGems Downloads' /></a>
5
5
 
6
6
 
7
7
  # Install
@@ -103,6 +103,7 @@ prawn_document do |pdf|
103
103
  pdf.table @products.collect{|p| [p.name,p.price]}
104
104
  end
105
105
  ```
106
+
106
107
  #### Using Custom options
107
108
 
108
109
  ```ruby
@@ -113,6 +114,19 @@ prawn_document(page_layout: :landscape) do |pdf|
113
114
  end
114
115
  ```
115
116
 
117
+ #### Without using the prawn_document helper
118
+
119
+ ```ruby
120
+ doc = PrawnRails::Document.new(page_layout: :landscape)
121
+
122
+ doc.text "Page 1"
123
+ doc.start_new_page
124
+ doc.text "Page 2"
125
+
126
+ pdf_str = doc.render
127
+ ```
128
+
129
+
116
130
  # Credits
117
131
 
118
132
  Maintained by Weston Ganger - @westonganger
data/Rakefile CHANGED
File without changes
@@ -1,17 +1,35 @@
1
- require 'ostruct'
1
+ require "active_support/hash_with_indifferent_access"
2
2
 
3
3
  module PrawnRails
4
- extend self
4
+ class Config < HashWithIndifferentAccess
5
+ def method_missing(method_name, *args)
6
+ # to replace behaviour of previous openstruct-based configuration object
5
7
 
6
- @config = OpenStruct.new(page_layout: :portrait, page_size: "A4", skip_page_creation: false)
8
+ if method_name.to_s.end_with?("=")
9
+ if args.size >= 2
10
+ super # raise normal exception
11
+ end
7
12
 
8
- def config
9
- begin
10
- block_given? ? yield(@config) : @config
11
- rescue => e
12
- puts e
13
- puts e.backtrace
13
+ key = method_name.to_s.sub(/=$/, "")
14
+ self[key] = args.first
15
+ else
16
+ if args.any?
17
+ super # raise normal exception
18
+ else
19
+ self[method_name]
20
+ end
21
+ end
14
22
  end
15
23
  end
16
24
 
25
+ @config = Config.new.merge(
26
+ page_layout: :portrait,
27
+ page_size: "A4",
28
+ skip_page_creation: false,
29
+ )
30
+
31
+ def config(&block)
32
+ block_given? ? yield(@config) : @config
33
+ end
34
+ module_function :config
17
35
  end
@@ -2,33 +2,19 @@ require 'prawn'
2
2
  require 'prawn/table'
3
3
 
4
4
  module PrawnRails
5
-
6
- # This derives from Prawn::Document in order to override defaults.
7
- # Note that the Prawn::Document behaviour itself shouldn't be changed.
8
5
  class Document < Prawn::Document
9
- def self.extensions
10
- Prawn::Document.extensions
11
- end
12
-
13
6
  def initialize(options = {})
14
- if PrawnRails.config.respond_to?(:to_h)
15
- options.reverse_merge!(PrawnRails.config.to_h)
16
- else
17
- options.reverse_merge!(PrawnRails.config.marshal_dump)
18
- end
7
+ options = PrawnRails.config.merge(options)
19
8
 
20
9
  super(options)
21
10
  end
22
11
 
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:
24
- #
25
- # pdf.text 10 #=> fails because 10 is not a string
26
- # pdf.text 10.to_s #=> works
27
- #
28
- # To circumvent this situation, we call to_s on value, and delegate action to actual Prawn::Document.
29
12
  def text(value, options = {})
13
+ # 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:
14
+ # pdf.text 10 #=> fails because 10 is not a string
15
+ # pdf.text 10.to_s #=> works
16
+ # To circumvent this situation, we call to_s on value, and delegate action to actual Prawn::Document
30
17
  super(value.to_s, options)
31
18
  end
32
19
  end
33
-
34
20
  end
@@ -6,7 +6,13 @@ module PrawnRails
6
6
  def prawn_document(options={})
7
7
  @filename ||= options[:filename]
8
8
 
9
- options.reverse_merge!(get_metadata)
9
+ metadata = {}
10
+
11
+ if @filename
12
+ metadata[:info] = { Title: @filename.sub(/\.pdf$/i, '') }
13
+ end
14
+
15
+ options.reverse_merge!(metadata)
10
16
 
11
17
  pdf = PrawnRails::Document.new(options)
12
18
 
@@ -24,15 +30,5 @@ module PrawnRails
24
30
  return pdf.render
25
31
  end
26
32
 
27
- def get_metadata
28
- return {} unless @filename
29
-
30
- {
31
- info: {
32
- Title: @filename.sub(/\.pdf$/i, '')
33
- }
34
- }
35
- end
36
-
37
33
  end
38
34
  end
@@ -1,3 +1,3 @@
1
1
  module PrawnRails
2
- VERSION = "1.4.2"
2
+ VERSION = "1.5.0".freeze
3
3
  end
data/lib/prawn-rails.rb CHANGED
@@ -3,15 +3,19 @@ require "prawn"
3
3
  require "prawn-rails/version"
4
4
  require "prawn-rails/config"
5
5
 
6
- require "prawn-rails/rails_helper"
7
- require "prawn-rails/renderer"
6
+ require 'active_support/lazy_load_hooks'
8
7
 
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)
8
+ module PrawnRails
14
9
  end
15
10
 
16
- module PrawnRails
11
+ ActiveSupport.on_load(:action_view) do
12
+ unless Mime::Type.lookup_by_extension(:pdf)
13
+ Mime::Type.register_alias("application/pdf", :pdf)
14
+ end
15
+
16
+ require "prawn-rails/rails_helper"
17
+ require "prawn-rails/renderer"
18
+
19
+ ActionView::Base.send(:include, PrawnRails::RailsHelper)
20
+ ActionView::Template.register_template_handler(:prawn, PrawnRails::Renderer)
17
21
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Ortiz
8
8
  - Weston Ganger
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-27 00:00:00.000000000 Z
12
+ date: 2024-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: prawn
@@ -54,35 +54,21 @@ dependencies:
54
54
  - !ruby/object:Gem::Version
55
55
  version: 3.1.0
56
56
  - !ruby/object:Gem::Dependency
57
- name: pdf-reader
57
+ name: activesupport
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: '0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- - !ruby/object:Gem::Dependency
71
- name: rake
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :development
62
+ version: 3.1.0
63
+ type: :runtime
78
64
  prerelease: false
79
65
  version_requirements: !ruby/object:Gem::Requirement
80
66
  requirements:
81
67
  - - ">="
82
68
  - !ruby/object:Gem::Version
83
- version: '0'
69
+ version: 3.1.0
84
70
  - !ruby/object:Gem::Dependency
85
- name: minitest
71
+ name: pdf-reader
86
72
  requirement: !ruby/object:Gem::Requirement
87
73
  requirements:
88
74
  - - ">="
@@ -96,7 +82,7 @@ dependencies:
96
82
  - !ruby/object:Gem::Version
97
83
  version: '0'
98
84
  - !ruby/object:Gem::Dependency
99
- name: bundler
85
+ name: rake
100
86
  requirement: !ruby/object:Gem::Requirement
101
87
  requirements:
102
88
  - - ">="
@@ -110,7 +96,7 @@ dependencies:
110
96
  - !ruby/object:Gem::Version
111
97
  version: '0'
112
98
  - !ruby/object:Gem::Dependency
113
- name: rails
99
+ name: minitest
114
100
  requirement: !ruby/object:Gem::Requirement
115
101
  requirements:
116
102
  - - ">="
@@ -124,7 +110,7 @@ dependencies:
124
110
  - !ruby/object:Gem::Version
125
111
  version: '0'
126
112
  - !ruby/object:Gem::Dependency
127
- name: sqlite3
113
+ name: pry
128
114
  requirement: !ruby/object:Gem::Requirement
129
115
  requirements:
130
116
  - - ">="
@@ -138,7 +124,7 @@ dependencies:
138
124
  - !ruby/object:Gem::Version
139
125
  version: '0'
140
126
  - !ruby/object:Gem::Dependency
141
- name: appraisal
127
+ name: warning
142
128
  requirement: !ruby/object:Gem::Requirement
143
129
  requirements:
144
130
  - - ">="
@@ -152,7 +138,7 @@ dependencies:
152
138
  - !ruby/object:Gem::Version
153
139
  version: '0'
154
140
  - !ruby/object:Gem::Dependency
155
- name: warning
141
+ name: matrix
156
142
  requirement: !ruby/object:Gem::Requirement
157
143
  requirements:
158
144
  - - ">="
@@ -181,74 +167,11 @@ files:
181
167
  - lib/prawn-rails/rails_helper.rb
182
168
  - lib/prawn-rails/renderer.rb
183
169
  - lib/prawn-rails/version.rb
184
- - test/dummy_app/Rakefile
185
- - test/dummy_app/app/assets/config/manifest.js
186
- - test/dummy_app/app/assets/javascripts/application.js
187
- - test/dummy_app/app/assets/stylesheets/application.css
188
- - test/dummy_app/app/controllers/application_controller.rb
189
- - test/dummy_app/app/controllers/reports_controller.rb
190
- - test/dummy_app/app/mailers/reports_mailer.rb
191
- - test/dummy_app/app/views/layouts/application.html.erb
192
- - test/dummy_app/app/views/reports/custom.pdf.prawn
193
- - test/dummy_app/app/views/reports/custom_disposition.pdf.prawn
194
- - test/dummy_app/app/views/reports/custom_filename.pdf.prawn
195
- - test/dummy_app/app/views/reports/sample.html.erb
196
- - test/dummy_app/app/views/reports/sample.pdf.prawn
197
- - test/dummy_app/app/views/reports/table.pdf.prawn
198
- - test/dummy_app/app/views/reports_mailer/send_report.html.erb
199
- - test/dummy_app/config.ru
200
- - test/dummy_app/config/application.rb
201
- - test/dummy_app/config/boot.rb
202
- - test/dummy_app/config/database.yml
203
- - test/dummy_app/config/environment.rb
204
- - test/dummy_app/config/environments/development.rb
205
- - test/dummy_app/config/environments/production.rb
206
- - test/dummy_app/config/environments/test.rb
207
- - test/dummy_app/config/initializers/backtrace_silencers.rb
208
- - test/dummy_app/config/initializers/inflections.rb
209
- - test/dummy_app/config/initializers/mime_types.rb
210
- - test/dummy_app/config/initializers/prawn-rails.rb
211
- - test/dummy_app/config/initializers/secret_token.rb
212
- - test/dummy_app/config/initializers/session_store.rb
213
- - test/dummy_app/config/initializers/wrap_parameters.rb
214
- - test/dummy_app/config/locales/en.yml
215
- - test/dummy_app/config/routes.rb
216
- - test/dummy_app/config/secrets.yml
217
- - test/dummy_app/db/schema.rb
218
- - test/dummy_app/db/test.sqlite3
219
- - test/dummy_app/log/test.log
220
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/0o/0og-K-ORl6wO02dgU3z8beSXSGOCdnEFcX6KEtXqG2Q.cache
221
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/2V/2VONmeO4ClBgY1gjdZLYo9wQjDG9Ef9sAuwWVxceLEk.cache
222
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/34/34uQaon4nFa_kXcNF-1ac-QhL_HKtstSnb2pGjYCb6w.cache
223
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
224
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/43/43Xh_xLNBt5kEi4-pWc5m0pFDLIhkNAxyiBf-3E2UJw.cache
225
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
226
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8x/8x5zY49XOU4gtdILE9T8l00lhs-lUJ6zzl5hyxjaFzw.cache
227
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/AT/ATEwOxnm0kBLQ6bdeFkXutl92AMg1dA40zmBqy2f2Ng.cache
228
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ag/AgeZ6zQVNy2sDfEUqjxoVLoCsGo6rA27SUQoJFjqCqY.cache
229
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Dj/DjIeso8fWA-cG6Y9zSr3T0rPtpS6V73u3Q234QgSLa8.cache
230
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache
231
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/E_/E_ZbvXNGsLYdwZdD1F159gQCYVGJrWgaip0GlUx9B68.cache
232
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
233
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Lk/LkuzadDEF5r9a_QBFvWJ5krc5aerVbxs4zJ19iztB38.cache
234
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
235
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Uc/UcQ6dMoNX10N68Sv8qxPf7kahPOJ5pqzYWkbjDKyF1k.cache
236
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cp/cp36yIX2yPJBfhw6EA0u-BWnvFazmGC8zKxglna59TI.cache
237
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dt/dteXKuRtjT5JiLleDPqnTNJFalNEbck9vA19hE6rGyw.cache
238
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/hy/hyxqCkBWzkpfHLCqW3YJeQq93KRADVcxEEMz0o0We_w.cache
239
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/k6/k6DfQWIBNnOJUNVvE59mXcoCzMB9D6i0p1WuJZGANoQ.cache
240
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/kR/kRjL0yRqyeZXZk93BSxxJULpCv-rJ3QvC23X4W94RNA.cache
241
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache
242
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vt/vtslB-h9sglaV55iVgO8l86UBTtzDnuA6qzCy-vzujk.cache
243
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/xD/xDLUWV68gWaS7IJWKWBAPzLcA0ALSjQHns0tsk0zY3s.cache
244
- - test/integration/prawn_rails_test.rb
245
- - test/prawn_rails_test.rb
246
- - test/test_helper.rb
247
170
  homepage: https://github.com/cortiz/prawn-rails
248
171
  licenses:
249
172
  - MIT
250
173
  metadata: {}
251
- post_install_message:
174
+ post_install_message:
252
175
  rdoc_options: []
253
176
  require_paths:
254
177
  - lib
@@ -263,71 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
186
  - !ruby/object:Gem::Version
264
187
  version: '0'
265
188
  requirements: []
266
- rubygems_version: 3.1.4
267
- signing_key:
189
+ rubygems_version: 3.4.22
190
+ signing_key:
268
191
  specification_version: 4
269
192
  summary: Prawn Handler for Rails
270
- test_files:
271
- - test/integration/prawn_rails_test.rb
272
- - test/prawn_rails_test.rb
273
- - test/test_helper.rb
274
- - test/dummy_app/app/mailers/reports_mailer.rb
275
- - test/dummy_app/app/controllers/application_controller.rb
276
- - test/dummy_app/app/controllers/reports_controller.rb
277
- - test/dummy_app/app/views/reports_mailer/send_report.html.erb
278
- - test/dummy_app/app/views/layouts/application.html.erb
279
- - test/dummy_app/app/views/reports/custom_filename.pdf.prawn
280
- - test/dummy_app/app/views/reports/custom_disposition.pdf.prawn
281
- - test/dummy_app/app/views/reports/custom.pdf.prawn
282
- - test/dummy_app/app/views/reports/sample.pdf.prawn
283
- - test/dummy_app/app/views/reports/table.pdf.prawn
284
- - test/dummy_app/app/views/reports/sample.html.erb
285
- - test/dummy_app/app/assets/config/manifest.js
286
- - test/dummy_app/app/assets/javascripts/application.js
287
- - test/dummy_app/app/assets/stylesheets/application.css
288
- - test/dummy_app/config/secrets.yml
289
- - test/dummy_app/config/routes.rb
290
- - test/dummy_app/config/locales/en.yml
291
- - test/dummy_app/config/environments/production.rb
292
- - test/dummy_app/config/environments/development.rb
293
- - test/dummy_app/config/environments/test.rb
294
- - test/dummy_app/config/environment.rb
295
- - test/dummy_app/config/application.rb
296
- - test/dummy_app/config/database.yml
297
- - test/dummy_app/config/boot.rb
298
- - test/dummy_app/config/initializers/backtrace_silencers.rb
299
- - test/dummy_app/config/initializers/mime_types.rb
300
- - test/dummy_app/config/initializers/session_store.rb
301
- - test/dummy_app/config/initializers/wrap_parameters.rb
302
- - test/dummy_app/config/initializers/prawn-rails.rb
303
- - test/dummy_app/config/initializers/secret_token.rb
304
- - test/dummy_app/config/initializers/inflections.rb
305
- - test/dummy_app/config.ru
306
- - test/dummy_app/Rakefile
307
- - test/dummy_app/db/schema.rb
308
- - test/dummy_app/db/test.sqlite3
309
- - test/dummy_app/log/test.log
310
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vt/vtslB-h9sglaV55iVgO8l86UBTtzDnuA6qzCy-vzujk.cache
311
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache
312
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/34/34uQaon4nFa_kXcNF-1ac-QhL_HKtstSnb2pGjYCb6w.cache
313
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/hy/hyxqCkBWzkpfHLCqW3YJeQq93KRADVcxEEMz0o0We_w.cache
314
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache
315
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dt/dteXKuRtjT5JiLleDPqnTNJFalNEbck9vA19hE6rGyw.cache
316
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Lk/LkuzadDEF5r9a_QBFvWJ5krc5aerVbxs4zJ19iztB38.cache
317
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/43/43Xh_xLNBt5kEi4-pWc5m0pFDLIhkNAxyiBf-3E2UJw.cache
318
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Uc/UcQ6dMoNX10N68Sv8qxPf7kahPOJ5pqzYWkbjDKyF1k.cache
319
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/0o/0og-K-ORl6wO02dgU3z8beSXSGOCdnEFcX6KEtXqG2Q.cache
320
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
321
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ag/AgeZ6zQVNy2sDfEUqjxoVLoCsGo6rA27SUQoJFjqCqY.cache
322
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/kR/kRjL0yRqyeZXZk93BSxxJULpCv-rJ3QvC23X4W94RNA.cache
323
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Dj/DjIeso8fWA-cG6Y9zSr3T0rPtpS6V73u3Q234QgSLa8.cache
324
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/k6/k6DfQWIBNnOJUNVvE59mXcoCzMB9D6i0p1WuJZGANoQ.cache
325
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
326
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/AT/ATEwOxnm0kBLQ6bdeFkXutl92AMg1dA40zmBqy2f2Ng.cache
327
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/E_/E_ZbvXNGsLYdwZdD1F159gQCYVGJrWgaip0GlUx9B68.cache
328
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
329
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cp/cp36yIX2yPJBfhw6EA0u-BWnvFazmGC8zKxglna59TI.cache
330
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8x/8x5zY49XOU4gtdILE9T8l00lhs-lUJ6zzl5hyxjaFzw.cache
331
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/2V/2VONmeO4ClBgY1gjdZLYo9wQjDG9Ef9sAuwWVxceLEk.cache
332
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
333
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/xD/xDLUWV68gWaS7IJWKWBAPzLcA0ALSjQHns0tsk0zY3s.cache
193
+ test_files: []
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Dummy::Application.load_tasks
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css
File without changes
@@ -1,3 +0,0 @@
1
- /*
2
- *= require_self
3
- */
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,37 +0,0 @@
1
- class ReportsController < ApplicationController
2
-
3
- def sample
4
- @items = [
5
- {name: "Hello"},
6
- {name: "World"},
7
- ]
8
- end
9
-
10
- def table
11
- @items = [
12
- [1,2,3],
13
- [4,5,6],
14
- [7,8,9],
15
- ]
16
- end
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
-
37
- end
@@ -1,18 +0,0 @@
1
- class ReportsMailer < ActionMailer::Base
2
- def send_report
3
- @items = [
4
- {name: "Hello"},
5
- {name: "World"},
6
- ]
7
-
8
- attachments["report.pdf"] = {
9
- mime_type: "application/pdf",
10
- content: render_to_string("reports/sample", formats: [:pdf]),
11
- }
12
-
13
- mail({
14
- to: "user@example.com",
15
- subject: "Reports",
16
- })
17
- end
18
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy App</title>
5
- <%= stylesheet_link_tag "application" %>
6
- <%= javascript_include_tag "application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,3 +0,0 @@
1
- prawn_document(filename: "from-options.pdf", disposition: "attachment") do |pdf|
2
- pdf.text "Hello World!"
3
- end
@@ -1,3 +0,0 @@
1
- prawn_document(disposition: "attachment") do |pdf|
2
- pdf.text "Hello World!"
3
- end
@@ -1,3 +0,0 @@
1
- prawn_document(filename: "from-options.pdf") do |pdf|
2
- pdf.text "Hello World!"
3
- end
@@ -1 +0,0 @@
1
- <h1>Hello World!</h1>
@@ -1,40 +0,0 @@
1
- prawn_document(page_layout: :portrait) do |pdf|
2
- pdf.text "Hello World!"
3
- pdf.text "now it is here: #{pdf.cursor}"
4
- pdf.text "Number of Items: #{@items.count}"
5
-
6
- pdf.font("Courier") do
7
- pdf.text "Written in Courier because we are inside the block."
8
- end
9
-
10
- pdf.text "with html<bold></bold>"
11
- pdf.text strip_tags("without html <bold>LD</bold>")
12
-
13
- pdf.text "Let's see which is the current font_size: #{pdf.font_size.inspect}"
14
- pdf.move_down 10
15
- pdf.font_size 16
16
- pdf.text "Yeah, something bigger!"
17
- pdf.move_down 10
18
- pdf.font_size(25) { pdf.text "Even bigger!" }
19
- pdf.move_down 10
20
- pdf.text "Back to 16 again."
21
- pdf.move_down 10
22
- pdf.text "Single line on 20 using the :size option.", size: 20
23
- pdf.move_down 10
24
- pdf.text "Back to 16 once more."
25
- pdf.move_down 10
26
-
27
- pdf.font("Courier", size: 10) do
28
- pdf.text "Yeah, using Courier 10 courtesy of the font method."
29
- end
30
-
31
- pdf.font("Helvetica", size: 12) # back to normal
32
-
33
- pdf.text "Default color is black"
34
- pdf.move_down 25
35
- pdf.text "Changed to red", color: "FF0000"
36
- pdf.move_down 25
37
- pdf.text "CMYK color", color: [22, 55, 79, 30]
38
- pdf.move_down 25
39
- pdf.text "Also works with <color rgb='ff0000'>inline</color> formatting", color: "0000FF", inline_format: true
40
- end
@@ -1,7 +0,0 @@
1
- prawn_document(page_layout: :portrait) do |pdf|
2
-
3
- pdf.table @items do
4
-
5
- end
6
-
7
- end