lib/xray/middleware.rb in xray-rails-0.1.6 vs lib/xray/middleware.rb in xray-rails-0.1.7
- old
+ new
@@ -59,12 +59,15 @@
# Matches:
# <script src="/assets/jquery.js"></script>
# <script src="/assets/jquery-min.js"></script>
# <script src="/assets/jquery.min.1.9.1.js"></script>
html.sub!(/<script[^>]+\/#{after_script_name}([-.]{1}[\d\.]+)?([-.]{1}min)?\.js[^>]+><\/script>/) do
- h = ActionController::Base.helpers
- "#{$~}\n" + h.javascript_include_tag(script_name)
+ "#{$~}\n" + view_context.javascript_include_tag(script_name)
end
+ end
+
+ def view_context
+ @view_context ||= Rails.application.assets.context_class.new nil, nil, nil
end
def should_inject_xray?(status, headers, response)
status == 200 &&
!empty?(response) &&