@@ -7,46 +7,44 @@ class GlobalComponents
77 @test_stats = nil
88 @test_failbot = nil
99
10- class << self
11- # Get the global stats instance
12- # @return [Hooks::Plugins::Instruments::StatsBase] Stats instance for metrics reporting
13- def stats
14- @test_stats || PluginLoader . get_instrument_plugin ( :stats )
15- end
10+ # Get the global stats instance
11+ # @return [Hooks::Plugins::Instruments::StatsBase] Stats instance for metrics reporting
12+ def self . stats
13+ @test_stats || PluginLoader . get_instrument_plugin ( :stats )
14+ end
1615
17- # Get the global failbot instance
18- # @return [Hooks::Plugins::Instruments::FailbotBase] Failbot instance for error reporting
19- def failbot
20- @test_failbot || PluginLoader . get_instrument_plugin ( :failbot )
21- end
16+ # Get the global failbot instance
17+ # @return [Hooks::Plugins::Instruments::FailbotBase] Failbot instance for error reporting
18+ def self . failbot
19+ @test_failbot || PluginLoader . get_instrument_plugin ( :failbot )
20+ end
2221
23- # Set a custom stats instance (for testing)
24- # @param stats_instance [Object] Custom stats instance
25- def stats = ( stats_instance )
26- @test_stats = stats_instance
27- end
22+ # Set a custom stats instance (for testing)
23+ # @param stats_instance [Object] Custom stats instance
24+ def self . stats = ( stats_instance )
25+ @test_stats = stats_instance
26+ end
2827
29- # Set a custom failbot instance (for testing)
30- # @param failbot_instance [Object] Custom failbot instance
31- def failbot = ( failbot_instance )
32- @test_failbot = failbot_instance
33- end
28+ # Set a custom failbot instance (for testing)
29+ # @param failbot_instance [Object] Custom failbot instance
30+ def self . failbot = ( failbot_instance )
31+ @test_failbot = failbot_instance
32+ end
3433
35- # Reset components to default instances (for testing)
36- #
37- # @return [void]
38- def reset
39- @test_stats = nil
40- @test_failbot = nil
41- # Clear and reload default instruments
42- PluginLoader . clear_plugins
43- require_relative "../plugins/instruments/stats"
44- require_relative "../plugins/instruments/failbot"
45- PluginLoader . instance_variable_set ( :@instrument_plugins , {
46- stats : Hooks ::Plugins ::Instruments ::Stats . new ,
47- failbot : Hooks ::Plugins ::Instruments ::Failbot . new
48- } )
49- end
34+ # Reset components to default instances (for testing)
35+ #
36+ # @return [void]
37+ def self . reset
38+ @test_stats = nil
39+ @test_failbot = nil
40+ # Clear and reload default instruments
41+ PluginLoader . clear_plugins
42+ require_relative "../plugins/instruments/stats"
43+ require_relative "../plugins/instruments/failbot"
44+ PluginLoader . instance_variable_set ( :@instrument_plugins , {
45+ stats : Hooks ::Plugins ::Instruments ::Stats . new ,
46+ failbot : Hooks ::Plugins ::Instruments ::Failbot . new
47+ } )
5048 end
5149 end
5250 end
0 commit comments