Guest User

Untitled

a guest
May 26th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. class IO
  2. alias :old_puts puts
  3.  
  4. def puts(thing)
  5. if not thing.to_s.match(/\A\*\* Erubis [\d|\.]+\Z/)
  6. return old_puts(thing)
  7. end
  8. end
  9. end
  10.  
  11. $stdout.puts "foo"
  12. $stdout.puts "** Erubis 2.3.4"
  13. $stdout.puts "bar"
  14.  
  15. =======================
  16.  
  17. pleb:~ will$ ruby puts.rb
  18. foo
  19. bar
Add Comment
Please, Sign In to add comment