Permalink
Browse files

fix for ActiveSupport >= 3.0.8 SafeBuffer

  • Loading branch information...
1 parent 5f66f1c commit 2ebee3db9fb99d8e35d94bc51ca1c71c8f4bc90a @mdeering mdeering committed Jul 2, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/pdfkit/pdfkit.rb
  2. +1 −1 spec/pdfkit_spec.rb
View
@@ -103,7 +103,7 @@ def append_stylesheets
stylesheets.each do |stylesheet|
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
@source.to_s.insert(0, style_tag_for(stylesheet))
end
View
@@ -184,7 +184,7 @@
css = File.join(SPEC_ROOT,'fixtures','example.css')
pdfkit.stylesheets << css
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

0 comments on commit 2ebee3d

Please sign in to comment.