mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-04 21:01:27 -05:00
15 lines
303 B
Ruby
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
|