class Sprockets::YUICompressor - sprockets-2.11.3 Documentation

# class Sprockets::YUICompressor

### Public Class Methods

engine_initialized?() click to toggle source

    # File lib/sprockets/yui_compressor.rb, line 5
    def self.engine_initialized?
      defined?(::YUI)
    end

### Public Instance Methods

evaluate(context, locals, &block) click to toggle source

    # File lib/sprockets/yui_compressor.rb, line 16
    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

initialize_engine() click to toggle source

    # File lib/sprockets/yui_compressor.rb, line 9
    def initialize_engine
      require_template_library 'yui/compressor'
    end

prepare() click to toggle source

    # File lib/sprockets/yui_compressor.rb, line 13
    def prepare
    end