prawn-rails 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -3
  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 +8 -12
  8. data/lib/prawn-rails/version.rb +1 -1
  9. data/lib/prawn-rails.rb +16 -1
  10. metadata +18 -219
  11. data/lib/prawn-rails/railtie.rb +0 -14
  12. data/test/dummy_app/Rakefile +0 -7
  13. data/test/dummy_app/app/assets/config/manifest.js +0 -3
  14. data/test/dummy_app/app/assets/javascripts/application.js +0 -0
  15. data/test/dummy_app/app/assets/stylesheets/application.css +0 -3
  16. data/test/dummy_app/app/controllers/application_controller.rb +0 -3
  17. data/test/dummy_app/app/controllers/reports_controller.rb +0 -37
  18. data/test/dummy_app/app/mailers/reports_mailer.rb +0 -18
  19. data/test/dummy_app/app/views/layouts/application.html.erb +0 -14
  20. data/test/dummy_app/app/views/reports/custom.pdf.prawn +0 -3
  21. data/test/dummy_app/app/views/reports/custom_disposition.pdf.prawn +0 -3
  22. data/test/dummy_app/app/views/reports/custom_filename.pdf.prawn +0 -3
  23. data/test/dummy_app/app/views/reports/sample.html.erb +0 -1
  24. data/test/dummy_app/app/views/reports/sample.pdf.prawn +0 -40
  25. data/test/dummy_app/app/views/reports/table.pdf.prawn +0 -7
  26. data/test/dummy_app/app/views/reports_mailer/send_report.html.erb +0 -1
  27. data/test/dummy_app/config/application.rb +0 -52
  28. data/test/dummy_app/config/boot.rb +0 -10
  29. data/test/dummy_app/config/database.yml +0 -25
  30. data/test/dummy_app/config/environment.rb +0 -5
  31. data/test/dummy_app/config/environments/development.rb +0 -30
  32. data/test/dummy_app/config/environments/production.rb +0 -60
  33. data/test/dummy_app/config/environments/test.rb +0 -41
  34. data/test/dummy_app/config/initializers/backtrace_silencers.rb +0 -7
  35. data/test/dummy_app/config/initializers/inflections.rb +0 -10
  36. data/test/dummy_app/config/initializers/mime_types.rb +0 -5
  37. data/test/dummy_app/config/initializers/prawn-rails.rb +0 -5
  38. data/test/dummy_app/config/initializers/secret_token.rb +0 -11
  39. data/test/dummy_app/config/initializers/session_store.rb +0 -8
  40. data/test/dummy_app/config/initializers/wrap_parameters.rb +0 -14
  41. data/test/dummy_app/config/locales/en.yml +0 -5
  42. data/test/dummy_app/config/routes.rb +0 -9
  43. data/test/dummy_app/config/secrets.yml +0 -22
  44. data/test/dummy_app/config.ru +0 -4
  45. data/test/dummy_app/db/schema.rb +0 -15
  46. data/test/dummy_app/db/test.sqlite3 +0 -0
  47. data/test/dummy_app/log/test.log +0 -950
  48. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/0Q/0QR6jgJcsDY23uF8NGHFYajkal8CGG4d3kOZQCD8Oj8.cache +0 -1
  49. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/1K/1KcQYwe3g9uhY2WePD1_5P38IzP0Veu8rDPI0wXQSP8.cache +0 -1
  50. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +0 -2
  51. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache +0 -2
  52. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/4X/4XWDJRe7gZAeojFwJq7j6jJxRr152aQBfyhVtPPSHDY.cache +0 -0
  53. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/7z/7zB4MNaDZMfwUPQ7LsLGHLt1EAx1oMCEUjywneVyoyY.cache +0 -1
  54. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/8D/8D13-8wUZxyVgrsD9RHdWUPhLlWcqnHXtOBMOPQRX-Q.cache +0 -1
  55. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache +0 -3
  56. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +0 -3
  57. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/Yr/YrGeNwkHFUXGwgJhi0aqJdEHL--OyRwU5aN5azmIXM4.cache +0 -0
  58. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/ib/ibSeAobTqAE0a-v_-umXpnbXaIEx_WOtSsQkSRJCwwI.cache +0 -0
  59. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/mO/mOu9n3QmqPXFbaUP-4RAuwabvsLdudRBvk9LMIOTSoI.cache +0 -1
  60. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/vt/vtyC4n-7HZNOJV7EprjE7ThndKZkG00OVD8sO8cUFAM.cache +0 -0
  61. data/test/dummy_app/tmp/cache/assets/sprockets/v3.0/wt/wtoVyr5IaVgQI72M_TLZFUNHeStJ5maRaHlfA8Vt6d0.cache +0 -1
  62. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/-i/-i0h20pCtmvENM-EAyaKkJDFhjn-HuXuoE0e1sLu_rg.cache +0 -0
  63. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/0r/0r4iTRUbzH4dQwbjPscLVpHM1SJyEKVXeCEzD_U9JYE.cache +0 -0
  64. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +0 -0
  65. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache +0 -0
  66. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/6y/6yMwFwpdEybDnrikBloKhYP4Zmo9Ry746DScoqO8mbE.cache +0 -1
  67. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/7z/7zB4MNaDZMfwUPQ7LsLGHLt1EAx1oMCEUjywneVyoyY.cache +0 -1
  68. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8D/8D13-8wUZxyVgrsD9RHdWUPhLlWcqnHXtOBMOPQRX-Q.cache +0 -1
  69. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ac/Ac0RnYBszO_tvu-01dVJjO6aKZedDO2TVCAwpY5nE4U.cache +0 -1
  70. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache +0 -0
  71. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/FD/FDmzMYru4EyGcs7Q7tsCbapZmNV-jXENb6M-UuS8GLs.cache +0 -1
  72. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/FH/FHiO02EbiWfhKFHA3d6jTB6d50AXJzY9OjwpyzlbR3A.cache +0 -1
  73. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Jn/JnmWS5ayWWDAiBYz39zc51V2mHFWYAlXjW-vPbehyvk.cache +0 -1
  74. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Jr/JraYt1MnVVm8nrRu036hPHr_-BxBo2RwGcH_4XFDk9g.cache +0 -0
  75. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LQ/LQQTiHeHlmh1Fwvuv1Ss9ne5mXE0TOv2xaanJ40LEXA.cache +0 -0
  76. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache +0 -0
  77. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +0 -0
  78. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/OH/OHFQxWHvIcKq2nREonlhK8AgUKTRZ-2tDjQIRFoh400.cache +0 -1
  79. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/QV/QVq7YZh551f-JSU-9f9VWDRJA0Wm_LcbdJfJEO45hpY.cache +0 -1
  80. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Rx/RxPz7Gq0QcrSvjCMwAGBbCp9-4uiZixta20a-pY50G0.cache +0 -1
  81. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Sd/SdKiVwcnL47CkgJH6d6rg8bT2jeMfr_KOpH6K-e_Rpw.cache +0 -1
  82. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Tq/TqJjVveNs9BoMZZ0bqrtV17QUpcioQePyc75rUF8Q5U.cache +0 -0
  83. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/WX/WXW-hCt_qs8QZgCDuLbIdi4PEZY5Dr4gkk3TG2bzIlA.cache +0 -1
  84. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/X0/X0VVDULN8me11G85S0HRqtRtWpg2evTeD-eptzBX0Js.cache +0 -1
  85. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/bc/bc6phGXVat2w60GIQpknrZ6UeHcwGAJkPSEyx2vzYWA.cache +0 -1
  86. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cc/ccsnAmW1sI8J39ktFOU92ag0Cmd98hy1nLoiYxk-ztA.cache +0 -0
  87. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cq/cqmOKwCIiucE1noRNr0g5M-9rOz5lOw_KfXGRITzjfM.cache +0 -0
  88. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dL/dLpVVClnOjqhfdUOtaPPRDGP73ARy79nba4H4B4TtkQ.cache +0 -0
  89. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/i5/i5ZEAsQ_Rav4MDMy4ihQldRNRjQ8rSickZnnbPrf8MM.cache +0 -0
  90. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/iv/ivPda3JMWfbu-IHENKRMM5Y-RPDGx17E-UsDHaRw2l0.cache +0 -1
  91. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/jX/jXTNqwlV7NH3QgrxukXmrtTRmJdf7JLsLthOWuSajAk.cache +0 -1
  92. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/oL/oL18MfHhURyZjTEiCN9pzxDO5yolnjepKPIQ3AxRtuw.cache +0 -0
  93. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pC/pCWceIteP62iSWMjZn19ap3KwUG6vXoQUzXAe5Pd07s.cache +0 -1
  94. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache +0 -0
  95. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/qY/qYZa9MjWU2euhPKhmXxsJtfsHa76D0-yIqmqhhqDnWM.cache +0 -0
  96. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/ro/roxJL7F-lfG7snTu-4sBGaTfHUu94FPZMfWpTEJq-V8.cache +0 -1
  97. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/tV/tVR6xDtsNbiDca0JyoaKp4tirI4zYUF0RiWbw-9qyP0.cache +0 -1
  98. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/uO/uOomFpb2HCobA5V40idjrZP3fmfIzbyS21BXqdFnonw.cache +0 -0
  99. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vv/vvPcNRT1bVyxTWN8IxKtvuBhxXib3G0tzztnaz6AE9k.cache +0 -0
  100. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/wX/wX5yL9P13fJNPuZX10N7nQYMaQJl8JdZKPpsRiESJgE.cache +0 -0
  101. data/test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/yy/yycp8-xBCXFX3VWJYNtJkJvzZD2XEejmUso7wI-7cbo.cache +0 -0
  102. data/test/integration/prawn_rails_test.rb +0 -105
  103. data/test/prawn_rails_test.rb +0 -28
  104. data/test/test_helper.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cc8b0b4dcec01b053fcc3dc156456f243320e5e7b1885486d0de6c6ec55f574
