Skip to content

Commit a773f43

Browse files
committed
introduce CONFIG.skip_all
`CONFIG.skip_all` is called to ignore cleanup code. fix #552
1 parent 39f21d9 commit a773f43

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

lib/debug/config.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ def self.config
6060
end
6161

6262
def initialize argv
63+
@skip_all = false
64+
6365
if self.class.config
6466
raise 'Can not make multiple configurations in one process'
6567
end
@@ -79,6 +81,14 @@ def []=(key, val)
7981
set_config(key => val)
8082
end
8183

84+
def skip_all
85+
@skip_all = true
86+
end
87+
88+
def skip?
89+
@skip_all
90+
end
91+
8292
def set_config(**kw)
8393
conf = config.dup
8494
kw.each{|k, v|

lib/debug/server_dap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def self.setup debug_port
1818
end
1919

2020
at_exit do
21-
CONFIG[:skip_path] = [//] # skip all
21+
CONFIG.skip_all
2222
FileUtils.rm_rf dir if tempdir
2323
end
2424

lib/debug/thread_client.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
module DEBUGGER__
99
module SkipPathHelper
1010
def skip_path?(path)
11-
!path || skip_internal_path?(path) || (skip_paths = CONFIG[:skip_path]) && skip_paths.any?{|skip_path| path.match?(skip_path)}
11+
CONFIG.skip? || !path ||
12+
skip_internal_path?(path) ||
13+
(skip_paths = CONFIG[:skip_path]) && skip_paths.any?{|skip_path| path.match?(skip_path)}
1214
end
1315

1416
def skip_internal_path?(path)

0 commit comments

Comments
 (0)