Class: BPM::SourceURLProcessor

Inherits:
Sprockets::Processor
  • Object
show all
Defined in:
lib/bpm/pipeline/source_url_processor.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(context, locals) ⇒ Object



7
8
9
10
11
12
# File 'lib/bpm/pipeline/source_url_processor.rb', line 7

def evaluate(context, locals)
  return data if context.environment.mode != :debug
  
  root_path = file.to_s[context.environment.project.root_path.size+1..-1]
  return %(eval(#{data.to_json[0..-2]}\\n//@sourceURL=#{file}");\n)
end