Skip to content

Instantly share code, notes, and snippets.

@wjessop
Created May 24, 2010 15:21
Show Gist options
  • Save wjessop/84636245a8a839905bfd to your computer and use it in GitHub Desktop.
Save wjessop/84636245a8a839905bfd to your computer and use it in GitHub Desktop.
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