Sha256: 768c598846966fa9a173d8c391ef61c16a341027fb506936dd453735005687b8

Contents?: true

Size: 433 Bytes

Versions: 28

Compression:

Stored size: 433 Bytes

Contents

module Sinatra::AssetPack
  class SqwishEngine < Engine
    def css(str, options={})
      cmd = "#{sqwish_bin} %f "
      cmd += "--strict"  if options[:strict]

      _, input = sys :css, str, cmd
      output   = input.gsub(/\.css/, '.min.css')

      File.read(output)
    rescue => e
      nil
    end

    def sqwish_bin
      ENV['SQWISH_PATH'] || "sqwish"
    end
  end

  Compressor.register :css, :sqwish, SqwishEngine
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
sinatra-assetpack-0.3.5 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.3.3 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.3.2 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.3.1 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.3.0 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.8 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.7 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.6 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.5 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.4 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.3 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.2 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.1 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.2.0 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.1.7 lib/sinatra/assetpack/engines/sqwish.rb
sundawg-sinatra-assetpack-fork-0.1.6 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.1.6 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.1.5 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.1.4 lib/sinatra/assetpack/engines/sqwish.rb
sinatra-assetpack-0.1.3 lib/sinatra/assetpack/engines/sqwish.rb