Class: Baren::PossibleBinaryDirectiveProcessor

Inherits:
Sprockets::DirectiveProcessor
  • Object
show all
Defined in:
lib/baren.rb

Overview

workaround for the problem about Sprockets::DirectiveProcessor parsing binary (png)

Instance Method Summary collapse

Instance Method Details

#evaluate(context, locals, &block) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/baren.rb', line 47

def evaluate(context, locals, &block)
  if @directive_parser
    super
  else
    data
  end
end

#prepareObject



41
42
43
44
45
# File 'lib/baren.rb', line 41

def prepare
  if !data.respond_to?(:valid_encoding?) || data.valid_encoding?
    super
  end
end