Module: Contrast::Framework::Rails::Patch::Support
- Included in:
- Support
- Defined in:
- lib/contrast/framework/rails/patch/support.rb
Overview
Extension point allowing for the registration of Patches required to support the Rails framework.
Instance Method Summary collapse
-
#after_load_patches ⇒ Object
(See BaseSupport#after_load_patches).
-
#before_load_patches! ⇒ Object
(See BaseSupport#before_load_patches!).
Instance Method Details
#after_load_patches ⇒ Object
(See BaseSupport#after_load_patches)
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/contrast/framework/rails/patch/support.rb', line 27 def after_load_patches Set.new([ Contrast::Agent::Patching::Policy::AfterLoadPatch.new( 'ActionController::Live::Buffer', 'contrast/framework/rails/patch/action_controller_live_buffer', instrumenting_module: 'Contrast::Framework::Rails::Patch::ActionControllerLiveBuffer'), Contrast::Agent::Patching::Policy::AfterLoadPatch.new( 'Rails::Application::Configuration', 'contrast/framework/rails/patch/rails_application_configuration', method_to_instrument: :session_store, instrumenting_module: 'Contrast::Framework::Rails::Patch::RailsApplicationConfiguration'), # TODO: RUBY-714 remove w/ EOL of 2.5 # # @deprecated Everything past here is used for Rewriting and can # be removed once we no longer support 2.5. Contrast::Agent::Patching::Policy::AfterLoadPatch.new( 'ActionController::Railties::Helper::ClassMethods', 'contrast/framework/rails/rewrite/action_controller_railties_helper_inherited', method_to_instrument: :inherited, instrumenting_module: 'Contrast::Framework::Rails::Rewrite::ActionControllerRailtiesHelperInherited'), Contrast::Agent::Patching::Policy::AfterLoadPatch.new( 'ActiveRecord::AttributeMethods::Read::ClassMethods', 'contrast/framework/rails/rewrite/active_record_attribute_methods_read', instrumenting_module: 'Contrast::Framework::Rails::Rewrite::ActiveRecordAttributeMethodsRead'), Contrast::Agent::Patching::Policy::AfterLoadPatch.new( 'ActiveRecord::Scoping::Named::ClassMethods', 'contrast/framework/rails/rewrite/active_record_named', instrumenting_module: 'Contrast::Framework::Rails::Rewrite::ActiveRecordNamed'), Contrast::Agent::Patching::Policy::AfterLoadPatch.new( 'ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods', 'contrast/framework/rails/rewrite/active_record_time_zone_inherited', method_to_instrument: :inherited, instrumenting_module: 'Contrast::Framework::Rails::Rewrite::ActiveRecordTimeZoneInherited') ]) end |
#before_load_patches! ⇒ Object
(See BaseSupport#before_load_patches!)
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/contrast/framework/rails/patch/support.rb', line 15 def before_load_patches! return unless defined?(::Rails) # In Rails, session configuration occurs extremely early & only once. # If we defer our patching of the rails session configuration too long # (i.e., where we normally patch) we will miss the configuration # and will never be able to report session misconfiguration rules. Contrast::Framework::Rails::Patch::RailsApplicationConfiguration.instrument require 'contrast/agent/railtie' if ::Rails::VERSION::MAJOR.to_i >= 3 end |