Skip to content

Instantly share code, notes, and snippets.

@rkh
Created February 21, 2014 07:45
Show Gist options
  • Save rkh/9130314 to your computer and use it in GitHub Desktop.
Save rkh/9130314 to your computer and use it in GitHub Desktop.
Run Ruby with warnings enabled. Without going crazy.
require 'delegate'
module Support
class WarningFilter < DelegateClass(IO)
def write(line)
super if line !~ /^\S+gems\/ruby\-\S+:\d+: warning:/
end
end
end
$stderr = Support::WarningFilter.new($stderr)
@rtlong
Copy link

rtlong commented Feb 17, 2015

THANK YOU!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment