2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

Update SourceURL to work better

This commit is contained in:
Robin Ward 2015-04-16 16:44:24 -04:00
parent e83bf7dc07
commit 788b66e4a3
4 changed files with 18 additions and 3 deletions

15
lib/source_url.rb Normal file
View file

@ -0,0 +1,15 @@
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