Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move skipping logic out of Config class #787

Merged
merged 1 commit into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions lib/debug/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ def self.config
end

def initialize argv
@skip_all = false

if self.class.config
raise 'Can not make multiple configurations in one process'
end
Expand Down Expand Up @@ -94,14 +92,6 @@ def []=(key, val)
set_config(key => val)
end

def skip_all
@skip_all = true
end

def skip?
@skip_all
end

def set_config(**kw)
conf = config.dup
kw.each{|k, v|
Expand Down
2 changes: 1 addition & 1 deletion lib/debug/server_cdp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def run_new_chrome
stderr.close

at_exit{
CONFIG.skip_all
DEBUGGER__.skip_all
FileUtils.rm_rf dir
}

Expand Down
2 changes: 1 addition & 1 deletion lib/debug/server_dap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def self.setup debug_port
end

at_exit do
CONFIG.skip_all
DEBUGGER__.skip_all
FileUtils.rm_rf dir if tempdir
end

Expand Down
12 changes: 12 additions & 0 deletions lib/debug/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,18 @@ class << self
end
end

# Exiting control

class << self
def skip_all
@skip_all = true
end

def skip?
@skip_all
end
end

def self.load_rc
[[File.expand_path('~/.rdbgrc'), true],
[File.expand_path('~/.rdbgrc.rb'), true],
Expand Down
2 changes: 1 addition & 1 deletion lib/debug/thread_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module DEBUGGER__
module SkipPathHelper
def skip_path?(path)
!path ||
CONFIG.skip? ||
DEBUGGER__.skip? ||
ThreadClient.current.management? ||
skip_internal_path?(path) ||
skip_config_skip_path?(path)
Expand Down