discourse/lib/source_url.rb
2015-04-16 16:51:49 -04:00

15 lines
303 B
Ruby

class SourceURL < Tilt::Template
self.default_mime_type = 'application/javascript'
def prepare
end
def evaluate(scope, locals, &block)
code = ''
code << 'eval('
code << data.inspect
code << " + \"\\n//@ sourceURL=/#{scope.logical_path}\""
code << ");\n"
code
end
end