Sha256: a1617ac23228a47eb777e0e00821a0a42f0011e7d79e981efb4487c831a3d23b

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

module Debugger
  module Xml
    module Vim
      class Notification

        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

        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

          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

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
debugger-xml-0.3.3 lib/debugger/xml/vim/notification.rb
debugger-xml-0.3.2 lib/debugger/xml/vim/notification.rb
debugger-xml-0.3.1 lib/debugger/xml/vim/notification.rb
debugger-xml-0.2.0 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.9 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.8 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.7 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.6 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.5 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.4 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.3 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.2 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.1 lib/debugger/xml/vim/notification.rb
debugger-xml-0.1.0 lib/debugger/xml/vim/notification.rb