summaryrefslogtreecommitdiff
path: root/lib/irb/ext
diff options
context:
space:
mode:
authorStan Lo <[email protected]>2024-02-07 14:59:06 +0000
committergit <[email protected]>2024-02-07 14:59:10 +0000
commit5f4245e74b84e1435d51f45a43717a5d33aef4cb (patch)
tree9f90e0cd535c7f05c557c546113523da7abcbe3c /lib/irb/ext
parent164c18af7b4a36dd7f6eea499e297c842ccb1585 (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/ext')
-rw-r--r--lib/irb/ext/tracer.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/irb/ext/tracer.rb b/lib/irb/ext/tracer.rb
index 53b2e62245..d498b5320b 100644
--- a/lib/irb/ext/tracer.rb
+++ b/lib/irb/ext/tracer.rb
@@ -13,6 +13,13 @@ rescue LoadError
end
module IRB
+ class CallTracer < ::CallTracer
+ IRB_DIR = File.expand_path('../..', __dir__)
+
+ def skip?(tp)
+ super || tp.path.match?(IRB_DIR) || tp.path.match?('<internal:prelude>')
+ end
+ end
class WorkSpace
alias __evaluate__ evaluate
# Evaluate the context of this workspace and use the Tracer library to