lib/ruby-debug.rb in ruby-debug-ide-0.4.6 vs lib/ruby-debug.rb in ruby-debug-ide-0.4.7

- old
+ new

@@ -1,13 +1,19 @@ require 'pp' require 'stringio' require "socket" require 'thread' require 'ruby-debug-base' -require 'ruby-debug/xml_printer' -require 'ruby-debug/processor' -require 'ruby-debug/event_processor' +if RUBY_VERSION < "1.9" + require 'ruby-debug/xml_printer' + require 'ruby-debug/processor' + require 'ruby-debug/event_processor' +else + require_relative 'ruby-debug/xml_printer' + require_relative 'ruby-debug/processor' + require_relative 'ruby-debug/event_processor' +end module Debugger class << self # Prints to the stderr using printf(*args) if debug logging flag (-d) is on. @@ -117,13 +123,13 @@ def start_control(host, port) raise "Debugger is not started" unless started? return if @control_thread @control_thread = DebugThread.new do begin - unless RUBY_PLATFORM =~ /darwin/i # Mac OS X seems to have problem with 'localhost' - host ||= 'localhost' # nil does not seem to work for IPv6, localhost does - end - $stderr.printf "Fast Debugger (ruby-debug-ide 0.4.6) listens on #{host}:#{port}\n" + $stderr.printf "Fast Debugger (ruby-debug-ide 0.4.7) listens on #{host}:#{port}\n" + # 127.0.0.1 seemingly works with all systems and with IPv6 as well. + # "localhost" and nil on have problems on some systems. + host ||= '127.0.0.1' server = TCPServer.new(host, port) while (session = server.accept) begin interface = RemoteInterface.new(session) @event_processor = EventProcessor.new(interface)