Method: HTML5.minify_css

Defined in:
lib/h5-min.rb

.minify_css(text) ⇒ Object



161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/h5-min.rb', line 161

def self.minify_css text
  Tempfile.open('css') do |input|
    input << text
    input.close
    return begin
             `yui-compressor --type css --charset utf-8 #{input.to_path}`
           rescue Errno::ENOENT
             warn "yuicompressor not found; won't minify CSS"
             text
           end
  end  
end