DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

Paul Batum's picture

Unregistered

Feeds

aliases

  • Paul Batum

Paul Batum

1 year ago

in Announcing Ninja-Patching! on Virtuous Code
class ChosenOne
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 :/
Returning? Login