ezprint 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ezprint}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jason Stewart"]
@@ -20,16 +20,16 @@ module EzPrint
20
20
  private
21
21
 
22
22
  def make_pdf(options = {})
23
- options[:stylesheets] ||= []
24
- options[:layout] ||= false
25
- options[:template] ||= File.join(controller_path,action_name)
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 => options[:template], :layout => options[:layout])
29
+ html_string = render_to_string(:template => template, :layout => layout)
30
30
 
31
- kit = PDFKit.new(process_html_string(html_string))
32
- kit.stylesheets = options[:stylesheets].collect{ |style| stylesheet_file_path(style) }
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: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jason Stewart