>
http://avdi.org/devblog/?p=18
> Monkeypatching has become the hip thing to do in the
> Ruby and (especially?) Rails communities, and it has
> reached the point where experienced programmers are
> turning to it as the tool of first resort *even* when there
> is a simpler, more traditional solution available. I
> suggest that it's time for Ruby hackers to start setting a
> better example.
I don't know what "Aspect Oriented Programming" (and please don't try the
standard explanations - they don't work on me, any more than "OO is about
modeling the Real World in objects...").
I want this:
module MyModule
class ::String
def inspect
return 'shock the monkey'
end
end
end
I want .inspect, or whatever, outside my module, to behave normally. But if
you inspect a string while my module is above you on the call stack, I get
my hotwired version of .inspect.
Does anyone have a Ruby Hack which does that yet? How hard would it be?
--
Phlip
http://assert2.rubyforge.org/