Skip to content

Commit

Permalink
RUBY_DEBUG_LAZY boot option
Browse files Browse the repository at this point in the history
With `RUBY_DEBUG_LAZY=1`, `require 'debug'` doesn't start a session
but start when `debugger` method is called (or `require 'debug/start'`
is called).

This feature is experimental.
#797
  • Loading branch information
ko1 committed Dec 2, 2022
1 parent d32b157 commit 31cb9ee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/debug.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# frozen_string_literal: true

require_relative 'debug/session'
return unless defined?(DEBUGGER__)
DEBUGGER__::start no_sigint_hook: true, nonstop: true
if ENV['RUBY_DEBUG_LAZY']
require_relative 'debug/prelude'
else
require_relative 'debug/session'
return unless defined?(DEBUGGER__)
DEBUGGER__::start no_sigint_hook: true, nonstop: true
end

0 comments on commit 31cb9ee

Please sign in to comment.