Created
August 26, 2013 23:50
-
-
Save wrbs/6348101 to your computer and use it in GitHub Desktop.
Think you ruby likes you. Think again. Load it up into any program and you will have trouble displaying anything to the screen.
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
# Monkeypatching like a boss | |
class Array | |
def do_def(&block) | |
self.each do |method| | |
Kernel.send :define_method, method, &block | |
end | |
end | |
end | |
# Think you can print anything. You must be stupid | |
[:print, :printf, :puts].do_def do | *args | | |
nice_names = ["pony", "fairy"] # Fill in with your own words | |
i = Random.rand(nice_names.length) | |
$stdout.puts "I'm not printing anything for you. Do it yourself you lazy #{nice_names[i]}." | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment