예제 #1
0
 internal static void ReportWarning(BinaryOpStorage /*!*/ writeStorage, ConversionStorage <MutableString> /*!*/ tosConversion, object message)
 {
     if (writeStorage.Context.Verbose != null)
     {
         var output = writeStorage.Context.StandardErrorOutput;
         // MRI: unlike Kernel#puts this outputs \n even if the message ends with \n:
         var site = writeStorage.GetCallSite("write", 1);
         site.Target(site, output, PrintOps.ToPrintedString(tosConversion, message));
         PrintOps.PutsEmptyLine(writeStorage, output);
     }
 }
예제 #2
0
파일: IoOps.cs 프로젝트: ltwlf/IronSP
        public static int SysWrite(BinaryOpStorage /*!*/ writeStorage, ConversionStorage <MutableString> /*!*/ tosConversion,
                                   RubyContext /*!*/ context, RubyIO /*!*/ self, [NotNull] MutableString /*!*/ val)
        {
            RubyBufferedStream stream = self.GetWritableStream();

            if (stream.DataBuffered)
            {
                PrintOps.ReportWarning(writeStorage, tosConversion, MutableString.CreateAscii("syswrite for buffered IO"));
            }
            int bytes = Write(self, val);

            self.Flush();
            return(bytes);
        }