If you really want to do this (and you’ll probably regret it later, honestly), you can store the scripts in a text column in a DB table and have them “become classes” using Kernel#eval.
Understood. We have worked to remove all Evals as low performance,
and as “debugger unfriendly”.
A work-around comes to mind using a couchDB type “document base” using
Jason that would seem to be faster and less dangerous. Are there any
of these types of document bases “approved” for Heroku? I see only
Amazon RDS mentioned directly.
The unique part of each class is a single method. This method could
be overwritten using a the define_singleton_method (as best I
This would only be in memory, but would seem to be a fast and
otherwise clean work-around (assuming of course the that text can be
safely stored somewhere)
(The text file being written would also be lost under circumstances.)
BTW I tried marshaling the object with Singleton methods to files -
and Ruby will not like this - but the pickAx book points out a way
to do it as I remember.
This all seems more involved than it should be.
Are there, perhaps, Heroku “semi-commercial” programs available where
this is not a problem?
Is this all for security reasons?