-
Website
http://avdi.org/devblog -
Original page
http://avdi.org/devblog/2008/04/01/announcing-ninja-patching/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
bryanl
4 comments · 3 points
-
François Beausoleil
1 comment · 1 points
-
obiefernandez
1 comment · 2 points
-
gambling
3 comments · 2 points
-
Jakub Narebski
1 comment · 5 points
-
-
Popular Threads
-
Simplicity is Complicated
1 week ago · 25 comments
-
Double-Load Guards in Ruby
2 weeks ago · 4 comments
-
Array-ifying Values
2 weeks ago · 3 comments
-
ISO8601 Dates in Ruby
1 week ago · 2 comments
-
My WebOS Makefile
2 weeks ago · 2 comments
-
Simplicity is Complicated
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!"