lib/crush/rainpress.rb in crush-0.2.0 vs lib/crush/rainpress.rb in crush-0.3.0

- old
+ new

@@ -1,15 +1,27 @@ +require "crush/engine" + module Crush + # Engine implementation of the CSS compressor, + # Rainpress. See: + # + # https://rubygems.org/gems/rainpress class Rainpress < Engine + self.default_mime_type = "text/css" + def self.engine_initialized? !!(defined? ::Rainpress) end def initialize_engine require_template_library "rainpress" end - def evaluate - ::Rainpress.compress(data, options) + def prepare + @output = nil + end + + def evaluate(scope, locals, &block) + @output ||= ::Rainpress.compress(data, options) end end end