Hey, so I was adding some custom functionality to Ruby's Time class. I
mulled where to place these sorts of customization, finally settling
on the lib directory. All was well for a time. But when I made some
modifications to the file later, the changes weren't propagated upon
page reload. This leads me to believe the lib directory is cached.
This leads to my most direct question: is there a way to clear out
these sorts of cached resources? (Raking tmp:clear and tmp:cache:clear
didn't seem to work.)

However, as long as I'm wasting your reading time anyway, I'm hoping
there's some kind rails guru who could fill me in on best practices in
this situation:

1. When monkeypatching Ruby's built-in classes, is this a good way to
go? (Please reserve any "monkeypatching considered harmful" responses
for question 4, please :-).

2. I named the file "time.rb". Is that advisable? I assume that Ruby
has a file with the same name (the online docs refer to it), but I
don't think my file's going to conflict with it.

3. I included these changes by adding "require 'lib/time'" at the top
of application.rb. Is this a good place for it?

4. I realize monkeypatching is somewhat controversial, so let's assume
I'm inheriting and extending Time instead of monkeypatching it. Would
that change the answers to any of the above?

Thanks very much for any responses!

:Dan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to