Permalink
Browse files

I'm bad at Ruby

  • Loading branch information...
bhollis committed Apr 27, 2012
1 parent a6e577b commit 593cdb27aa9134689fda885b9593a3841b14c3ad
@@ -69,7 +69,7 @@ def call(env)
dirpath = Pathname.new(File.dirname(path))
if path =~ /(^\/$)|(\.(htm|html|php|css|js)$)/
- body = ::Middleman.Util.extract_response_text(response)
+ body = ::Middleman::Util.extract_response_text(response)
if body
# TODO: This regex will change some paths in plan HTML (not in a tag) - is that OK?
@@ -52,7 +52,7 @@ def call(env)
path = env["PATH_INFO"]
if (path.end_with?('.html') || path.end_with?('.php')) && @inline
- uncompressed_source = ::Middleman.Util.extract_response_text(response)
+ uncompressed_source = ::Middleman::Util.extract_response_text(response)
minified = uncompressed_source.gsub(/(<style[^>]*>\s*(?:\/\*<!\[CDATA\[\*\/\n)?)(.*?)((?:(?:\n\s*)?\/\*\]\]>\*\/)?\s*<\/style>)/m) do |match|
first = $1
@@ -67,7 +67,7 @@ def call(env)
headers["Content-Length"] = ::Rack::Utils.bytesize(minified).to_s
response = [minified]
elsif path.end_with?('.css') && @ignore.none? {|ignore| path =~ ignore }
- uncompressed_source = extract_response_text(response)
+ uncompressed_source = ::Middleman::Util.extract_response_text(response)
minified_css = @compressor.compress(uncompressed_source)
headers["Content-Length"] = ::Rack::Utils.bytesize(minified_css).to_s
@@ -54,7 +54,7 @@ def call(env)
begin
if (path.end_with?('.html') || path.end_with?('.php')) && @inline
- uncompressed_source = ::Middleman.Util.extract_response_text(response)
+ uncompressed_source = ::Middleman::Util.extract_response_text(response)
minified = uncompressed_source.gsub(/(<script[^>]*>\s*(?:\/\/(?:(?:<!--)|(?:<!\[CDATA\[))\n)?)(.*?)((?:(?:\n\s*)?\/\/(?:(?:-->)|(?:\]\]>)))?\s*<\/script>)/m) do |match|
first = $1
@@ -76,7 +76,7 @@ def call(env)
headers["Content-Length"] = ::Rack::Utils.bytesize(minified).to_s
response = [minified]
elsif path.end_with?('.js') && @ignore.none? {|ignore| path =~ ignore }
- uncompressed_source = extract_response_text(response)
+ uncompressed_source = ::Middleman::Util.extract_response_text(response)
minified_js = @compressor.compress(uncompressed_source)
headers["Content-Length"] = ::Rack::Utils.bytesize(minified_js).to_s

0 comments on commit 593cdb2

Please sign in to comment.