mack-pdf_writer 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +3 -0
  2. data/lib/mack-pdf_writer.rb +2 -0
  3. data/lib/pdf_engine.rb +28 -0
  4. metadata +64 -0
data/README ADDED
@@ -0,0 +1,3 @@
1
+ README
2
+ ========================================================================
3
+ mack-pdf_writer
@@ -0,0 +1,2 @@
1
+ require 'pdf/writer'
2
+ require 'pdf_engine'
data/lib/pdf_engine.rb ADDED
@@ -0,0 +1,28 @@
1
+ module Mack
2
+ module Rendering # :nodoc:
3
+ module Engine # :nodoc:
4
+ class Pdf < Mack::Rendering::Engine::Base
5
+
6
+ def render(io, binding)
7
+ @_pdf = ::PDF::Writer.new
8
+ self.view_template.instance_variable_set("@_pdf", @_pdf)
9
+ eval(io, binding)
10
+ @_pdf.render
11
+ end
12
+
13
+ def extension
14
+ :pdfw
15
+ end
16
+
17
+ module ViewHelpers
18
+ def pdf
19
+ @_pdf
20
+ end
21
+ end
22
+
23
+ end
24
+ end
25
+ end
26
+ end
27
+ Mack::Rendering::ViewTemplate.send(:include, Mack::Rendering::Engine::Pdf::ViewHelpers)
28
+ Mack::Rendering::Engine::Registry.instance.register(:action, :pdf)
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mack-pdf_writer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.0
5
+ platform: ruby
6
+ authors:
7
+ - Darsono Sutedja
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-07-16 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: pdf-writer
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - "="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.1.8
23
+ version:
24
+ description: PDF Rendering Engine for Mack Framework
25
+ email: darsono.sutedja@gmail.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
32
+ files:
33
+ - lib/mack-pdf_writer.rb
34
+ - lib/pdf_engine.rb
35
+ - README
36
+ has_rdoc: true
37
+ homepage: http://www.mackframework.com
38
+ post_install_message:
39
+ rdoc_options: []
40
+
41
+ require_paths:
42
+ - lib
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: "0"
49
+ version:
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: "0"
55
+ version:
56
+ requirements: []
57
+
58
+ rubyforge_project: magrathea
59
+ rubygems_version: 1.1.1
60
+ signing_key:
61
+ specification_version: 2
62
+ summary: Rendering Engine
63
+ test_files: []
64
+