title: How to suppress deprecation warnings?
body: <p>(This is related to <a href="https://stackoverflow.com/questions/56648847/workaround-flip-flop-deprecated-warning-in-ruby">this</a> question).</p>
  
  <p>How can I suppress deprecation warnings in Ruby, until I find time to update the code? Example: The following command will generated a <em>flip-flop is deprecated</em> warning (the command itself is nonsense; I just wanted to provide a minimal, syntactically correct, example):</p>
  
  <pre><code> ruby -v -e '0 if /a/.../b/'
  </code></pre>
  
  <p>I already tried</p>
  
  <pre><code>ruby -e '$VERBOSE=nil;0 if /a/.../b/'
  </code></pre>
  
  <p>and, after installing the <em>warning</em> gem, </p>
  
  <pre><code> ruby -e 'require "warning";; Warning.ignore(/deprecated/) 0 if /a/.../b/'
  </code></pre>
  
  <p>but the warning is still printed to stderr. I don't want to redirect the whole stderr to the bit bucket, because I don't want to loose important messages.</p>