Skip to content

Commit c555245

Browse files
committed
Add socket filename prefix as well as suffix
1 parent 2ab4d9f commit c555245

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ config set no_color true
501501
* `RUBY_DEBUG_HOST` (`host`): TCP/IP remote debugging: host (default: 127.0.0.1)
502502
* `RUBY_DEBUG_SOCK_PATH` (`sock_path`): UNIX Domain Socket remote debugging: socket path
503503
* `RUBY_DEBUG_SOCK_DIR` (`sock_dir`): UNIX Domain Socket remote debugging: socket directory
504+
* `RUBY_DEBUG_SOCK_PREFIX` (`sock_prefix`): UNIX Domain Socket remote debugging: socket prefix
504505
* `RUBY_DEBUG_SOCK_SUFFIX` (`sock_suffix`): UNIX Domain Socket remote debugging: socket suffix
505506
* `RUBY_DEBUG_LOCAL_FS_MAP` (`local_fs_map`): Specify local fs map
506507
* `RUBY_DEBUG_SKIP_BP` (`skip_bp`): Skip breakpoints if no clients are attached (default: false)

lib/debug/config.rb

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ module DEBUGGER__
4747
sock_path: ['RUBY_DEBUG_SOCK_PATH', "REMOTE: UNIX Domain Socket remote debugging: socket path"],
4848
sock_dir: ['RUBY_DEBUG_SOCK_DIR', "REMOTE: UNIX Domain Socket remote debugging: socket directory"],
4949
sock_suffix: ['RUBY_DEBUG_SOCK_SUFFIX', "REMOTE: UNIX Domain Socket remote debugging: socket suffix"],
50+
sock_prefix: ['RUBY_DEBUG_SOCK_PREFIX', "REMOTE: UNIX Domain Socket remote debugging: socket prefix"],
5051
local_fs_map: ['RUBY_DEBUG_LOCAL_FS_MAP', "REMOTE: Specify local fs map", :path_map],
5152
skip_bp: ['RUBY_DEBUG_SKIP_BP', "REMOTE: Skip breakpoints if no clients are attached", :bool, 'false'],
5253
cookie: ['RUBY_DEBUG_COOKIE', "REMOTE: Cookie for negotiation"],
@@ -498,6 +499,9 @@ def self.unix_domain_socket_dir
498499
def self.create_unix_domain_socket_name_prefix(base_dir = unix_domain_socket_dir)
499500
user = ENV['USER'] || 'UnknownUser'
500501
filename = "ruby-debug-#{user}"
502+
if !CONFIG[:sock_prefix].nil?
503+
filename = "#{CONFIG[:sock_prefix]}-#{filename}"
504+
end
501505
if !CONFIG[:sock_suffix].nil?
502506
filename += "-#{CONFIG[:sock_suffix]}"
503507
end

0 commit comments

Comments
 (0)