Minor minify_css cleanup
This commit is contained in:
parent
072880d79c
commit
2292c32773
1 changed files with 85 additions and 85 deletions
|
@ -1,5 +1,6 @@
|
||||||
# Extensions namespace
|
# Extensions namespace
|
||||||
module Middleman::Extensions
|
module Middleman
|
||||||
|
module Extensions
|
||||||
|
|
||||||
# Minify CSS Extension
|
# Minify CSS Extension
|
||||||
module MinifyCss
|
module MinifyCss
|
||||||
|
@ -21,17 +22,16 @@ module Middleman::Extensions
|
||||||
end
|
end
|
||||||
|
|
||||||
# Setup Rack middleware to minify CSS
|
# Setup Rack middleware to minify CSS
|
||||||
use MinifyCSSRack, :compressor => chosen_compressor,
|
use Rack, :compressor => chosen_compressor,
|
||||||
:ignore => ignore,
|
:ignore => ignore,
|
||||||
:inline => inline
|
:inline => inline
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alias :included :registered
|
alias :included :registered
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Rack middleware to look for CSS and compress it
|
# Rack middleware to look for CSS and compress it
|
||||||
class MinifyCSSRack
|
class Rack
|
||||||
|
|
||||||
# Init
|
# Init
|
||||||
# @param [Class] app
|
# @param [Class] app
|
||||||
|
@ -85,15 +85,15 @@ module Middleman::Extensions
|
||||||
response
|
response
|
||||||
when Array
|
when Array
|
||||||
response.join
|
response.join
|
||||||
when Rack::Response
|
when ::Rack::Response
|
||||||
response.body.join
|
response.body.join
|
||||||
when Rack::File
|
when ::Rack::File
|
||||||
File.read(response.path)
|
File.read(response.path)
|
||||||
else
|
else
|
||||||
response.to_s
|
response.to_s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Register extension
|
end
|
||||||
# register :minify_css, MinifyCss
|
end
|
||||||
end
|
end
|
Loading…
Add table
Add a link
Reference in a new issue