fix for static files

This commit is contained in:
Matthias Döring 2011-06-02 12:05:09 +02:00
parent a53983e56d
commit 36698f1aba

View file

@ -31,7 +31,11 @@ module Middleman
if env["PATH_INFO"].match(/\.html$/)
compressor = ::Uglifier.new
uncompressed_source = response.join
if response.is_a?(::Rack::File) or response.is_a?(Sinatra::Helpers::StaticFile)
uncompressed_source = File.read(response.path)
else
uncompressed_source = response.join
end
minified = uncompressed_source.gsub(/(<scri.*?\/\/<!\[CDATA\[\n)(.*?)(\/\/\]\].*?<\/script>)/m) do |m|
first = $1