Created
May 24, 2010 15:31
-
-
Save wjessop/412009 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IO | |
alias :old_puts puts | |
def puts(thing) | |
if not thing.to_s.match(/\A\*\* Erubis [\d|\.]+\Z/) | |
return old_puts(thing) | |
end | |
end | |
end | |
$stdout.puts "foo" | |
$stdout.puts "** Erubis 2.3.4" | |
$stdout.puts "bar" | |
======================= | |
pleb:~ will$ ruby puts.rb | |
foo | |
bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or just pipe yer output through grep and do away with patching a core class.