wicked_pdf 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/README.md +35 -5
- data/lib/generators/wicked_pdf_generator.rb +11 -0
- data/lib/pdf_helper.rb +42 -14
- data/lib/wicked_pdf.rb +111 -93
- data/lib/wicked_pdf_helper.rb +5 -2
- data/lib/wicked_pdf_railtie.rb +5 -6
- data/lib/wicked_pdf_tempfile.rb +2 -2
- data/test/fixtures/wicked.css +1 -0
- data/test/pdf_helper_test.rb +1 -1
- data/test/wicked_pdf_helper_test.rb +3 -3
- metadata +42 -24
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,7 @@ First, be sure to install [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf/).
|
|
12
12
|
Note that versions before 0.9.0 [have problems](http://code.google.com/p/wkhtmltopdf/issues/detail?id=82&q=vodnik) on some machines with reading/writing to streams.
|
13
13
|
This plugin relies on streams to communicate with wkhtmltopdf.
|
14
14
|
|
15
|
-
More information about [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf/) could be found [here](http://madalgo.au.dk/~jakobt/wkhtmltopdf-0.9.
|
15
|
+
More information about [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf/) could be found [here](http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html).
|
16
16
|
|
17
17
|
Next:
|
18
18
|
|
@@ -39,12 +39,14 @@ Next:
|
|
39
39
|
format.html
|
40
40
|
format.pdf do
|
41
41
|
render :pdf => 'file_name',
|
42
|
-
:template => 'things/show.pdf.erb',
|
42
|
+
:template => 'things/show.pdf.erb',
|
43
43
|
:layout => 'pdf.html', # use 'pdf.html' for a pfd.html.erb file
|
44
44
|
:wkhtmltopdf => '/usr/local/bin/wkhtmltopdf', # path to binary
|
45
45
|
:show_as_html => params[:debug].present?, # allow debuging based on url param
|
46
46
|
:orientation => 'Landscape', # default Portrait
|
47
47
|
:page_size => 'A4, Letter, ...', # default A4
|
48
|
+
:save_to_file => Rails.root.join('pdfs', "#{filename}.pdf"),
|
49
|
+
:save_only => false, # depends on :save_to_file being set first
|
48
50
|
:proxy => 'TEXT',
|
49
51
|
:username => 'TEXT',
|
50
52
|
:password => 'TEXT',
|
@@ -71,7 +73,9 @@ Next:
|
|
71
73
|
:bottom => SIZE,
|
72
74
|
:left => SIZE,
|
73
75
|
:right => SIZE},
|
74
|
-
:header => {:html => {:template => 'users/header.pdf.erb' OR :url
|
76
|
+
:header => {:html => { :template => 'users/header.pdf.erb', # use :template OR :url
|
77
|
+
:url => 'www.example.com',
|
78
|
+
:locals => { :foo => @bar }},
|
75
79
|
:center => 'TEXT',
|
76
80
|
:font_name => 'NAME',
|
77
81
|
:font_size => SIZE,
|
@@ -79,7 +83,9 @@ Next:
|
|
79
83
|
:right => 'TEXT',
|
80
84
|
:spacing => REAL,
|
81
85
|
:line => true},
|
82
|
-
:footer => {:html => {:template => '
|
86
|
+
:footer => {:html => { :template => 'shared/footer.pdf.erb', # use :template OR :url
|
87
|
+
:url => 'www.example.com',
|
88
|
+
:locals => { :foo => @bar }},
|
83
89
|
:center => 'TEXT',
|
84
90
|
:font_name => 'NAME',
|
85
91
|
:font_size => SIZE,
|
@@ -117,6 +123,26 @@ Next:
|
|
117
123
|
|
118
124
|
By default, it will render without a layout (:layout => false) and the template for the current controller and action.
|
119
125
|
|
126
|
+
### Super Advanced Usage ###
|
127
|
+
|
128
|
+
If you need to just create a pdf and not display it:
|
129
|
+
|
130
|
+
# create a pdf from a string
|
131
|
+
pdf = WickedPdf.new.pdf_from_string('<h1>Hello There!</h1>')
|
132
|
+
|
133
|
+
# or from your controller, using views & templates and all wicked_pdf options as normal
|
134
|
+
pdf = render_to_string :pdf => "some_file_name"
|
135
|
+
|
136
|
+
# then save to a file
|
137
|
+
save_path = Rails.root.join('pdfs','filename.pdf')
|
138
|
+
File.open(save_path, 'wb') do |file|
|
139
|
+
file << pdf
|
140
|
+
end
|
141
|
+
|
142
|
+
If you need to display utf encoded characters, add this to your pdf views or layouts:
|
143
|
+
|
144
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
145
|
+
|
120
146
|
### Styles
|
121
147
|
|
122
148
|
You must define absolute path's to CSS files, images, and javascripts; the best option is to use the *wicked_pdf_stylesheet_link_tag*, *wicked_pdf_image_tag*, and *wicked_pdf_javascript_include_tag* helpers.
|
@@ -165,6 +191,10 @@ A bit of javascript can help you number your pages, create a template or header/
|
|
165
191
|
|
166
192
|
Anything with a class listed in "var x" above will be auto-filled at render time.
|
167
193
|
|
194
|
+
If you do not have explicit page breaks (and therefore do not have any "page" class), you can also use wkhtmltopdf's built in page number generation by setting one of the headers to "[page]":
|
195
|
+
|
196
|
+
render :pdf => 'filename', :header => { :right => '[page] of [topage]' }
|
197
|
+
|
168
198
|
### Configuration
|
169
199
|
|
170
200
|
You can put your default configuration, applied to all pdf's at "wicked_pdf.rb" initializer.
|
@@ -191,4 +221,4 @@ You may have noticed: this plugin is heavily inspired by the PrinceXML plugin [p
|
|
191
221
|
|
192
222
|
### Awesome Peoples
|
193
223
|
|
194
|
-
Also, thanks to [galdomedia](http://github.com/galdomedia)
|
224
|
+
Also, thanks to [unixmonkey](https://github.com/Unixmonkey), [galdomedia](http://github.com/galdomedia), [jcrisp](http://github.com/jcrisp), [lleirborras](http://github.com/lleirborras), [tiennou](http://github.com/tiennou), and everyone else for all their hard work and patience with my delays in merging in their enhancements.
|
@@ -0,0 +1,11 @@
|
|
1
|
+
if defined?(Rails) && Rails::VERSION::MAJOR != 2
|
2
|
+
|
3
|
+
# Rails3 generator invoked with 'rails generate wicked_pdf'
|
4
|
+
class WickedPdfGenerator < Rails::Generators::Base
|
5
|
+
source_root(File.expand_path(File.dirname(__FILE__) + "/../../generators/wicked_pdf/templates"))
|
6
|
+
def copy_initializer
|
7
|
+
copy_file 'wicked_pdf.rb', 'config/initializers/wicked_pdf.rb'
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
data/lib/pdf_helper.rb
CHANGED
@@ -1,35 +1,64 @@
|
|
1
1
|
module PdfHelper
|
2
2
|
require 'wicked_pdf'
|
3
|
+
require 'wicked_pdf_tempfile'
|
3
4
|
|
4
5
|
def self.included(base)
|
5
6
|
base.class_eval do
|
6
7
|
alias_method_chain :render, :wicked_pdf
|
8
|
+
alias_method_chain :render_to_string, :wicked_pdf
|
9
|
+
after_filter :clean_temp_files
|
7
10
|
end
|
8
11
|
end
|
9
12
|
|
10
13
|
def render_with_wicked_pdf(options = nil, *args, &block)
|
11
14
|
if options.is_a?(Hash) && options.has_key?(:pdf)
|
12
|
-
|
15
|
+
log_pdf_creation
|
16
|
+
options[:basic_auth] = set_basic_auth
|
13
17
|
make_and_send_pdf(options.delete(:pdf), (WickedPdf.config || {}).merge(options))
|
14
18
|
else
|
15
19
|
render_without_wicked_pdf(options, *args, &block)
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
23
|
+
def render_to_string_with_wicked_pdf(options = nil, *args, &block)
|
24
|
+
if options.is_a?(Hash) && options.has_key?(:pdf)
|
25
|
+
log_pdf_creation
|
26
|
+
options[:basic_auth] = set_basic_auth
|
27
|
+
options.delete :pdf
|
28
|
+
make_pdf((WickedPdf.config || {}).merge(options))
|
29
|
+
else
|
30
|
+
render_to_string_without_wicked_pdf(options, *args, &block)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
19
34
|
private
|
35
|
+
|
36
|
+
def log_pdf_creation
|
37
|
+
logger.info '*'*15 + 'WICKED' + '*'*15
|
38
|
+
end
|
39
|
+
|
40
|
+
def set_basic_auth
|
41
|
+
request.env["HTTP_AUTHORIZATION"].split(" ").last if request.env["HTTP_AUTHORIZATION"]
|
42
|
+
end
|
43
|
+
|
44
|
+
def clean_temp_files
|
45
|
+
if defined?(@hf_tempfiles)
|
46
|
+
@hf_tempfiles.each { |tf| tf.close! }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
20
50
|
def make_pdf(options = {})
|
21
51
|
html_string = render_to_string(:template => options[:template], :layout => options[:layout])
|
52
|
+
options = prerender_header_and_footer(options)
|
22
53
|
w = WickedPdf.new(options[:wkhtmltopdf])
|
23
54
|
w.pdf_from_string(html_string, options)
|
24
55
|
end
|
25
56
|
|
26
|
-
def make_and_send_pdf(pdf_name, options
|
57
|
+
def make_and_send_pdf(pdf_name, options={})
|
27
58
|
options[:wkhtmltopdf] ||= nil
|
28
|
-
options[:layout]
|
29
|
-
options[:template]
|
59
|
+
options[:layout] ||= false
|
60
|
+
options[:template] ||= File.join(controller_path, action_name)
|
30
61
|
options[:disposition] ||= "inline"
|
31
|
-
|
32
|
-
options = prerender_header_and_footer(options)
|
33
62
|
if options[:show_as_html]
|
34
63
|
render :template => options[:template], :layout => options[:layout], :content_type => "text/html"
|
35
64
|
else
|
@@ -44,15 +73,14 @@ module PdfHelper
|
|
44
73
|
def prerender_header_and_footer(options)
|
45
74
|
[:header, :footer].each do |hf|
|
46
75
|
if options[hf] && options[hf][:html] && options[hf][:html][:template]
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
76
|
+
@hf_tempfiles = [] if ! defined?(@hf_tempfiles)
|
77
|
+
@hf_tempfiles.push( tf=WickedPdfTempfile.new("wicked_#{hf}_pdf.html") )
|
78
|
+
tf.write render_to_string(:template => options[hf][:html][:template], :layout => options[:layout], :locals => options[hf][:html][:locals])
|
79
|
+
tf.flush
|
80
|
+
options[hf][:html].delete(:template)
|
81
|
+
options[hf][:html][:url] = "file://#{tf.path}"
|
53
82
|
end
|
54
83
|
end
|
55
|
-
|
56
|
-
return options
|
84
|
+
options
|
57
85
|
end
|
58
86
|
end
|
data/lib/wicked_pdf.rb
CHANGED
@@ -7,6 +7,7 @@ require 'open3'
|
|
7
7
|
require 'active_support/core_ext/class/attribute_accessors'
|
8
8
|
|
9
9
|
require 'wicked_pdf_railtie'
|
10
|
+
require 'wicked_pdf_tempfile'
|
10
11
|
|
11
12
|
class WickedPdf
|
12
13
|
@@config = {}
|
@@ -26,6 +27,9 @@ class WickedPdf
|
|
26
27
|
p "*"*15 + command_for_stdin_stdout + "*"*15 unless defined?(Rails) and Rails.env != 'development'
|
27
28
|
pdf, err = begin
|
28
29
|
Open3.popen3(command_for_stdin_stdout) do |stdin, stdout, stderr|
|
30
|
+
stdin.binmode
|
31
|
+
stdout.binmode
|
32
|
+
stderr.binmode
|
29
33
|
stdin.write(string)
|
30
34
|
stdin.close
|
31
35
|
[stdout.read, stderr.read]
|
@@ -38,108 +42,122 @@ class WickedPdf
|
|
38
42
|
end
|
39
43
|
|
40
44
|
private
|
41
|
-
def parse_options(options)
|
42
|
-
[
|
43
|
-
parse_header_footer(:header => options.delete(:header),
|
44
|
-
:footer => options.delete(:footer),
|
45
|
-
:layout => options[:layout]),
|
46
|
-
parse_toc(options.delete(:toc)),
|
47
|
-
parse_outline(options.delete(:outline)),
|
48
|
-
parse_margins(options.delete(:margin)),
|
49
|
-
parse_others(options),
|
50
|
-
].join(' ')
|
51
|
-
end
|
52
45
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
46
|
+
def parse_options(options)
|
47
|
+
[
|
48
|
+
parse_header_footer(:header => options.delete(:header),
|
49
|
+
:footer => options.delete(:footer),
|
50
|
+
:layout => options[:layout]),
|
51
|
+
parse_toc(options.delete(:toc)),
|
52
|
+
parse_outline(options.delete(:outline)),
|
53
|
+
parse_margins(options.delete(:margin)),
|
54
|
+
parse_others(options),
|
55
|
+
parse_basic_auth(options)
|
56
|
+
].join(' ')
|
57
|
+
end
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
59
|
+
def parse_basic_auth(options)
|
60
|
+
if options[:basic_auth]
|
61
|
+
user, passwd = Base64.decode64(options[:basic_auth]).split(":")
|
62
|
+
"--username #{user} --password #{passwd} "
|
63
|
+
else
|
64
|
+
""
|
65
|
+
end
|
66
|
+
end
|
64
67
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
68
|
+
def make_option(name, value, type=:string)
|
69
|
+
"--#{name.gsub('_', '-')} " + case type
|
70
|
+
when :boolean then ""
|
71
|
+
when :numeric then value.to_s
|
72
|
+
else "'#{value}'"
|
73
|
+
end + " "
|
74
|
+
end
|
75
|
+
|
76
|
+
def make_options(options, names, prefix="", type=:string)
|
77
|
+
names.collect {|o| make_option("#{prefix.blank? ? "" : prefix + "-"}#{o.to_s}", options[o], type) unless options[o].blank?}.join
|
78
|
+
end
|
79
|
+
|
80
|
+
def parse_header_footer(options)
|
81
|
+
r=""
|
82
|
+
[:header, :footer].collect do |hf|
|
83
|
+
unless options[hf].blank?
|
84
|
+
opt_hf = options[hf]
|
85
|
+
r += make_options(opt_hf, [:center, :font_name, :left, :right], "#{hf.to_s}")
|
86
|
+
r += make_options(opt_hf, [:font_size, :spacing], "#{hf.to_s}", :numeric)
|
87
|
+
r += make_options(opt_hf, [:line], "#{hf.to_s}", :boolean)
|
88
|
+
unless opt_hf[:html].blank?
|
89
|
+
r += make_option("#{hf.to_s}-html", opt_hf[:html][:url]) unless opt_hf[:html][:url].blank?
|
90
|
+
end
|
75
91
|
end
|
76
|
-
end
|
77
|
-
|
78
|
-
|
79
|
-
end
|
92
|
+
end unless options.blank?
|
93
|
+
r
|
94
|
+
end
|
80
95
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
96
|
+
def parse_toc(options)
|
97
|
+
unless options.blank?
|
98
|
+
r = make_options(options, [ :font_name, :header_text], "toc")
|
99
|
+
r +=make_options(options, [ :depth,
|
100
|
+
:header_fs,
|
101
|
+
:l1_font_size,
|
102
|
+
:l2_font_size,
|
103
|
+
:l3_font_size,
|
104
|
+
:l4_font_size,
|
105
|
+
:l5_font_size,
|
106
|
+
:l6_font_size,
|
107
|
+
:l7_font_size,
|
108
|
+
:l1_indentation,
|
109
|
+
:l2_indentation,
|
110
|
+
:l3_indentation,
|
111
|
+
:l4_indentation,
|
112
|
+
:l5_indentation,
|
113
|
+
:l6_indentation,
|
114
|
+
:l7_indentation], "toc", :numeric)
|
115
|
+
r +=make_options(options, [ :no_dots,
|
116
|
+
:disable_links,
|
117
|
+
:disable_back_links], "toc", :boolean)
|
118
|
+
end
|
103
119
|
end
|
104
|
-
end
|
105
120
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
121
|
+
def parse_outline(options)
|
122
|
+
unless options.blank?
|
123
|
+
r = make_options(options, [:outline], "", :boolean)
|
124
|
+
r +=make_options(options, [:outline_depth], "", :numeric)
|
125
|
+
end
|
110
126
|
end
|
111
|
-
end
|
112
127
|
|
113
|
-
|
114
|
-
|
115
|
-
|
128
|
+
def parse_margins(options)
|
129
|
+
make_options(options, [:top, :bottom, :left, :right], "margin", :numeric) unless options.blank?
|
130
|
+
end
|
116
131
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
132
|
+
def parse_others(options)
|
133
|
+
unless options.blank?
|
134
|
+
r = make_options(options, [ :orientation,
|
135
|
+
:page_size,
|
136
|
+
:page_width,
|
137
|
+
:page_height,
|
138
|
+
:proxy,
|
139
|
+
:username,
|
140
|
+
:password,
|
141
|
+
:cover,
|
142
|
+
:dpi,
|
143
|
+
:encoding,
|
144
|
+
:user_style_sheet])
|
145
|
+
r +=make_options(options, [ :redirect_delay,
|
146
|
+
:zoom,
|
147
|
+
:page_offset], "", :numeric)
|
148
|
+
r +=make_options(options, [ :book,
|
149
|
+
:default_header,
|
150
|
+
:disable_javascript,
|
151
|
+
:greyscale,
|
152
|
+
:lowquality,
|
153
|
+
:enable_plugins,
|
154
|
+
:disable_internal_links,
|
155
|
+
:disable_external_links,
|
156
|
+
:print_media_type,
|
157
|
+
:disable_smart_shrinking,
|
158
|
+
:use_xserver,
|
159
|
+
:no_background], "", :boolean)
|
160
|
+
end
|
143
161
|
end
|
144
|
-
|
162
|
+
|
145
163
|
end
|
data/lib/wicked_pdf_helper.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module WickedPdfHelper
|
2
|
-
def wicked_pdf_stylesheet_link_tag(
|
3
|
-
|
2
|
+
def wicked_pdf_stylesheet_link_tag(*sources)
|
3
|
+
css_dir = Rails.root.join('public','stylesheets')
|
4
|
+
sources.collect { |source|
|
5
|
+
"<style type='text/css'>#{File.read(css_dir.join(source+'.css'))}</style>"
|
6
|
+
}.join("\n").html_safe
|
4
7
|
end
|
5
8
|
|
6
9
|
def wicked_pdf_image_tag(img, options={})
|
data/lib/wicked_pdf_railtie.rb
CHANGED
@@ -3,25 +3,24 @@ require 'wicked_pdf_helper'
|
|
3
3
|
|
4
4
|
if defined?(Rails)
|
5
5
|
if Rails::VERSION::MAJOR == 2
|
6
|
+
|
6
7
|
unless ActionController::Base.instance_methods.include? "render_with_wicked_pdf"
|
7
8
|
ActionController::Base.send :include, PdfHelper
|
8
9
|
end
|
9
|
-
|
10
10
|
unless ActionView::Base.instance_methods.include? "wicked_pdf_stylesheet_link_tag"
|
11
11
|
ActionView::Base.send :include, WickedPdfHelper
|
12
12
|
end
|
13
|
-
|
14
13
|
Mime::Type.register 'application/pdf', :pdf
|
15
|
-
|
14
|
+
|
16
15
|
else
|
16
|
+
|
17
17
|
class WickedRailtie < Rails::Railtie
|
18
|
-
|
19
18
|
initializer "wicked_pdf.register" do |app|
|
20
19
|
ActionController::Base.send :include, PdfHelper
|
21
20
|
ActionView::Base.send :include, WickedPdfHelper
|
22
|
-
|
23
21
|
Mime::Type.register 'application/pdf', :pdf
|
24
22
|
end
|
25
23
|
end
|
24
|
+
|
26
25
|
end
|
27
|
-
end
|
26
|
+
end
|
data/lib/wicked_pdf_tempfile.rb
CHANGED
@@ -4,7 +4,7 @@ class WickedPdfTempfile < Tempfile
|
|
4
4
|
# Replaces Tempfile's +make_tmpname+ with one that honors file extensions.
|
5
5
|
def make_tmpname(basename, n)
|
6
6
|
extension = File.extname(basename)
|
7
|
-
sprintf("%s_%d_%d%s", File.basename(basename, extension), $$, n, extension)
|
7
|
+
sprintf("%s_%d_%d%s", File.basename(basename, extension), $$, n.to_i, extension)
|
8
8
|
end
|
9
9
|
end
|
10
|
-
|
10
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
/* Wicked styles */
|
data/test/pdf_helper_test.rb
CHANGED
@@ -21,6 +21,6 @@ class PdfHelperTest < ActionController::TestCase
|
|
21
21
|
options = @ac.send( :prerender_header_and_footer,
|
22
22
|
:header => {:html => { :template => 'hf.html.erb'}});
|
23
23
|
assert !options[:header][:html].has_key?(:template)
|
24
|
-
assert_match /^file:\/\/.*
|
24
|
+
assert_match /^file:\/\/.*wicked_header_pdf.*\.html/, options[:header][:html][:url]
|
25
25
|
end
|
26
26
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class WickedPdfHelperTest < ActionView::TestCase
|
4
|
-
test 'wicked_pdf_stylesheet_link_tag should
|
5
|
-
assert_equal
|
6
|
-
wicked_pdf_stylesheet_link_tag('
|
4
|
+
test 'wicked_pdf_stylesheet_link_tag should inline the stylesheets passed in' do
|
5
|
+
assert_equal "<style type='text/css'>/* Wicked styles */\n</style>",
|
6
|
+
wicked_pdf_stylesheet_link_tag('../../vendor/plugins/wicked_pdf/test/fixtures/wicked')
|
7
7
|
end
|
8
8
|
|
9
9
|
test 'wicked_pdf_image_tag should return the same as image_tag when passed a full path' do
|
metadata
CHANGED
@@ -1,39 +1,47 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: wicked_pdf
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 0.7.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Miles Z. Sterret
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
17
|
+
|
18
|
+
date: 2011-05-10 00:00:00 -04:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
|
-
description: ! 'Wicked PDF uses the shell utility wkhtmltopdf to serve a PDF file
|
16
|
-
to a user from HTML.
|
17
21
|
|
22
|
+
description: |
|
23
|
+
Wicked PDF uses the shell utility wkhtmltopdf to serve a PDF file to a user from HTML.
|
18
24
|
In other words, rather than dealing with a PDF generation DSL of some sort,
|
25
|
+
you simply write an HTML view as you would normally, and let Wicked take care of the hard stuff.
|
19
26
|
|
20
|
-
you simply write an HTML view as you would normally, and let Wicked take care of
|
21
|
-
the hard stuff.
|
22
|
-
|
23
|
-
'
|
24
27
|
email: miles.sterrett@gmail.com
|
25
28
|
executables: []
|
29
|
+
|
26
30
|
extensions: []
|
31
|
+
|
27
32
|
extra_rdoc_files: []
|
28
|
-
|
33
|
+
|
34
|
+
files:
|
29
35
|
- README.md
|
30
36
|
- Rakefile
|
31
37
|
- MIT-LICENSE
|
38
|
+
- lib/generators/wicked_pdf_generator.rb
|
32
39
|
- lib/pdf_helper.rb
|
33
40
|
- lib/wicked_pdf.rb
|
34
41
|
- lib/wicked_pdf_helper.rb
|
35
42
|
- lib/wicked_pdf_railtie.rb
|
36
43
|
- lib/wicked_pdf_tempfile.rb
|
44
|
+
- test/fixtures/wicked.css
|
37
45
|
- test/pdf_helper_test.rb
|
38
46
|
- test/test_helper.rb
|
39
47
|
- test/wicked_pdf_helper_test.rb
|
@@ -41,26 +49,36 @@ files:
|
|
41
49
|
has_rdoc: true
|
42
50
|
homepage: http://github.com/mileszs/wicked_pdf
|
43
51
|
licenses: []
|
52
|
+
|
44
53
|
post_install_message:
|
45
54
|
rdoc_options: []
|
46
|
-
|
55
|
+
|
56
|
+
require_paths:
|
47
57
|
- lib
|
48
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
59
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
version: "0"
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
68
|
none: false
|
56
|
-
requirements:
|
57
|
-
- -
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
60
76
|
requirements: []
|
77
|
+
|
61
78
|
rubyforge_project:
|
62
|
-
rubygems_version: 1.
|
79
|
+
rubygems_version: 1.6.2
|
63
80
|
signing_key:
|
64
81
|
specification_version: 3
|
65
82
|
summary: PDF generator (from HTML) plugin for Ruby on Rails
|
66
83
|
test_files: []
|
84
|
+
|