Method: CodeRunner::Run#puts

Defined in:
lib/coderunner/run.rb

#puts(*args) ⇒ Object

Here we redefine the function puts to raise an error if anything is written to standard out while in server mode. This is because the server mode uses standard out to communicate and writing to standard out can break it. All messages, debug information and so on, should always be written to standard error.



202
203
204
205
206
207
208
# File 'lib/coderunner/run.rb', line 202

def puts(*args)
  if @runner and @runner.server
    raise "Writing to stdout in server mode will break things!"
  else
    super(*args)
  end
end