Skip to content
Open
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
12 changes: 7 additions & 5 deletions lib/debug/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2032,11 +2032,13 @@ class << self
end

def self.load_rc
[[File.expand_path('~/.rdbgrc'), true],
[File.expand_path('~/.rdbgrc.rb'), true],
# ['./.rdbgrc', true], # disable because of security concern
[CONFIG[:init_script], false],
].each{|(path, rc)|
[
[File.expand_path('~/.rdbgrc'), true],
[File.expand_path('~/.rdbgrc.rb'), true],
[File.join(Dir.pwd, '.rdbgrc'), true],
[File.join(Dir.pwd, '.rdbgrc.rb'), true],
[CONFIG[:init_script], false],
].each{|(path, rc)|
next unless path
next if rc && CONFIG[:no_rc] # ignore rc

Expand Down
22 changes: 17 additions & 5 deletions test/console/rdbg_option_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ def test_debugger_stops_immediately
end
end

class RCFileTest < ConsoleTestCase
def rc_filename
File.join(pty_home_dir, ".rdbgrc")
end

module RCFileTests
def rc_script
"config set skip_path /foo/bar/"
end
Expand Down Expand Up @@ -100,6 +96,22 @@ def test_debugger_doesnt_load_the_rc_file_with_no_rc
end
end

class GlobalRCFileTest < ConsoleTestCase
include RCFileTests

def rc_filename
File.join(pty_home_dir, ".rdbgrc")
end
end

class LocalRCFileTest < ConsoleTestCase
include RCFileTests

def rc_filename
File.join(Dir.pwd, ".rdbgrc")
end
end

class InitScriptTest < ConsoleTestCase
TEMPFILE_BASENAME = __FILE__.hash.abs.to_s(16)

Expand Down