prawn-rails 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +6 -1
  3. data/lib/prawn-rails/document.rb +5 -1
  4. data/lib/prawn-rails/renderer.rb +1 -1
  5. data/lib/prawn-rails/version.rb +1 -1
  6. data/test/dummy_app/app/mailers/reports_mailer.rb +18 -0
  7. data/test/dummy_app/app/views/reports_mailer/send_report.html.erb +1 -0
  8. data/test/dummy_app/config/application.rb +0 -4
  9. data/test/dummy_app/log/test.log +53 -2850
  10. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/-T/-Ty2Lif1RQ31LfQ3sdBLOYNu3fwjefNQWZXg61o7S0Q.cache +1 -0
  11. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/{VK/VKv8TUCURhWXKU5qrG7ocs75FsysCWNtswhqtTi7Lfw.cache → -m/-mGgwBQ39pkjNoHzuM7XVbFYsHOyv_6SOM_CmI-kLnw.cache} +0 -0
  12. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/{S9/S9TmgasHOyBiOSg3OOpu2mzuUwMxxUE3zyKrExqIryQ.cache → 3j/3jV3hjwp5k_C7riQHMv6rtrQUfKwPXzFkJ32sUJuN_E.cache} +0 -0
  13. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/7b/7bJ7ytF6vF1igkdeslMStlJ0FX-qsua3IF_1YPq8oCw.cache +1 -0
  14. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/{QP/QPocswuHM6KXKYd99JclYrybZep_vYHyfZQ-nGJB5uU.cache → Ac/AcCgT9z272BU3f9VmSXyH6aXg0-fBwSzc8apjB9C0T4.cache} +0 -0
  15. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/{kA/kAfbx3YIMg0L2tevtZdwbRjKKy9xOmYlXJ7LapMXDME.cache → EG/EGPvvBJ-Qo0bhB9ro0HZH9s4Ln-PNqgz-uYTi5tV_88.cache} +0 -0
  16. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/{rT/rTYHFXiH_g6ZVTgNXdVrDz3fihYKq9Diqso1lzP257o.cache → SJ/SJ3C0iDdYBBG_yOrab-Sw62moViXQPI90mwV-VCda_o.cache} +0 -0
  17. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/{E1/E18Q7xE2E1RWvLRrvvBEf0ahfumckOlJWqD7YiPqLAk.cache → ie/ieDr67bZ5kFv-ENcBz8Q7TiuRQETGYgdgzYHyXqVcoI.cache} +0 -0
  18. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/qW/qWT2nJzx5CDYl-mSJ0WXKcYzB6yu_HDoZLsoO5mWh7g.cache +1 -0
  19. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/se/seL12R6emubM_qf0qkqUQp8lYPC0Sv3ALlPVz2lH5OM.cache +1 -0
  20. data/test/integration/prawn_rails_test.rb +14 -0
  21. data/test/prawn_rails_test.rb +15 -3
  22. metadata +49 -46
  23. data/lib/prawn-rails/load_prawn_plugins.rb +0 -11
  24. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/-E/-EGHXi_ULbX3JP7NLAsVLUrIZgOg0HxdFnvlbmA7DCA.cache +0 -1
  25. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/Bl/BlRucSL6BNAMZvHs4UVilikqNOKnbCHSGHIQRgtKvFQ.cache +0 -1
  26. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/dZ/dZLyjSvZKmLRvanBa3SmJ58gtb_fQaHMzS1A04p2x_4.cache +0 -1
  27. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/mn/mnaHTtsBvdmAbdqsorI0KqFoT2eQIhgDVER_He3q2HU.cache +0 -1
@@ -0,0 +1 @@
1
+ I"�app/assets/javascripts/application.js?type=application/javascript&id=cb3b727b4096110dd5e8049526d219e5c85df923272026571e5b5ed1e223a86f:ET
@@ -0,0 +1 @@
1
+ I"�app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=96ba9dc308e6dfde737ea84d13c263f9b5937647e23b63e472144dafd52010cb:ET
@@ -0,0 +1 @@
1
+ I"�app/assets/stylesheets/application.css?type=text/css&pipeline=self&id=25b676af84f7cd240d4c80f3db016cee345a44e4d0068c66fefd9ce02c93e345:ET
@@ -0,0 +1 @@
1
+ I"}app/assets/stylesheets/application.css?type=text/css&id=cf9c582bdcb56262355ef6970cbffcece431a36641349c5001d510fd84d74906:ET
@@ -61,4 +61,18 @@ class NavigationTest < ActionDispatch::IntegrationTest
61
61
 
62
62
  assert_equal(page_str, "1 2 3\n\n4 5 6\n\n7 8 9")