4
- data.tar.gz: 79ea17f3222b3484e27551f2f7c20a48c964d3d0897340f9bb162b22325a8044
3
+ metadata.gz: '038a7bc1fd0cf46c805b37358ca5f43f97ea61bd3a9bb2a5f57c93b063735faf'
4
+ data.tar.gz: 44842dfeddbb4e8c525767bd2838ab732d92d350aed9e9d8b8d44c0af14e26d6
5
5
  SHA512:
6
- metadata.gz: cc3df95c50ee59e14fa1ab357cf01c6112a8d73c4ad799bc32767aa8483fb494562f2cd2a6b9ea8c5141c70cd0db4c9c72862dbce8beeb6d5a801a72e197d579
7
- data.tar.gz: b696d243feb7d6323296367a3914efa70c740aed86589155cb522d417b917e9d229a0dcc28534b01ea840b5d60c7ef75d15671d005d5ef941cc18eff38d6424b
6
+ metadata.gz: 32c30aa630ddba6fb25c4e92520f2a61ed99ac43159729b4064bddbe56ae74e04b18d8823a58020a37f897b3fa281ae049add79ad7e5caf39ad8ed471ba6a289
7
+ data.tar.gz: 16909da459d44bedbe4466c42b6ee080231d7a714f2268227a58e64cb825de1f0dfd5dcc4b9f836839b4520b5e3ae6e2b2463c465ddfe2ded71c792d7d5b6376
data/CHANGELOG.md CHANGED
@@ -1,10 +1,20 @@
1
1
  # Changelog
