Skip to content

Commit

Permalink
fix for ActiveSupport >= 3.0.8 SafeBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeering committed Jul 2, 2011
1 parent 5f66f1c commit 2ebee3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pdfkit/pdfkit.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def append_stylesheets


stylesheets.each do |stylesheet| stylesheets.each do |stylesheet|
if @source.to_s.match(/<\/head>/) if @source.to_s.match(/<\/head>/)
@source.to_s.gsub!(/(<\/head>)/, style_tag_for(stylesheet)+'\1') @source = Source.new(@source.to_s.gsub(/(<\/head>)/, style_tag_for(stylesheet)+'\1'))
else else
@source.to_s.insert(0, style_tag_for(stylesheet)) @source.to_s.insert(0, style_tag_for(stylesheet))
end end
Expand Down
2 changes: 1 addition & 1 deletion spec/pdfkit_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
css = File.join(SPEC_ROOT,'fixtures','example.css') css = File.join(SPEC_ROOT,'fixtures','example.css')
pdfkit.stylesheets << css pdfkit.stylesheets << css
pdfkit.to_pdf pdfkit.to_pdf
pdfkit.source.to_s.should include("<style>#{File.read(css)}</style><html>") pdfkit.source.to_s.should include("<style>#{File.read(css)}</style></head>")
end end


end end
Expand Down

0 comments on commit 2ebee3d

Please sign in to comment.