title: How do I write to the console regardless of whether or not the user uses `|` or `>` operators on the shell?
body: <p>I wrote a program in Ruby and have been writing all data to the console with <code>puts</code>.</p>
  
  <p>If I run <code>my.rb</code> from the console I can redirect the stream to a file both with <code>&gt;</code> and <code>|</code>.</p>
  
  <p>How should I change stdout in order for data to be written to the Windows console?</p>