aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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