Sha256: 2cd10c505008c2fa22f6a9f68038d44fa8e7aa8416fd597c2d375540ea0f7755

Contents?: true

Size: 453 Bytes

Versions: 28

Compression:

Stored size: 453 Bytes

Contents

module Sinatra::AssetPack
  class YuiEngine < Engine
    def initialize
      require 'yui/compressor'
    end

    def js(str, options={})
      YUI::JavaScriptCompressor.new(options).compress(str)
    rescue LoadError
      nil
    end

    def css(str, options={})
      YUI::CssCompressor.new.compress(str)
    rescue Errno::ENOENT
      nil
    end
  end

  Compressor.register :js,  :yui, YuiEngine
  Compressor.register :css, :yui, YuiEngine
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
sinatra-assetpack-0.1.2 lib/sinatra/assetpack/engines/yui.rb
sinatra-assetpack-0.1.1 lib/sinatra/assetpack/engines/yui.rb
sinatra-assetpack-0.1.0 lib/sinatra/assetpack/engines/yui.rb
sinatra-assetpack-flexible-compression-0.0.1 lib/sinatra/assetpack/engines/yui.rb
sundawg-sinatra-assetpack-fork-0.0.12.pre1 lib/sinatra/assetpack/engines/yui.rb
sinatra-assetpack-0.0.12.pre1 lib/sinatra/assetpack/engines/yui.rb
sinatra-assetpack-0.0.11 lib/sinatra/assetpack/engines/yui.rb
sinatra-assetpack-0.0.10 lib/sinatra/assetpack/engines/yui.rb