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
|
||||
module Middleman::Extensions
|
||||
module Middleman
|
||||
module Extensions
|
||||
|
||||
# Minify CSS Extension
|
||||
module MinifyCss
|
||||
|
@ -21,17 +22,16 @@ module Middleman::Extensions
|
|||
end
|
||||
|
||||
# Setup Rack middleware to minify CSS
|
||||
use MinifyCSSRack, :compressor => chosen_compressor,
|
||||
use Rack, :compressor => chosen_compressor,
|
||||
:ignore => ignore,
|
||||
:inline => inline
|
||||
end
|
||||
end
|
||||
alias :included :registered
|
||||
end
|
||||
end
|
||||
|
||||
# Rack middleware to look for CSS and compress it
|
||||
class MinifyCSSRack
|
||||
class Rack
|
||||
|
||||
# Init
|
||||
# @param [Class] app
|
||||
|
@ -85,15 +85,15 @@ module Middleman::Extensions
|
|||
response
|
||||
when Array
|
||||
response.join
|
||||
when Rack::Response
|
||||
when ::Rack::Response
|
||||
response.body.join
|
||||
when Rack::File
|
||||
when ::Rack::File
|
||||
File.read(response.path)
|
||||
else
|
||||
response.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
# Register extension
|
||||
# register :minify_css, MinifyCss
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue