lib/imgkit/imgkit.rb in imgkit-1.3.0 vs lib/imgkit/imgkit.rb in imgkit-1.3.1
- old
+ new
@@ -122,10 +122,10 @@
rescue # rexml random crash on invalid xml
[]
end
def style_tag_for(stylesheet)
- "<style>#{File.read(stylesheet)}</style>"
+ "<style>#{stylesheet.respond_to?(:read) ? stylesheet.read : File.read(stylesheet)}</style>"
end
def append_stylesheets
raise ImproperSourceError.new('Stylesheets may only be added to an HTML source') if stylesheets.any? && !@source.html?