Module: Contrast::Framework::BaseSupport
- Included in:
- Grape::Support, Rack::Support, Rails::Support, Sinatra::Support
- Defined in:
- lib/contrast/framework/base_support.rb
Overview
The API for all subclasses to implement to correctly support a given framework
Instance Method Summary collapse
-
#after_load_patches ⇒ Set<Contrast::Agent::Patching::Policy::AfterLoadPatch>?
Some Frameworks require specific patching for their classes to handle functionality like routing.
- #application_name ⇒ Object
-
#before_load_patches! ⇒ Object
Some Frameworks require specific patching for their classes to handle functionality like configuration scanning.
-
#collect_routes ⇒ Array<Contrast::Agent::Reporting::DiscoveredRoute>
Find all the predefined routes for this application.
- #current_route_coverage ⇒ Object
-
#detection_class ⇒ Object
The top level module name used by the framework.
- #retrieve_request(_env) ⇒ Object
- #server_type ⇒ Object
-
#streaming?(_env) ⇒ Boolean
We only support websockets in rails right now, so we won’t detect streaming in any other framework.
- #version ⇒ Object
Instance Method Details
#after_load_patches ⇒ Set<Contrast::Agent::Patching::Policy::AfterLoadPatch>?
Some Frameworks require specific patching for their classes to handle functionality like routing. To accommodate this, this method provides a place to register those patches for invocation in our AfterLoadPatcher flow.
By default, and hopefully in all cases, we won’t need these patches, so we’re allowing nil here rather than raising an exception.
69 |
# File 'lib/contrast/framework/base_support.rb', line 69 def after_load_patches; end |
#application_name ⇒ Object
22 23 24 |
# File 'lib/contrast/framework/base_support.rb', line 22 def application_name raise(NoMethodError, 'Subclasses of BaseSupport should implement this method') end |
#before_load_patches! ⇒ Object
Some Frameworks require specific patching for their classes to handle functionality like configuration scanning. To accommodate this, this method provides a place to register those patches for invocation on Agent load.
By default, and hopefully in all cases, we won’t need these patches, so we’re allowing nil here rather than raising an exception.
56 |
# File 'lib/contrast/framework/base_support.rb', line 56 def before_load_patches!; end |
#collect_routes ⇒ Array<Contrast::Agent::Reporting::DiscoveredRoute>
Find all the predefined routes for this application
35 36 37 |
# File 'lib/contrast/framework/base_support.rb', line 35 def collect_routes raise(NoMethodError, 'Subclasses of BaseSupport should implement this method') end |
#current_route_coverage ⇒ Object
40 41 42 |
# File 'lib/contrast/framework/base_support.rb', line 40 def current_route_coverage raise(NoMethodError, 'Subclasses of BaseSupport should implement this method') end |
#detection_class ⇒ Object
The top level module name used by the framework
12 13 14 |
# File 'lib/contrast/framework/base_support.rb', line 12 def detection_class raise(NoMethodError('Subclasses of BaseSupport should implement this method')) end |
#retrieve_request(_env) ⇒ Object
45 46 47 |
# File 'lib/contrast/framework/base_support.rb', line 45 def retrieve_request _env raise(NoMethodError, 'Subclasses of BaseSupport should implement this method') end |
#server_type ⇒ Object
27 28 29 |
# File 'lib/contrast/framework/base_support.rb', line 27 def server_type raise(NoMethodError, 'Subclasses of BaseSupport should implement this method') end |
#streaming?(_env) ⇒ Boolean
We only support websockets in rails right now, so we won’t detect streaming in any other framework
73 74 75 |
# File 'lib/contrast/framework/base_support.rb', line 73 def streaming? _env false end |
#version ⇒ Object
17 18 19 |
# File 'lib/contrast/framework/base_support.rb', line 17 def version raise(NoMethodError('Subclasses of BaseSupport should implement this method')) end |