fix css minify

This commit is contained in:
tdreyno 2009-11-17 11:02:31 -08:00
parent 73be9b5a34
commit 9880f0f6dc
7 changed files with 37 additions and 5 deletions

0
Rakefile Executable file → Normal file
View file

0
lib/middleman.rb Executable file → Normal file
View file

View file

@ -1,5 +1,9 @@
# Otherwise use YUI
# Fine a way to minify inline/css
::Compass.configuration do |config|
config.output_style = :compressed
class Middleman::Base
after_feature_init do
::Compass.configuration do |config|
config.output_style = :compressed
end
::Compass.configure_sass_plugin!
end
end

View file

@ -1,9 +1,13 @@
# enable :maruku
get "/inline-css.html" do
haml :"inline-css.html", :layout => false
end
get "/inline-js.html" do
haml :"inline-js.html", :layout => false
end
get "/page-class.html" do
haml :"page-classes.html", :layout => false
end

View file

@ -0,0 +1,4 @@
:sass
body
test: style
good: deal

20
spec/minify_css_spec.rb Executable file
View file

@ -0,0 +1,20 @@
require File.join(File.dirname(__FILE__), "spec_helper")
base = ::Middleman::Base
base.set :root, File.join(File.dirname(__FILE__), "fixtures", "sample")
describe "Minify Javascript Feature" do
it "should not minify inline css if off" do
base.disable :minify_css
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
browser.get("/inline-css.html")
browser.last_response.body.chomp.split($/).length.should == 3
end
it "should minify inline css if on" do
base.enable :minify_css
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
browser.get("/inline-css.html")
browser.last_response.body.chomp.split($/).length.should == 1
end
end

0
vendor/gems/environment.rb vendored Executable file → Normal file
View file