diff options
author | Stan Lo <[email protected]> | 2024-02-07 14:59:06 +0000 |
---|---|---|
committer | git <[email protected]> | 2024-02-07 14:59:10 +0000 |
commit | 5f4245e74b84e1435d51f45a43717a5d33aef4cb (patch) | |
tree | 9f90e0cd535c7f05c557c546113523da7abcbe3c /lib/irb/context.rb | |
parent | 164c18af7b4a36dd7f6eea499e297c842ccb1585 (diff) |
[ruby/irb] Polish tracer integration and tests
(https://github.com/ruby/irb/pull/864)
* Remove useless ivar
* Simplify tracer test setup
* Treat tracer like a normal development dependency
* Only require ext/tracer when value is truthy
* Make tracer integration skip IRB traces
https://github.com/ruby/irb/commit/a97a4129a7
Diffstat (limited to 'lib/irb/context.rb')
-rw-r--r-- | lib/irb/context.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/irb/context.rb b/lib/irb/context.rb index 5b8791c3ba..e30125f46b 100644 --- a/lib/irb/context.rb +++ b/lib/irb/context.rb @@ -61,7 +61,7 @@ module IRB @io = nil self.inspect_mode = IRB.conf[:INSPECT_MODE] - self.use_tracer = IRB.conf[:USE_TRACER] if IRB.conf[:USE_TRACER] + self.use_tracer = IRB.conf[:USE_TRACER] self.use_loader = IRB.conf[:USE_LOADER] if IRB.conf[:USE_LOADER] self.eval_history = IRB.conf[:EVAL_HISTORY] if IRB.conf[:EVAL_HISTORY] @@ -162,8 +162,8 @@ module IRB private_constant :KEYWORD_ALIASES def use_tracer=(val) - require_relative "ext/tracer" - @use_tracer = val + require_relative "ext/tracer" if val + IRB.conf[:USE_TRACER] = val end private def build_completor |