2
2
 
3
- * `Unreleased` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.1...master)
3
+ * `Unreleased` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.5.0...master)
4
4
  - Nothing yet
5
5
 
6
- * `Unreleased` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.0...v1.4.1)
7
- - [7575606](https://github.com/cortiz/prawn-rails/commit/7575606) - Fix bug in v1.4.0, where PDF's wouldnt open as `inline` within the browser. Problem was due to incomplete switch to Railsties from [PR #41](https://github.com/cortiz/prawn-rails/pull/41)
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
+
13
+ * `v1.4.2` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.1...v1.4.2)
14
+ - Remove dependency on `railsties` and instead only depend on `actionview`
15
+
16
+ * `v1.4.1` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.0...v1.4.1)
17
+ - [7575606](https://github.com/cortiz/prawn-rails/commit/7575606) - Complete switch to Railsties from [PR #41](https://github.com/cortiz/prawn-rails/pull/41)
8
18
 
9
19
  * `v1.4.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.3.0...v1.4.0)
10
20
  - [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.
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
 
@@ -21,17 +27,7 @@ module PrawnRails
21
27
 
22
28
  yield pdf if block_given?
23
29
 
24
- 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
- }
30
+ return pdf.render
35
31
  end
36
32
 
37
33
  end
@@ -1,3 +1,3 @@
1
1
  module PrawnRails
2
- VERSION = "1.4.1"
2
+ VERSION = "1.5.0".freeze
3
3
  end
data/lib/prawn-rails.rb CHANGED
@@ -1,6 +1,21 @@
1
+ require "prawn"
2
+
1
3
  require "prawn-rails/version"
2
4
  require "prawn-rails/config"
3
- require "prawn-rails/railtie"
5
+
6
+ require 'active_support/lazy_load_hooks'
4
7
 
5
8
  module PrawnRails
6
9
  end
10
+
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)
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.1
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-20 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
@@ -40,7 +40,7 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: railties
43
+ name: actionview
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
@@ -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
  - - ">="
@@ -179,107 +165,13 @@ files:
179
165
  - lib/prawn-rails/config.rb
180
166
  - lib/prawn-rails/document.rb
181
167
  - lib/prawn-rails/rails_helper.rb
182
- - lib/prawn-rails/railtie.rb
183
168
  - lib/prawn-rails/renderer.rb
184
169
  - lib/prawn-rails/version.rb
185
- - test/dummy_app/Rakefile
186
- - test/dummy_app/app/assets/config/manifest.js
187
- - test/dummy_app/app/assets/javascripts/application.js
188
- - test/dummy_app/app/assets/stylesheets/application.css
189
- - test/dummy_app/app/controllers/application_controller.rb
190
- - test/dummy_app/app/controllers/reports_controller.rb
191
- - test/dummy_app/app/mailers/reports_mailer.rb
192
- - test/dummy_app/app/views/layouts/application.html.erb
193
- - test/dummy_app/app/views/reports/custom.pdf.prawn
194
- - test/dummy_app/app/views/reports/custom_disposition.pdf.prawn
195
- - test/dummy_app/app/views/reports/custom_filename.pdf.prawn
196
- - test/dummy_app/app/views/reports/sample.html.erb
197
- - test/dummy_app/app/views/reports/sample.pdf.prawn
198
- - test/dummy_app/app/views/reports/table.pdf.prawn
199
- - test/dummy_app/app/views/reports_mailer/send_report.html.erb
200
- - test/dummy_app/config.ru
201
- - test/dummy_app/config/application.rb
202
- - test/dummy_app/config/boot.rb
203
- - test/dummy_app/config/database.yml
204
- - test/dummy_app/config/environment.rb
205
- - test/dummy_app/config/environments/development.rb
206
- - test/dummy_app/config/environments/production.rb
207
- - test/dummy_app/config/environments/test.rb
208
- - test/dummy_app/config/initializers/backtrace_silencers.rb
209
- - test/dummy_app/config/initializers/inflections.rb
210
- - test/dummy_app/config/initializers/mime_types.rb
211
- - test/dummy_app/config/initializers/prawn-rails.rb
212
- - test/dummy_app/config/initializers/secret_token.rb
213
- - test/dummy_app/config/initializers/session_store.rb
214
- - test/dummy_app/config/initializers/wrap_parameters.rb
215
- - test/dummy_app/config/locales/en.yml
216
- - test/dummy_app/config/routes.rb
217
- - test/dummy_app/config/secrets.yml
218
- - test/dummy_app/db/schema.rb
219
- - test/dummy_app/db/test.sqlite3
220
- - test/dummy_app/log/test.log
221
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/0Q/0QR6jgJcsDY23uF8NGHFYajkal8CGG4d3kOZQCD8Oj8.cache
222
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/1K/1KcQYwe3g9uhY2WePD1_5P38IzP0Veu8rDPI0wXQSP8.cache
223
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
224
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
225
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/4X/4XWDJRe7gZAeojFwJq7j6jJxRr152aQBfyhVtPPSHDY.cache
226
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/7z/7zB4MNaDZMfwUPQ7LsLGHLt1EAx1oMCEUjywneVyoyY.cache
227
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/8D/8D13-8wUZxyVgrsD9RHdWUPhLlWcqnHXtOBMOPQRX-Q.cache
228
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
229
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
230
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Yr/YrGeNwkHFUXGwgJhi0aqJdEHL--OyRwU5aN5azmIXM4.cache
231
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/ib/ibSeAobTqAE0a-v_-umXpnbXaIEx_WOtSsQkSRJCwwI.cache
232
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/mO/mOu9n3QmqPXFbaUP-4RAuwabvsLdudRBvk9LMIOTSoI.cache
233
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/vt/vtyC4n-7HZNOJV7EprjE7ThndKZkG00OVD8sO8cUFAM.cache
234
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/wt/wtoVyr5IaVgQI72M_TLZFUNHeStJ5maRaHlfA8Vt6d0.cache
235
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/-i/-i0h20pCtmvENM-EAyaKkJDFhjn-HuXuoE0e1sLu_rg.cache
236
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/0r/0r4iTRUbzH4dQwbjPscLVpHM1SJyEKVXeCEzD_U9JYE.cache
237
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
238
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
239
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/6y/6yMwFwpdEybDnrikBloKhYP4Zmo9Ry746DScoqO8mbE.cache
240
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/7z/7zB4MNaDZMfwUPQ7LsLGHLt1EAx1oMCEUjywneVyoyY.cache
241
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8D/8D13-8wUZxyVgrsD9RHdWUPhLlWcqnHXtOBMOPQRX-Q.cache
242
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ac/Ac0RnYBszO_tvu-01dVJjO6aKZedDO2TVCAwpY5nE4U.cache
243
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache
244
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/FD/FDmzMYru4EyGcs7Q7tsCbapZmNV-jXENb6M-UuS8GLs.cache
245
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/FH/FHiO02EbiWfhKFHA3d6jTB6d50AXJzY9OjwpyzlbR3A.cache
246
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Jn/JnmWS5ayWWDAiBYz39zc51V2mHFWYAlXjW-vPbehyvk.cache
247
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Jr/JraYt1MnVVm8nrRu036hPHr_-BxBo2RwGcH_4XFDk9g.cache
248
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LQ/LQQTiHeHlmh1Fwvuv1Ss9ne5mXE0TOv2xaanJ40LEXA.cache
249
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
250
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
251
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/OH/OHFQxWHvIcKq2nREonlhK8AgUKTRZ-2tDjQIRFoh400.cache
252
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/QV/QVq7YZh551f-JSU-9f9VWDRJA0Wm_LcbdJfJEO45hpY.cache
253
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Rx/RxPz7Gq0QcrSvjCMwAGBbCp9-4uiZixta20a-pY50G0.cache
254
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Sd/SdKiVwcnL47CkgJH6d6rg8bT2jeMfr_KOpH6K-e_Rpw.cache
255
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Tq/TqJjVveNs9BoMZZ0bqrtV17QUpcioQePyc75rUF8Q5U.cache
256
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/WX/WXW-hCt_qs8QZgCDuLbIdi4PEZY5Dr4gkk3TG2bzIlA.cache
257
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/X0/X0VVDULN8me11G85S0HRqtRtWpg2evTeD-eptzBX0Js.cache
258
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/bc/bc6phGXVat2w60GIQpknrZ6UeHcwGAJkPSEyx2vzYWA.cache
259
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cc/ccsnAmW1sI8J39ktFOU92ag0Cmd98hy1nLoiYxk-ztA.cache
260
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cq/cqmOKwCIiucE1noRNr0g5M-9rOz5lOw_KfXGRITzjfM.cache
261
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dL/dLpVVClnOjqhfdUOtaPPRDGP73ARy79nba4H4B4TtkQ.cache
262
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/i5/i5ZEAsQ_Rav4MDMy4ihQldRNRjQ8rSickZnnbPrf8MM.cache
263
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/iv/ivPda3JMWfbu-IHENKRMM5Y-RPDGx17E-UsDHaRw2l0.cache
264
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/jX/jXTNqwlV7NH3QgrxukXmrtTRmJdf7JLsLthOWuSajAk.cache
265
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/oL/oL18MfHhURyZjTEiCN9pzxDO5yolnjepKPIQ3AxRtuw.cache
266
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pC/pCWceIteP62iSWMjZn19ap3KwUG6vXoQUzXAe5Pd07s.cache
267
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache
268
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/qY/qYZa9MjWU2euhPKhmXxsJtfsHa76D0-yIqmqhhqDnWM.cache
269
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/ro/roxJL7F-lfG7snTu-4sBGaTfHUu94FPZMfWpTEJq-V8.cache
270
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/tV/tVR6xDtsNbiDca0JyoaKp4tirI4zYUF0RiWbw-9qyP0.cache
271
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/uO/uOomFpb2HCobA5V40idjrZP3fmfIzbyS21BXqdFnonw.cache
272
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vv/vvPcNRT1bVyxTWN8IxKtvuBhxXib3G0tzztnaz6AE9k.cache
273
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/wX/wX5yL9P13fJNPuZX10N7nQYMaQJl8JdZKPpsRiESJgE.cache
274
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/yy/yycp8-xBCXFX3VWJYNtJkJvzZD2XEejmUso7wI-7cbo.cache
275
- - test/integration/prawn_rails_test.rb
276
- - test/prawn_rails_test.rb
277
- - test/test_helper.rb
278
170
  homepage: https://github.com/cortiz/prawn-rails
279
171
  licenses:
280
172
  - MIT
281
173
  metadata: {}
282
- post_install_message:
174
+ post_install_message:
283
175
  rdoc_options: []
284
176
  require_paths:
285
177
  - lib
@@ -294,101 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
186
  - !ruby/object:Gem::Version
295
187
  version: '0'
296
188
  requirements: []
297
- rubygems_version: 3.1.2
298
- signing_key:
189
+ rubygems_version: 3.4.22
190
+ signing_key:
299
191
  specification_version: 4
300
192
  summary: Prawn Handler for Rails
301
- test_files:
302
- - test/integration/prawn_rails_test.rb
303
- - test/test_helper.rb
304
- - test/dummy_app/app/views/layouts/application.html.erb
305
- - test/dummy_app/app/views/reports/sample.html.erb
306
- - test/dummy_app/app/views/reports/sample.pdf.prawn
307
- - test/dummy_app/app/views/reports/custom_filename.pdf.prawn
308
- - test/dummy_app/app/views/reports/custom.pdf.prawn
309
- - test/dummy_app/app/views/reports/table.pdf.prawn
310
- - test/dummy_app/app/views/reports/custom_disposition.pdf.prawn
311
- - test/dummy_app/app/views/reports_mailer/send_report.html.erb
312
- - test/dummy_app/app/assets/stylesheets/application.css
313
- - test/dummy_app/app/assets/config/manifest.js
314
- - test/dummy_app/app/assets/javascripts/application.js
315
- - test/dummy_app/app/mailers/reports_mailer.rb
316
- - test/dummy_app/app/controllers/application_controller.rb
317
- - test/dummy_app/app/controllers/reports_controller.rb
318
- - test/dummy_app/config.ru
319
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/1K/1KcQYwe3g9uhY2WePD1_5P38IzP0Veu8rDPI0wXQSP8.cache
320
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/mO/mOu9n3QmqPXFbaUP-4RAuwabvsLdudRBvk9LMIOTSoI.cache
321
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
322
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Yr/YrGeNwkHFUXGwgJhi0aqJdEHL--OyRwU5aN5azmIXM4.cache
323
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/4X/4XWDJRe7gZAeojFwJq7j6jJxRr152aQBfyhVtPPSHDY.cache
324
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/wt/wtoVyr5IaVgQI72M_TLZFUNHeStJ5maRaHlfA8Vt6d0.cache
325
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/vt/vtyC4n-7HZNOJV7EprjE7ThndKZkG00OVD8sO8cUFAM.cache
326
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/8D/8D13-8wUZxyVgrsD9RHdWUPhLlWcqnHXtOBMOPQRX-Q.cache
327
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/ib/ibSeAobTqAE0a-v_-umXpnbXaIEx_WOtSsQkSRJCwwI.cache
328
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/0Q/0QR6jgJcsDY23uF8NGHFYajkal8CGG4d3kOZQCD8Oj8.cache
329
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/7z/7zB4MNaDZMfwUPQ7LsLGHLt1EAx1oMCEUjywneVyoyY.cache
330
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
331
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
332
- - test/dummy_app/tmp/cache/assets/sprockets/v3.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
333
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/dL/dLpVVClnOjqhfdUOtaPPRDGP73ARy79nba4H4B4TtkQ.cache
334
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/WX/WXW-hCt_qs8QZgCDuLbIdi4PEZY5Dr4gkk3TG2bzIlA.cache
335
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cq/cqmOKwCIiucE1noRNr0g5M-9rOz5lOw_KfXGRITzjfM.cache
336
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Ac/Ac0RnYBszO_tvu-01dVJjO6aKZedDO2TVCAwpY5nE4U.cache
337
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/cc/ccsnAmW1sI8J39ktFOU92ag0Cmd98hy1nLoiYxk-ztA.cache
338
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/4O/4O6Anm3R8aSIVfMhGtp5tZK3x17fcY1SbWoDN_6hb-o.cache
339
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Rx/RxPz7Gq0QcrSvjCMwAGBbCp9-4uiZixta20a-pY50G0.cache
340
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Sd/SdKiVwcnL47CkgJH6d6rg8bT2jeMfr_KOpH6K-e_Rpw.cache
341
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/wX/wX5yL9P13fJNPuZX10N7nQYMaQJl8JdZKPpsRiESJgE.cache
342
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/jX/jXTNqwlV7NH3QgrxukXmrtTRmJdf7JLsLthOWuSajAk.cache
343
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/qY/qYZa9MjWU2euhPKhmXxsJtfsHa76D0-yIqmqhhqDnWM.cache
344
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/iv/ivPda3JMWfbu-IHENKRMM5Y-RPDGx17E-UsDHaRw2l0.cache
345
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/8D/8D13-8wUZxyVgrsD9RHdWUPhLlWcqnHXtOBMOPQRX-Q.cache
346
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Jn/JnmWS5ayWWDAiBYz39zc51V2mHFWYAlXjW-vPbehyvk.cache
347
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/ro/roxJL7F-lfG7snTu-4sBGaTfHUu94FPZMfWpTEJq-V8.cache
348
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/i5/i5ZEAsQ_Rav4MDMy4ihQldRNRjQ8rSickZnnbPrf8MM.cache
349
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache
350
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LQ/LQQTiHeHlmh1Fwvuv1Ss9ne5mXE0TOv2xaanJ40LEXA.cache
351
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/QV/QVq7YZh551f-JSU-9f9VWDRJA0Wm_LcbdJfJEO45hpY.cache
352
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/FD/FDmzMYru4EyGcs7Q7tsCbapZmNV-jXENb6M-UuS8GLs.cache
353
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/uO/uOomFpb2HCobA5V40idjrZP3fmfIzbyS21BXqdFnonw.cache
354
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/7z/7zB4MNaDZMfwUPQ7LsLGHLt1EAx1oMCEUjywneVyoyY.cache
355
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/vv/vvPcNRT1bVyxTWN8IxKtvuBhxXib3G0tzztnaz6AE9k.cache
356
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache
357
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/FH/FHiO02EbiWfhKFHA3d6jTB6d50AXJzY9OjwpyzlbR3A.cache
358
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/bc/bc6phGXVat2w60GIQpknrZ6UeHcwGAJkPSEyx2vzYWA.cache
359
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/0r/0r4iTRUbzH4dQwbjPscLVpHM1SJyEKVXeCEzD_U9JYE.cache
360
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/LR/LRLaw7viwBb9Mi_VFZxGbKIooy8Fqf1aB_iOTETsMyc.cache
361
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/6y/6yMwFwpdEybDnrikBloKhYP4Zmo9Ry746DScoqO8mbE.cache
362
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/-i/-i0h20pCtmvENM-EAyaKkJDFhjn-HuXuoE0e1sLu_rg.cache
363
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/yy/yycp8-xBCXFX3VWJYNtJkJvzZD2XEejmUso7wI-7cbo.cache
364
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Jr/JraYt1MnVVm8nrRu036hPHr_-BxBo2RwGcH_4XFDk9g.cache
365
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/pC/pCWceIteP62iSWMjZn19ap3KwUG6vXoQUzXAe5Pd07s.cache
366
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/OH/OHFQxWHvIcKq2nREonlhK8AgUKTRZ-2tDjQIRFoh400.cache
367
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/oL/oL18MfHhURyZjTEiCN9pzxDO5yolnjepKPIQ3AxRtuw.cache
368
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/tV/tVR6xDtsNbiDca0JyoaKp4tirI4zYUF0RiWbw-9qyP0.cache
369
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache
370
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/Tq/TqJjVveNs9BoMZZ0bqrtV17QUpcioQePyc75rUF8Q5U.cache
371
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache
372
- - test/dummy_app/tmp/cache/assets/sprockets/v4.0.0/X0/X0VVDULN8me11G85S0HRqtRtWpg2evTeD-eptzBX0Js.cache
373
- - test/dummy_app/log/test.log
374
- - test/dummy_app/config/database.yml
375
- - test/dummy_app/config/environments/production.rb
376
- - test/dummy_app/config/environments/test.rb
377
- - test/dummy_app/config/environments/development.rb
378
- - test/dummy_app/config/routes.rb
379
- - test/dummy_app/config/environment.rb
380
- - test/dummy_app/config/locales/en.yml
381
- - test/dummy_app/config/boot.rb
382
- - test/dummy_app/config/initializers/secret_token.rb
383
- - test/dummy_app/config/initializers/inflections.rb
384
- - test/dummy_app/config/initializers/mime_types.rb
385
- - test/dummy_app/config/initializers/session_store.rb
386
- - test/dummy_app/config/initializers/wrap_parameters.rb
387
- - test/dummy_app/config/initializers/prawn-rails.rb
388
- - test/dummy_app/config/initializers/backtrace_silencers.rb
389
- - test/dummy_app/config/secrets.yml
390
- - test/dummy_app/config/application.rb
391
- - test/dummy_app/Rakefile
392
- - test/dummy_app/db/schema.rb
393
- - test/dummy_app/db/test.sqlite3
394
- - test/prawn_rails_test.rb
193
+ test_files: []
@@ -1,14 +0,0 @@
1
- require "prawn"
2
- require "prawn-rails/rails_helper"
3
- require "prawn-rails/renderer"
4
-
5
- module PrawnRails
6
- class Railtie < Rails::Railtie
7
- ActionView::Base.send(:include, PrawnRails::RailsHelper)
8
- ActionView::Template.register_template_handler(:prawn, PrawnRails::Renderer)
9
-
10
- unless Mime::Type.lookup_by_extension(:pdf)
11
- Mime::Type.register_alias("application/pdf", :pdf)
12
- end
13
- end
14
- end
@@ -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