pdf_gem 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4c0bda6a2f0b4e18cd46e48244daa04dc915aadd3e97fc4c610693dd6a50ad7
4
- data.tar.gz: c3c291cb440ef39d1594485d7cb826df23fc14e60c132c3285561a209868c58b
3
+ metadata.gz: cef9f7203d05d0d116b4e5294f4b7e2cd8682d2926fd1fd84373eb096a9b5ea9
4
+ data.tar.gz: 00f5792d27ce1726a3c182a9426bcaf51b6aba78e3c4d8255031abd693b0c642
5
5
  SHA512:
6
- metadata.gz: 7fad7f3dd35e1627f48bd11a45705eb8b8b21439d0d1e1795a83530cb0ef0e45c4ca0a8fdc2cf0da8f5f3c1e0485e28c8880d739126cf059d18d0624512e7672
7
- data.tar.gz: 9bc66a23cfcb9ccd9bede74f8f0d63988fc37d8721a90a73fbf37f484a6c127dcf892602c8d09f4aa00f5ab3feb8bc19c817b8c071fd7dab9588970d726838cc
6
+ metadata.gz: 6a758ed6a2a8130eefd19c76a11fa56ae25789a5aff73d0ea7278644dc96041081a411f9a8f63c5cfbf6ab40ab28bd6cfb1845ccabf266a6a016778922218447
7
+ data.tar.gz: bb4033abcfb6ddb00357ec2e6e7e6104edabd2555d459be36fd785dabec197c95601f7a835c34ab646316e180dcec6f4ca0979eb90026bced6a1777aaa2f5bcb
@@ -1,3 +1,3 @@
1
1
  module PdfGem
2
- VERSION = '1.0.7'
2
+ VERSION = '1.0.8'
3
3
  end
@@ -1,11 +1,27 @@
1
- module PdfGem
2
- def self.renderer(template, options)
3
- params = options.except(:prefixes, :template, :disposition, :url, :html, :filename, :formats)
4
- params[:html] = render_to_string(:action => (template.present? ? template : options.template), formats: options[:formats].present? ? options[:formats] : [:pdf] )
5
- send_data PdfGem::pdf_from_string(params), type: Mime[:pdf], disposition: (params[:disposition].present? ? params[:disposition] : 'inline'), :filename => options[:filename]
1
+ module PdfGem
2
+
3
+ class PdfGemRailtie < Rails::Railtie
4
+ initializer "my_railtie.configure_rails_initialization" do
5
+
6
+ ActionController::Renderers.add :pdf do |template, options|
7
+ params = options.except(:prefixes, :template, :disposition, :url, :html, :filename, :formats)
8
+ params[:html] = render_to_string(:action => (template.present? ? template : options.template), formats: options[:formats].present? ? options[:formats] : [:pdf] )
9
+ send_data PdfGem::pdf_from_string(params), type: Mime[:pdf], disposition: (params[:disposition].present? ? params[:disposition] : 'inline'), :filename => options[:filename]
10
+ end
11
+
12
+ ActionController::Renderers.add :pdf2 do |template, options|
13
+ params = options.except(:prefixes, :template, :disposition, :url, :html, :filename, :formats)
14
+ params[:html] = render_to_string(:action => (template.present? ? template : options.template), formats: options[:formats].present? ? options[:formats] : [:pdf] )
15
+ send_data PdfGem::pdf_from_string(params), type: Mime[:pdf], disposition: (params[:disposition].present? ? params[:disposition] : 'inline'), :filename => options[:filename]
16
+ end
17
+ if Mime::Type.lookup_by_extension(:pdf).nil?
18
+ Mime::Type.register('application/pdf', :pdf)
19
+ end
20
+ end
6
21
  end
22
+
23
+
24
+
7
25
 
8
- if Mime::Type.lookup_by_extension(:pdf).nil?
9
- Mime::Type.register('application/pdf', :pdf)
10
- end
26
+
11
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Blasina