Loading ...
Sorry, an error occurred while loading the content.

if_ruby suggestion: $stdout should have a dummy close method

Expand Messages
  • Tom Link
    Hi, ruby s logger class checks if the log device provides write and close methods. If it doesn t, it assumes it s a filename. The $stdout object defined by
    Message 1 of 1 , Oct 31, 2010
    • 0 Attachment
      Hi,

      ruby's logger class checks if the log device provides write and close
      methods. If it doesn't, it assumes it's a filename.

      The $stdout object defined by if_ruby has a write method but doesn't
      provide a close method. If you do

      Logger.new($stdout)

      you thus get an error.

      My suggestion is to add a dummy close method to avoid this problem.
      The problem could of course also be avoided in ruby by patching the
      $stdout object:

      class << $stdout
      def close
      end
      end

      but that's ugly. Anyway, with that addition the logger can print
      messages to vim so that they can be reviewed with :messages. I suspect
      the method has to be added around line 1248 in if_ruby.c somehow.

      What do you think?

      Regards,
      Tom

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.