63
63
  end
64
+
65
+ test "render_to_string in mailer" do
66
+ mail = ReportsMailer.send_report
67
+ assert_equal(1, mail.attachments.size)
68
+
69
+ reader = PDF::Reader.new(StringIO.new(mail.attachments["report.pdf"].body.raw_source))
70
+ assert_not_nil(reader)
71
+ assert_equal(1, reader.page_count)
72
+
73
+ page_str = reader.pages[0].to_s
74
+
75
+ assert page_str.include?('Hello World!')
76
+ assert_not page_str.include?("<h1>Hello World!</h1>")
77
+ end
64
78
  end
@@ -1,11 +1,23 @@
1
1
  ### FOR GENERIC NON-RAILS TESTS
2
2
 
3
3
  require 'test_helper'
4
+ require 'pdf/reader'
4
5
 
5
6
  class PrawnRailsTest < ActiveSupport::TestCase
7
+ include PrawnRails::RailsHelper
6
8
 
7
- test "config" do
8
- assert true
9
- end
9
+ test "text can take non strings" do
10
+ @filename = ""
11
+
12
+ output = prawn_document do |pdf|
13
+ pdf.text "Number:"
14
+ pdf.text 10
15
+ end
10
16
 
17
+ reader = PDF::Reader.new(StringIO.new(output))
18
+ assert_not_nil(reader)
19
+
20
+ page = reader.page(1).to_s
21
+ assert page.include?("Number:\n10")
22
+ end
11
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Ortiz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-06-13 00:00:00.000000000 Z
12
+ date: 2018-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: prawn
@@ -137,7 +137,6 @@ files:
137
137
  - lib/prawn-rails/config.rb
138
138
  - lib/prawn-rails/document.rb
139
139
  - lib/prawn-rails/engine.rb
140
- - lib/prawn-rails/load_prawn_plugins.rb
141
140
  - lib/prawn-rails/rails_helper.rb
142
141
  - lib/prawn-rails/renderer.rb
143
142
  - lib/prawn-rails/version.rb
@@ -146,10 +145,12 @@ files:
146
145
  - test/dummy_app/app/assets/stylesheets/application.css
147
146
  - test/dummy_app/app/controllers/application_controller.rb
148
147
  - test/dummy_app/app/controllers/reports_controller.rb
148
+ - test/dummy_app/app/mailers/reports_mailer.rb
149
149
  - test/dummy_app/app/views/layouts/application.html.erb
150
150
  - test/dummy_app/app/views/reports/sample.html.erb
151
151
  - test/dummy_app/app/views/reports/sample.pdf.prawn
152
152
  - test/dummy_app/app/views/reports/table.pdf.prawn
153
+ - test/dummy_app/app/views/reports_mailer/send_report.html.erb
153
154
  - test/dummy_app/config.ru
154
155
  - test/dummy_app/config/application.rb
155
156
  - test/dummy_app/config/boot.rb
@@ -171,20 +172,20 @@ files:
171
172
  - test/dummy_app/db/schema.rb
172
173
  - test/dummy_app/db/test.sqlite3
173
174
  - test/dummy_app/log/test.log
174
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/-E/-EGHXi_ULbX3JP7NLAsVLUrIZgOg0HxdFnvlbmA7DCA.cache
175
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/-T/-Ty2Lif1RQ31LfQ3sdBLOYNu3fwjefNQWZXg61o7S0Q.cache
176
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/-m/-mGgwBQ39pkjNoHzuM7XVbFYsHOyv_6SOM_CmI-kLnw.cache
175
177
  - test/dummy_app/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
178
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/3j/3jV3hjwp5k_C7riQHMv6rtrQUfKwPXzFkJ32sUJuN_E.cache
176
179
  - test/dummy_app/tmp/cache/assets/sprockets/v3.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
177
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Bl/BlRucSL6BNAMZvHs4UVilikqNOKnbCHSGHIQRgtKvFQ.cache
178
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/E1/E18Q7xE2E1RWvLRrvvBEf0ahfumckOlJWqD7YiPqLAk.cache
180
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/7b/7bJ7ytF6vF1igkdeslMStlJ0FX-qsua3IF_1YPq8oCw.cache
181
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Ac/AcCgT9z272BU3f9VmSXyH6aXg0-fBwSzc8apjB9C0T4.cache
182
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/EG/EGPvvBJ-Qo0bhB9ro0HZH9s4Ln-PNqgz-uYTi5tV_88.cache
179
183
  - test/dummy_app/tmp/cache/assets/sprockets/v3.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
180
184
  - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
