acts_as_flying_saucer 0.0.4 → 0.0.5
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/README.markdown
CHANGED
@@ -33,6 +33,8 @@ It accepts the same options as ActionController::Base#render plus the following
|
|
33
33
|
:password attach password for generated pdf
|
34
34
|
|
35
35
|
:debug_html - (boolean expected) generates html output to the browser for debugging purposes
|
36
|
+
|
37
|
+
:clean It cleans up html using tidy (It uses tidy_ffi gem)
|
36
38
|
|
37
39
|
class FooController < ActionController::Base
|
38
40
|
acts_as_flying_saucer
|
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.summary = %q{XHTML to PDF using Flying Saucer java library}
|
13
13
|
s.description = %q{XHTML to PDF using Flying Saucer java library}
|
14
14
|
s.add_dependency "nailgun"
|
15
|
+
s.add_dependency "tidy_ffi"
|
15
16
|
s.rubyforge_project = "acts_as_flying_saucer"
|
16
17
|
|
17
18
|
s.files = `git ls-files`.split("\n")
|
@@ -2,6 +2,7 @@ require 'acts_as_flying_saucer/config'
|
|
2
2
|
require 'acts_as_flying_saucer/xhtml2pdf'
|
3
3
|
require 'acts_as_flying_saucer/acts_as_flying_saucer_controller'
|
4
4
|
require 'nailgun'
|
5
|
+
require 'tidy_ffi'
|
5
6
|
if defined?(Rails)
|
6
7
|
ActionController::Base.send(:include, ActsAsFlyingSaucer::Controller)
|
7
8
|
elsif defined?(Sinatra)
|
@@ -34,7 +34,7 @@ module ActsAsFlyingSaucer
|
|
34
34
|
# ActionController::Base.asset_host = request.protocol + request.host_with_port if host.blank?
|
35
35
|
#
|
36
36
|
# logger.debug("#{host} - #{host.nil?} - #{ActionController::Base.asset_host}")
|
37
|
-
|
37
|
+
tidy_clean = options[:clean] || false
|
38
38
|
self.pdf_mode = :create
|
39
39
|
if defined?(Rails)
|
40
40
|
html = render_to_string options
|
@@ -55,6 +55,7 @@ module ActsAsFlyingSaucer
|
|
55
55
|
end
|
56
56
|
# saving the file
|
57
57
|
tmp_dir = ActsAsFlyingSaucer::Config.options[:tmp_path]
|
58
|
+
html = TidyFFI::Tidy.new(html).clean if tidy_clean
|
58
59
|
html_digest = Digest::MD5.hexdigest(html)
|
59
60
|
input_file =File.join(File.expand_path("#{tmp_dir}"),"#{html_digest}.html")
|
60
61
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_flying_saucer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 21
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Amar Daxini
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-10-19 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: nailgun
|
@@ -32,6 +31,20 @@ dependencies:
|
|
32
31
|
version: "0"
|
33
32
|
type: :runtime
|
34
33
|
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: tidy_ffi
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
description: XHTML to PDF using Flying Saucer java library
|
36
49
|
email:
|
37
50
|
- amardaxini@gmail.com
|
@@ -55,7 +68,6 @@ files:
|
|
55
68
|
- lib/acts_as_flying_saucer/java/src/encryptPdf.java
|
56
69
|
- lib/acts_as_flying_saucer/version.rb
|
57
70
|
- lib/acts_as_flying_saucer/xhtml2pdf.rb
|
58
|
-
has_rdoc: true
|
59
71
|
homepage: http://rubygems.org/gems/acts_as_flying_saucer
|
60
72
|
licenses: []
|
61
73
|
|
@@ -85,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
97
|
requirements: []
|
86
98
|
|
87
99
|
rubyforge_project: acts_as_flying_saucer
|
88
|
-
rubygems_version: 1.
|
100
|
+
rubygems_version: 1.8.5
|
89
101
|
signing_key:
|
90
102
|
specification_version: 3
|
91
103
|
summary: XHTML to PDF using Flying Saucer java library
|