aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-24 22:42:08 +0900
committeraycabta <aycabta@gmail.com>2019-11-24 22:42:08 +0900
commit745ab168185fc8f3c9d9dbd3a2355738776aee6d (patch)
treeab862433f608fc144fde79fdcaf89ec231522e05 /lib
parentb563439274a402e33541f5695b1bfd4ac1085638 (diff)
downloadruby-745ab168185fc8f3c9d9dbd3a2355738776aee6d.tar.gz
Disable tracer ext of IRB when tracer doesn't found
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/ext/tracer.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/irb/ext/tracer.rb b/lib/irb/ext/tracer.rb
index 200f77e341..a1eeff3851 100644
--- a/lib/irb/ext/tracer.rb
+++ b/lib/irb/ext/tracer.rb
@@ -9,7 +9,21 @@
#
#
#
-require "tracer"
+begin
+ raise LoadError
+ require "tracer"
+rescue LoadError
+ $stderr.puts "Tracer extension of IRB is enabled but tracer gem doesn't found."
+ module IRB
+ TracerLoadError = true
+ class Context
+ def use_tracer=(opt)
+ # do nothing
+ end
+ end
+ end
+ return # This is about to disable loading below
+end
module IRB