Skip to content

Commit b719b3e

Browse files
committed
shorten UNIX domain socket name
to allow adding session name.
1 parent 695500f commit b719b3e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/debug/config.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def self.unix_domain_socket_tmpdir
458458
require 'tmpdir'
459459

460460
if tmpdir = Dir.tmpdir
461-
path = File.join(tmpdir, "ruby-debug-sock-#{Process.uid}")
461+
path = File.join(tmpdir, "rdbg-#{Process.uid}")
462462

463463
unless File.exist?(path)
464464
d = Dir.mktmpdir
@@ -471,7 +471,7 @@ def self.unix_domain_socket_tmpdir
471471

472472
def self.unix_domain_socket_homedir
473473
if home = ENV['HOME']
474-
path = File.join(home, '.ruby-debug-sock')
474+
path = File.join(home, '.rdbg-sock')
475475

476476
unless File.exist?(path)
477477
Dir.mkdir(path, 0700)
@@ -495,8 +495,7 @@ def self.unix_domain_socket_dir
495495
end
496496

497497
def self.create_unix_domain_socket_name_prefix(base_dir = unix_domain_socket_dir)
498-
user = ENV['USER'] || 'UnknownUser'
499-
File.join(base_dir, "ruby-debug-#{user}")
498+
File.join(base_dir, "rdbg")
500499
end
501500

502501
def self.create_unix_domain_socket_name(base_dir = unix_domain_socket_dir)

test/console/client_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_gen_sockpath
1010
Client.util("gen-sockpath")
1111
end
1212

13-
assert_match(/ruby-debug-/, output)
13+
assert_match(/rdbg-/, output)
1414
end
1515

1616
def test_list_socks
@@ -19,7 +19,7 @@ def test_list_socks
1919
end
2020

2121
unless output.empty?
22-
assert_match(/ruby-debug-/, output)
22+
assert_match(/rdbg-/, output)
2323
end
2424
end
2525

0 commit comments

Comments
 (0)