Skip to content

Commit b00baf0

Browse files
committed
Pass show_code: false to binding.irb if available
1 parent fb67374 commit b00baf0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

debug.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
2727
spec.require_paths = ["lib"]
2828
spec.extensions = ['ext/debug/extconf.rb']
2929

30-
spec.add_dependency "irb", ">= 1.3.6" # for its color_printer class, which was added after 1.3
30+
spec.add_dependency "irb", ">= 1.5.0" # for binding.irb(show_code: false)
3131
spec.add_dependency "reline", ">= 0.3.1"
3232
end

lib/debug/thread_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,9 @@ def wait_next_action_
986986
when :call
987987
result = frame_eval(eval_src)
988988
when :irb
989+
require 'irb' # prelude's binding.irb doesn't have show_code option
989990
begin
990-
result = frame_eval('binding.irb', binding_location: true)
991+
result = frame_eval('binding.irb(show_code: false)', binding_location: true)
991992
ensure
992993
# workaround: https://github.com/ruby/debug/issues/308
993994
Reline.prompt_proc = nil if defined? Reline

0 commit comments

Comments
 (0)