-
Website
http://avdi.org/devblog -
Original page
http://avdi.org/devblog/2008/04/01/announcing-ninja-patching/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
bryanl
5 comments · 3 points
-
David Recordon
1 comment · 4 points
-
gambling
3 comments · 2 points
-
'n ddrylliog
4 comments · 1 points
-
joegrossberg
2 comments · 2 points
-
-
Popular Threads
-
RightAWS and SSL Certificates
3 weeks ago · 3 comments
-
Debugging Rule 1: It’s your fault
2 weeks ago · 1 comment
-
Fetching multiple SimpleDB items in a single request
4 weeks ago · 1 comment
-
RightAWS and SSL Certificates
LOOK AT THE DATE MAN!!!!!!!!!!
I think whenever someone mentions monkey patching from now on, I will refer to ninja patching. Sounds a lot better.
I personally favor "slapmethoding", which is entry #3 in _why's Complete List Of Substitute Names For The Maneuver We Now Know To Be Monkeypatching.
http://hackety.org/2007/08/10/myCompleteListOfS...
Thread.new do
while(Module.constants.grep(/Ninja/).empty?)
sleep(1)
end
Ninja.class_eval do
private
def attack!
# Ahah! The ninja is helpless!
end
end
end
end
My apologies, I'm still new to Ruby so I'm sure this could be nicer. I couldn't figure out a decent way to determine if a class is defined (it must be staring me right in the face), and the thread was the only way I could get it to work regardless of the require ordering.
Needless to say I enjoyed this post!
One other thing: I lost my comment the first time I submitted because I was prompted about OpenID. I am not a fan of that behaviour :/
I had to laugh out loud while trying it out and understanding it!
"Objects, silence! Beware of the Ninja!"