Class: Sinatra::AssetPack::SqwishEngine
- Defined in:
- lib/sinatra/assetpack/engines/sqwish.rb
Instance Method Summary collapse
Methods inherited from Engine
Instance Method Details
#css(str, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/sinatra/assetpack/engines/sqwish.rb', line 3 def css(str, ={}) cmd = "#{sqwish_bin} %f " cmd += "--strict" if [:strict] _, input = sys :css, str, cmd output = input.gsub(/\.css/, '.min.css') File.read(output) rescue => e nil end |
#sqwish_bin ⇒ Object
15 16 17 |
# File 'lib/sinatra/assetpack/engines/sqwish.rb', line 15 def sqwish_bin ENV['SQWISH_PATH'] || "sqwish" end |