mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:29:59 +08:00
15 lines
287 B
Ruby
15 lines
287 B
Ruby
class SourceURL < Tilt::Template
|
|
self.default_mime_type = 'application/javascript'
|
|
|
|
def prepare
|
|
end
|
|
|
|
def evaluate(scope, locals, &block)
|
|
code = "eval("
|
|
code << data.inspect
|
|
code << " + \"\\n//# sourceURL=#{scope.logical_path}\""
|
|
code << ");\n"
|
|
code
|
|
end
|
|
end
|