From 0b5094e953531eb36c20e3c32ddd9a742411c0b3 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 12 Dec 2011 14:20:20 -0800 Subject: [PATCH] fix compressors. closes #192 --- features/minify_css.feature | 2 +- features/minify_javascript.feature | 4 ++-- fixtures/passthrough-app/config.rb | 8 ++++---- lib/middleman/extensions/minify_javascript.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/features/minify_css.feature b/features/minify_css.feature index fb35f098..ff1e5889 100644 --- a/features/minify_css.feature +++ b/features/minify_css.feature @@ -26,4 +26,4 @@ Feature: Minify CSS Scenario: Rendering external css with passthrough compressor Given the Server is running at "passthrough-app" When I go to "/stylesheets/site.css" - Then I should see "41" lines \ No newline at end of file + Then I should see "55" lines \ No newline at end of file diff --git a/features/minify_javascript.feature b/features/minify_javascript.feature index adf449e9..6b0e2595 100644 --- a/features/minify_javascript.feature +++ b/features/minify_javascript.feature @@ -30,7 +30,7 @@ Feature: Minify Javascript Scenario: Rendering external js with a passthrough minifier And the Server is running at "passthrough-app" When I go to "/javascripts/js_test.js" - Then I should see "5" lines + Then I should see "8" lines Scenario: Rendering inline js (coffeescript) with the feature enabled Given "minify_javascript" feature is "enabled" @@ -52,4 +52,4 @@ Feature: Minify Javascript Scenario: Rendering external js (coffeescript) with a passthrough minifier And the Server is running at "passthrough-app" When I go to "/javascripts/coffee_test.js" - Then I should see "5" lines \ No newline at end of file + Then I should see "11" lines \ No newline at end of file diff --git a/fixtures/passthrough-app/config.rb b/fixtures/passthrough-app/config.rb index 90386418..1c7fbe6d 100644 --- a/fixtures/passthrough-app/config.rb +++ b/fixtures/passthrough-app/config.rb @@ -1,11 +1,11 @@ -module PassThrough - def self.compile(data) +module ::PassThrough + def self.compress(data) data end end -set :js_compressor, PassThrough -set :css_compressor, PassThrough +set :js_compressor, ::PassThrough +set :css_compressor, ::PassThrough activate :minify_javascript activate :minify_css diff --git a/lib/middleman/extensions/minify_javascript.rb b/lib/middleman/extensions/minify_javascript.rb index 37045549..decc0d10 100755 --- a/lib/middleman/extensions/minify_javascript.rb +++ b/lib/middleman/extensions/minify_javascript.rb @@ -39,7 +39,7 @@ module Middleman::Extensions first = $1 uncompressed_source = $2 last = $3 - minified_js = @compressor.compile(uncompressed_source) + minified_js = @compressor.compress(uncompressed_source) first << minified_js << "\n" << last end