Skip to content

Commit 468beaf

Browse files
committed
Merge pull request #52 from ruby-debug/symlinks-support
Symlinks support
2 parents cedbc3c + 7ff1560 commit 468beaf

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

lib/ruby-debug-ide/commands/breakpoints.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'pathname' if RUBY_VERSION < '1.9'
2+
13
module Debugger
24
class AddBreakpoint < Command # :nodoc:
35
self.control = true
@@ -35,8 +37,7 @@ def execute
3537
end
3638
file = klass.name if klass
3739
else
38-
file = File.expand_path(file) if file.index(File::SEPARATOR) || \
39-
File::ALT_SEPARATOR && file.index(File::ALT_SEPARATOR)
40+
file = realpath(file)
4041
end
4142
end
4243

@@ -63,6 +64,19 @@ def help(cmd)
6364
}
6465
end
6566
end
67+
68+
private
69+
def realpath(filename)
70+
filename = File.expand_path(filename) if filename.index(File::SEPARATOR) || \
71+
File::ALT_SEPARATOR && filename.index(File::ALT_SEPARATOR)
72+
if defined?(JRUBY_VERSION)
73+
java.io.File.new(filename).canonical_path
74+
elsif RUBY_VERSION < '1.9'
75+
filename
76+
else
77+
File.realpath(filename)
78+
end
79+
end
6680
end
6781

6882
class BreakpointsCommand < Command # :nodoc:

lib/ruby-debug-ide/interface.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def print(*args)
2828

2929
def close
3030
@socket.close
31-
rescue IOError
31+
rescue IOError, SystemCallError
3232
end
3333

3434
# Workaround for JRuby issue http://jira.codehaus.org/browse/JRUBY-2063

lib/ruby-debug-ide/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Debugger
2-
IDE_VERSION='0.4.23.beta2'
2+
IDE_VERSION='0.4.23.beta3'
33
end

0 commit comments

Comments
 (0)