Module: DEBUGGER__::SkipPathHelper

Included in:
Breakpoint, ThreadClient, ThreadClient::Recorder, Tracer
Defined in:
lib/debug/thread_client.rb

Instance Method Summary collapse

Instance Method Details

#skip_config_skip_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/debug/thread_client.rb', line 32

def skip_config_skip_path?(path)
  (skip_paths = CONFIG[:skip_path]) && skip_paths.any?{|skip_path| path.match?(skip_path)}
end

#skip_internal_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/debug/thread_client.rb', line 36

def skip_internal_path?(path)
  path.start_with?(__dir__) || path.delete_prefix('!eval:').start_with?('<internal:')
end

#skip_location?(loc) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
43
# File 'lib/debug/thread_client.rb', line 40

def skip_location?(loc)
  loc_path = loc.absolute_path || "!eval:#{loc.path}"
  skip_path?(loc_path)
end

#skip_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
# File 'lib/debug/thread_client.rb', line 24

def skip_path?(path)
  !path ||
  DEBUGGER__.skip? ||
  ThreadClient.current.management? ||
  skip_internal_path?(path) ||
  skip_config_skip_path?(path)
end