lib/contrast/framework/rails_support.rb in contrast-agent-3.10.2 vs lib/contrast/framework/rails_support.rb in contrast-agent-3.11.0
- old
+ new
@@ -31,10 +31,14 @@
return Rails.application.cs__class.parent_module_name if Gem::Version.new(Rails.version) >= RAILS_MODULE_NAME_VERSION
Rails.application.cs__class.parent_name
end
+ def application_root
+ Rails.root
+ end
+
def server_type
'rails'
end
def scan_views
@@ -64,9 +68,21 @@
route = full_route[2] # route w/ highest precedence
return unless route
route_to_coverage(route)
+ end
+
+ def retrieve_request env
+ rails_env = Rails.application.env_config.merge(env)
+ ActionDispatch::Request.new(rails_env || env)
+ end
+
+ AC_INSTANCE = 'action_controller.instance'
+ def streaming? env
+ return false unless defined?(ActionController::Live)
+
+ env[AC_INSTANCE].cs__class.included_modules.include?(ActionController::Live)
end
private
# Convert ActionDispatch::Journey::Route to Contrast::Api::Dtm::RouteCoverage