class DebuggerXml::Vim::Notification

Public Class Methods

new(command, options) click to toggle source
# File lib/debugger_xml/vim/notification.rb, line 5
def initialize(command, options)
  @command = command
  @executable = options.vim_executable
  @servername = options.vim_servername
  @debug_mode = options.debug_mode
  @logger_file = options.logger_file
end

Public Instance Methods

send() click to toggle source
# File lib/debugger_xml/vim/notification.rb, line 13
def send
  command = ":call RubyDebugger.#{@command}()"
  starter = "<C-\\\\>"
  sys_cmd = "#{@executable} --servername #{@servername} -u NONE -U NONE " +
    "--remote-send \"#{starter}<C-N>#{command}<CR>\""
  log("Executing command: #{sys_cmd}")
  system(sys_cmd);
end

Private Instance Methods

log(string) click to toggle source
# File lib/debugger_xml/vim/notification.rb, line 24
def log(string)
  if @debug_mode
    File.open(@logger_file, 'a') do |f|
      # match vim redir style new lines, rather than trailing
      f << "\ndebugger-xml, #{Time.now.strftime("%H:%M:%S")} : #{string.chomp}"
    end
  end
end