181
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/QP/QPocswuHM6KXKYd99JclYrybZep_vYHyfZQ-nGJB5uU.cache
182
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/S9/S9TmgasHOyBiOSg3OOpu2mzuUwMxxUE3zyKrExqIryQ.cache
183
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/VK/VKv8TUCURhWXKU5qrG7ocs75FsysCWNtswhqtTi7Lfw.cache
184
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/dZ/dZLyjSvZKmLRvanBa3SmJ58gtb_fQaHMzS1A04p2x_4.cache
185
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/kA/kAfbx3YIMg0L2tevtZdwbRjKKy9xOmYlXJ7LapMXDME.cache
186
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/mn/mnaHTtsBvdmAbdqsorI0KqFoT2eQIhgDVER_He3q2HU.cache
187
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/rT/rTYHFXiH_g6ZVTgNXdVrDz3fihYKq9Diqso1lzP257o.cache
185
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/SJ/SJ3C0iDdYBBG_yOrab-Sw62moViXQPI90mwV-VCda_o.cache
186
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/ie/ieDr67bZ5kFv-ENcBz8Q7TiuRQETGYgdgzYHyXqVcoI.cache
187
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/qW/qWT2nJzx5CDYl-mSJ0WXKcYzB6yu_HDoZLsoO5mWh7g.cache
188
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/se/seL12R6emubM_qf0qkqUQp8lYPC0Sv3ALlPVz2lH5OM.cache
188
189
  - test/integration/prawn_rails_test.rb
189
190
  - test/prawn_rails_test.rb
190
191
  - test/test_helper.rb
@@ -207,55 +208,57 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
208
  version: '0'
208
209
  requirements: []
209
210
  rubyforge_project:
210
- rubygems_version: 2.6.11
211
+ rubygems_version: 2.7.6
211
212
  signing_key:
212
213
  specification_version: 4
213
214
  summary: Prawn Handler for Rails
214
215
  test_files:
215
- - test/test_helper.rb
216
- - test/prawn_rails_test.rb
217
- - test/integration/prawn_rails_test.rb
216
+ - test/dummy_app/app/assets/javascripts/application.js
217
+ - test/dummy_app/app/assets/stylesheets/application.css
218
+ - test/dummy_app/app/controllers/application_controller.rb
219
+ - test/dummy_app/app/controllers/reports_controller.rb
220
+ - test/dummy_app/app/mailers/reports_mailer.rb
218
221
  - test/dummy_app/app/views/layouts/application.html.erb
219
222
  - test/dummy_app/app/views/reports/sample.html.erb
220
223
  - test/dummy_app/app/views/reports/sample.pdf.prawn
221
224
  - test/dummy_app/app/views/reports/table.pdf.prawn
222
- - test/dummy_app/app/assets/javascripts/application.js
223
- - test/dummy_app/app/assets/stylesheets/application.css
224
- - test/dummy_app/app/controllers/reports_controller.rb
225
- - test/dummy_app/app/controllers/application_controller.rb
226
- - test/dummy_app/db/test.sqlite3
227
- - test/dummy_app/db/schema.rb
228
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/mn/mnaHTtsBvdmAbdqsorI0KqFoT2eQIhgDVER_He3q2HU.cache
229
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
230
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/QP/QPocswuHM6KXKYd99JclYrybZep_vYHyfZQ-nGJB5uU.cache
231
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/S9/S9TmgasHOyBiOSg3OOpu2mzuUwMxxUE3zyKrExqIryQ.cache
232
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Bl/BlRucSL6BNAMZvHs4UVilikqNOKnbCHSGHIQRgtKvFQ.cache
233
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/rT/rTYHFXiH_g6ZVTgNXdVrDz3fihYKq9Diqso1lzP257o.cache
234
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/dZ/dZLyjSvZKmLRvanBa3SmJ58gtb_fQaHMzS1A04p2x_4.cache
235
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
236
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/kA/kAfbx3YIMg0L2tevtZdwbRjKKy9xOmYlXJ7LapMXDME.cache
237
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/VK/VKv8TUCURhWXKU5qrG7ocs75FsysCWNtswhqtTi7Lfw.cache
238
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/E1/E18Q7xE2E1RWvLRrvvBEf0ahfumckOlJWqD7YiPqLAk.cache
239
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/-E/-EGHXi_ULbX3JP7NLAsVLUrIZgOg0HxdFnvlbmA7DCA.cache
240
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
241
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
242
- - test/dummy_app/Rakefile
225
+ - test/dummy_app/app/views/reports_mailer/send_report.html.erb
243
226
  - test/dummy_app/config/application.rb
244
227
  - test/dummy_app/config/boot.rb
