discourse/lib/source_url.rb

15 lines
287 B
Ruby
Raw Normal View History

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