Skip to content

Commit 70b49b6

Browse files
More feedback
1 parent a266aef commit 70b49b6

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

activesupport/lib/active_support/event_reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def clear
192192
#
193193
# Context is reset automatically before and after each request.
194194
#
195-
# A custom context store can be configured via `config.active_support.event_reporter_context_store`.
195+
# A custom context store can be configured via +config.active_support.event_reporter_context_store+.
196196
#
197197
# # config/application.rb
198198
# config.active_support.event_reporter_context_store = CustomContextStore

activesupport/lib/active_support/event_reporter/encoders.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ class EventReporter
1717
# end
1818
# end
1919
#
20+
# Rails.event.subscribe(LogSubscriber)
2021
module Encoders
21-
# Base encoder class that other encoders can inherit from
22+
# Base encoder class that other encoders can inherit from.
2223
class Base
23-
# Encodes an event hash into a serialized format
24+
# Encodes an event hash into a serialized format.
2425
#
2526
# @param event [Hash] The event hash containing name, payload, tags, context, timestamp, and source_location
2627
# @return [String] The encoded event data
@@ -72,6 +73,7 @@ def self.encode(event)
7273
end
7374
end
7475

76+
# EventReporter encoder for serializing events to MessagePack format.
7577
class MessagePack < Base
7678
def self.encode(event)
7779
require "msgpack"

activesupport/lib/active_support/event_reporter/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
module ActiveSupport::EventReporter::TestHelper # :nodoc:
4-
class EventSubscriber
4+
class EventSubscriber # :nodoc:
55
attr_reader :events
66

77
def initialize

activesupport/lib/active_support/railtie.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ class Railtie < Rails::Railtie # :nodoc:
4242
app.reloader.before_class_unload do
4343
ActiveSupport::CurrentAttributes.clear_all
4444
ActiveSupport::ExecutionContext.clear
45+
ActiveSupport.event_reporter.clear_context
4546
end
4647

4748
app.executor.to_run do
4849
ActiveSupport::ExecutionContext.push
50+
ActiveSupport.event_reporter.clear_context
4951
end
5052

5153
app.executor.to_complete do
@@ -69,11 +71,6 @@ class Railtie < Rails::Railtie # :nodoc:
6971
end
7072
end
7173

72-
initializer "active_support.reset_event_reporter_context" do |app|
73-
app.reloader.before_class_unload { ActiveSupport.event_reporter.clear_context }
74-
app.executor.to_run { ActiveSupport.event_reporter.clear_context }
75-
end
76-
7774
initializer "active_support.deprecation_behavior" do |app|
7875
if app.config.active_support.report_deprecations == false
7976
app.deprecators.silenced = true

activesupport/lib/active_support/testing/event_reporter_assertions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ module ActiveSupport
55
module Testing
66
# Provides test helpers for asserting on ActiveSupport::EventReporter events.
77
module EventReporterAssertions
8-
module EventCollector # :nodoc: all
8+
module EventCollector # :nodoc:
99
@subscribed = false
1010
@mutex = Mutex.new
1111

12-
class Event
12+
class Event # :nodoc:
1313
attr_reader :event_data
1414

1515
def initialize(event_data)

0 commit comments

Comments
 (0)