245
- - test/dummy_app/config/routes.rb
228
+ - test/dummy_app/config/database.yml
229
+ - test/dummy_app/config/environment.rb
246
230
  - test/dummy_app/config/environments/development.rb
247
- - test/dummy_app/config/environments/test.rb
248
231
  - test/dummy_app/config/environments/production.rb
249
- - test/dummy_app/config/database.yml
232
+ - test/dummy_app/config/environments/test.rb
250
233
  - test/dummy_app/config/initializers/backtrace_silencers.rb
251
- - test/dummy_app/config/initializers/mime_types.rb
252
234
  - test/dummy_app/config/initializers/inflections.rb
235
+ - test/dummy_app/config/initializers/mime_types.rb
253
236
  - test/dummy_app/config/initializers/prawn-rails.rb
254
- - test/dummy_app/config/initializers/wrap_parameters.rb
255
- - test/dummy_app/config/initializers/session_store.rb
256
237
  - test/dummy_app/config/initializers/secret_token.rb
257
- - test/dummy_app/config/secrets.yml
238
+ - test/dummy_app/config/initializers/session_store.rb
239
+ - test/dummy_app/config/initializers/wrap_parameters.rb
258
240
  - test/dummy_app/config/locales/en.yml
259
- - test/dummy_app/config/environment.rb
241
+ - test/dummy_app/config/routes.rb
242
+ - test/dummy_app/config/secrets.yml
260
243
  - test/dummy_app/config.ru
244
+ - test/dummy_app/db/schema.rb
245
+ - test/dummy_app/db/test.sqlite3
261
246
  - test/dummy_app/log/test.log
247
+ - test/dummy_app/Rakefile
248
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/-m/-mGgwBQ39pkjNoHzuM7XVbFYsHOyv_6SOM_CmI-kLnw.cache
249
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/-T/-Ty2Lif1RQ31LfQ3sdBLOYNu3fwjefNQWZXg61o7S0Q.cache
250
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/3j/3jV3hjwp5k_C7riQHMv6rtrQUfKwPXzFkJ32sUJuN_E.cache
251
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
252
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
253
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/7b/7bJ7ytF6vF1igkdeslMStlJ0FX-qsua3IF_1YPq8oCw.cache
254
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Ac/AcCgT9z272BU3f9VmSXyH6aXg0-fBwSzc8apjB9C0T4.cache
255
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/EG/EGPvvBJ-Qo0bhB9ro0HZH9s4Ln-PNqgz-uYTi5tV_88.cache
256
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/ie/ieDr67bZ5kFv-ENcBz8Q7TiuRQETGYgdgzYHyXqVcoI.cache
257
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
258
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
259
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/qW/qWT2nJzx5CDYl-mSJ0WXKcYzB6yu_HDoZLsoO5mWh7g.cache
260
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/se/seL12R6emubM_qf0qkqUQp8lYPC0Sv3ALlPVz2lH5OM.cache
261
+ - test/dummy_app/tmp/cache/assets/sprockets/v3.0/SJ/SJ3C0iDdYBBG_yOrab-Sw62moViXQPI90mwV-VCda_o.cache
262
+ - test/integration/prawn_rails_test.rb
263
+ - test/prawn_rails_test.rb
264
+ - test/test_helper.rb
@@ -1,11 +0,0 @@
1
- Gem.loaded_specs.keys.select{|spec_name| spec_name.starts_with?('prawn-')}.each do |gem_name|
2
- next if gem_name == 'prawn-rails' # Prevent circular loading
3
-
4
- file = gem_name.gsub('-', '/')
5
-
6
- begin
7
- require file
8
- rescue LoadError => _
9
- STDERR.puts "#{__FILE__}:#{__LINE__}: warning: prawn-rails could not require plugin `#{gem_name}`"
10
- end
11
- end
@@ -1 +0,0 @@
1
- I"�app/assets/stylesheets/application.css?type=text/css&pipeline=self&id=95f54059d4f1e7cc78e4ce4e3095d5e80c04a54150a4196d79c8450394e7fbbb:ET
@@ -1 +0,0 @@
1
- I"}app/assets/stylesheets/application.css?type=text/css&id=e61cdad8512dec56b927103ef49105a3d7be7a62e704392bafdf4cf6e78f81ec:ET
@@ -1 +0,0 @@
1
- I"�app/assets/javascripts/application.js?type=application/javascript&id=1ebb671d84a3d53ffd8130847272a0e7dea45aae44da66f25d384c1d6ff04e93:ET
@@ -1 +0,0 @@
1
- I"�app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=43ca35046d49844d3b98ec7f00e6d552c5852944cb7e38c426678630b417d472:ET