ezprint 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ezprint.gemspec +1 -1
- data/lib/ezprint/pdf_helper.rb +6 -6
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/ezprint.gemspec
CHANGED
data/lib/ezprint/pdf_helper.rb
CHANGED
@@ -20,16 +20,16 @@ module EzPrint
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def make_pdf(options = {})
|
23
|
-
options
|
24
|
-
options
|
25
|
-
options
|
23
|
+
stylesheets = options.delete(:stylesheets) || []
|
24
|
+
layout = options.delete(:layout) || false
|
25
|
+
template = options.delete(:template) || File.join(controller_path,action_name)
|
26
26
|
|
27
27
|
# Stop Rails from appending timestamps to assets.
|
28
28
|
ENV["RAILS_ASSET_ID"] = ''
|
29
|
-
html_string = render_to_string(:template =>
|
29
|
+
html_string = render_to_string(:template => template, :layout => layout)
|
30
30
|
|
31
|
-
kit = PDFKit.new(process_html_string(html_string))
|
32
|
-
kit.stylesheets =
|
31
|
+
kit = PDFKit.new(process_html_string(html_string), options)
|
32
|
+
kit.stylesheets = stylesheets.collect{ |style| stylesheet_file_path(style) }
|
33
33
|
|
34
34
|
kit.to_pdf
|
35
35
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezprint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason Stewart
|