Re-opening classes is one of the things that makes ruby great. We  
frequently re-open classes on public libraries and frameworks to wrap  
methods with our own methods to add in-house functionality while not  
altering the core functioning of those libraries.

If you write your code you want to be unmodifiable in an interpreted  
language you need your head examined. This isn't at all ruby-like and  
unless you lock out compiled extensions (bye bye native database  
drivers, etc) then you can't stop people circumventing any protection  
mechanism you come up with either.

Why so precious? If you don't want people to modify your code say so.  
If they go ahead and it blows up it's their fault. If you really did  
write your secure important application you wished to be tamper- 
resistant in ruby then you demanded to host it on your own secure  
servers when you made the contract. If you didn't, you should have.

Think about it...

On 6 May 2006, at 06:26, Ryan Leavengood wrote:

> Cool, this sounds like a plan David. This was exactly what I wanted my
> email to achieve. While we Ruby programmer's love the power and
> flexibility of re-opening classes, there are probably times when we
> all want to lock things down. Having the *option* of doing this
> shouldn't hurt anything, in my opinion.
>
> FYI, I'm not sure if what you propose is possible in pure Ruby (at
> least easily), so if you can hack C you might have to look into making
> a C extension or a patch to the interpreter. Hopefully it won't be so
> bad though.
>
> Regards,
> Ryan
>
> On 5/5/06, David Pollak <pollak / gmail.com> wrote:
>> Ryan,
>>
>> So... "Put your code where your mouth is?"... and given that my  
>> mouth is
>> big, my code should be good (my comments about me, and not  
>> ascribed to
>> you)... :-)
>>
>> I think you're absolutely right!
>>
>> I'll work on some 'lock-down' code that will allow classes to lock
>> themselves down from external modification (not Foo.freeze, but  
>> something
>> more granular.)
>>
>> I'll toss it out to the group and see what people have to say.
>>
>> Thanks,
>>
>> David
>