wicked_pdf_standalone 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -18,7 +18,22 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ Here is example usage, with draper:
22
+
23
+ $ output_path = File.join("/tmp", "file.pdf")
24
+ $ @subject = Model.find(1)
25
+ $ @pdf_renderer_instance = WkPdfRenderer.new
26
+ $ @pdf_renderer_instance.to_file(output_path, subject.some_default_pdf_renderer_options) do |renderer|
27
+ $ renderer.instance_variable_set("@subject", SubjectDecorator.decorate(@subject))
28
+ $ end
29
+
30
+ And if you want to spit out a file, right away:
31
+
32
+ $ save_path = Rails.root.join("filename.pdf")
33
+ $ file = File.open(save_path, 'wb') do |file|
34
+ $ file << @pdf_renderer_instance.send(:make_pdf)
35
+ $ end
36
+ $
22
37
 
23
38
  ## Contributing
24
39
 
@@ -1,3 +1,3 @@
1
1
  module WickedPdfStandalone
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wicked_pdf_standalone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: