Sha256: eb670c940d082f51304120d3b4a04690a2b5fe89d8ff131370df039187bddca1

Contents?: true

Size: 527 Bytes

Versions: 25

Compression:

Stored size: 527 Bytes

Contents

require 'tilt'

module Sprockets
  class YUICompressor < Tilt::Template
    def self.engine_initialized?
      defined?(::YUI)
    end

    def initialize_engine
      require_template_library 'yui/compressor'
    end

    def prepare
    end

    def evaluate(context, locals, &block)
      case context.content_type
      when 'application/javascript'
        YUI::JavaScriptCompressor.new.compress(data)
      when 'text/css'
        YUI::CssCompressor.new.compress(data)
      else
        data
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 5 rubygems

Version Path
sprockets-2.12.5 lib/sprockets/yui_compressor.rb
arcabouco-0.2.13 vendor/bundle/gems/sprockets-2.12.4/lib/sprockets/yui_compressor.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-2.12.4/lib/sprockets/yui_compressor.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/sprockets-2.12.3/lib/sprockets/yui_compressor.rb
sprockets-2.12.4 lib/sprockets/yui_compressor.rb
sprockets-2.12.3 lib/sprockets/yui_compressor.rb
sprockets-2.11.3 lib/sprockets/yui_compressor.rb
sprockets-2.10.2 lib/sprockets/yui_compressor.rb
sprockets-2.9.4 lib/sprockets/yui_compressor.rb
sprockets-2.8.3 lib/sprockets/yui_compressor.rb
sprockets-2.7.1 lib/sprockets/yui_compressor.rb
sprockets-2.12.2 lib/sprockets/yui_compressor.rb
sprockets-2.12.1 lib/sprockets/yui_compressor.rb
sprockets-2.12.0 lib/sprockets/yui_compressor.rb
sprockets-2.11.0 lib/sprockets/yui_compressor.rb
sprockets-2.10.1 lib/sprockets/yui_compressor.rb
challah-1.0.0 vendor/bundle/gems/sprockets-2.10.0/lib/sprockets/yui_compressor.rb
sprockets-2.10.0 lib/sprockets/yui_compressor.rb
sprockets-2.9.3 lib/sprockets/yui_compressor.rb
sprockets-2.9.2 lib/sprockets/yui_compressor.rb