Skip to content

Commit 40b3b31

Browse files
committed
Move skipping logic out of Config class
1 parent b5ce120 commit 40b3b31

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

lib/debug/config.rb

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

6565
def initialize argv
66-
@skip_all = false
67-
6866
if self.class.config
6967
raise 'Can not make multiple configurations in one process'
7068
end
@@ -94,14 +92,6 @@ def []=(key, val)
9492
set_config(key => val)
9593
end
9694

97-
def skip_all
98-
@skip_all = true
99-
end
100-
101-
def skip?
102-
@skip_all
103-
end
104-
10595
def set_config(**kw)
10696
conf = config.dup
10797
kw.each{|k, v|

lib/debug/server_cdp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def run_new_chrome
9494
stderr.close
9595

9696
at_exit{
97-
CONFIG.skip_all
97+
DEBUGGER__.skip_all
9898
FileUtils.rm_rf dir
9999
}
100100

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_all
21+
DEBUGGER__.skip_all
2222
FileUtils.rm_rf dir if tempdir
2323
end
2424

lib/debug/session.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ module DEBUGGER__
8888
PresetCommand = Struct.new(:commands, :source, :auto_continue)
8989
class PostmortemError < RuntimeError; end
9090

91+
class << self
92+
def skip_all
93+
@skip_all = true
94+
end
95+
96+
def skip?
97+
@skip_all
98+
end
99+
end
100+
91101
class Session
92102
attr_reader :intercepted_sigint_cmd, :process_group, :subsession_id
93103

lib/debug/thread_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module DEBUGGER__
1818
module SkipPathHelper
1919
def skip_path?(path)
2020
!path ||
21-
CONFIG.skip? ||
21+
DEBUGGER__.skip? ||
2222
ThreadClient.current.management? ||
2323
skip_internal_path?(path) ||
2424
skip_config_skip_path?(path)

0 commit comments

Comments
 (0)