lib/xray-rails.rb in xray-rails-0.1.16 vs lib/xray-rails.rb in xray-rails-0.1.17
- old
+ new
@@ -11,13 +11,12 @@
module Xray
FILE_PLACEHOLDER = '$file'
# Used to collect request information during each request cycle for use in
# the Xray bar.
- # TODO: there's nothing thread-safe about this. Not sure how big of a deal that is.
def self.request_info
- @request_info ||= {}
+ Thread.current[:request_info] ||= {}
end
# Patterns for the kind of JS constructors Xray is interested in knowing the
# filepath of. Unforunately, these patterns will result in a lot of false
# positives, because we can't only match direct Backbone.View subclasses -
@@ -83,10 +82,10 @@
id = next_id
if source.include?('<!DOCTYPE')
return source
end
# skim doesn't allow html comments, so use skim's comment syntax if it's skim
- if path =~ /\.(skim)(\.|$)/
+ if path =~ /\.(skim|hamlc)(\.|$)/
augmented = "/!XRAY START #{id} #{path}\n#{source}\n/!XRAY END #{id}"
else
augmented = "<!--XRAY START #{id} #{path}-->\n#{source}\n<!--XRAY END #{id}-->"
end
ActiveSupport::SafeBuffer === source ? ActiveSupport::SafeBuffer.new(augmented) : augmented