Heroku progamming

Hello,

We have a Ruby program that:

  1. Is based on Wee + rack
  2. Accepts input from a browser/client
  3. Generates a text file, which is also a ruby class

Is this an appropriate ‘Ruby’ topic?

If so:

1 Does ‘Heroku’ seem like the best place for such a simple program?
2. There seemed to be issues with simple file saving but we have no
long term interest in RDMS (would use couchDB/JSON)

If it is, can anybody point to potential problems?

Respectfully,

gk

On Tue, Apr 6, 2010 at 10:20 PM, thunk [email protected] wrote:

  1. Generates a text file, which is also a ruby class

Respectfully,

gk

3 will be a problem, you can’t write to Heroku’s file system. When we
deploy
on Heroku, we use Amazon to store files (pictures, mp3s, etc).

On Apr 6, 10:32 pm, Josh C. [email protected] wrote:

We have a Ruby program that:
2. There seemed to be issues with simple file saving but we have no
long term interest in RDMS (would use couchDB/JSON)

If it is, can anybody point to potential problems?

Respectfully,

gk

3 will be a problem, you can’t write to Heroku’s file system. When we deploy
on Heroku, we use Amazon to store files (pictures, mp3s, etc).

Josh,

Your point, is what I remember not being clear about.

Thank you!

On a single user system we are using the following code to load
textfiles into the program as executable classes.

http://gist.github.com/358497

I remain unclear if this can be done on Heroku, and how.

Can the newly created text file be saved to Amazon?

If so, how is this done? (Normal File IO? somehow?)

If we stored the text files into a RDMS, can you think of a way to
become classes in the running program?

Is there a “work-around” to accomplish this somehow?

Thank you!

gk

On Apr 6, 2010, at 9:00 PM, thunk wrote:

If we stored the text files into a RDMS, can you think of a way to
become classes in the running program?

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.

~ j.

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.

~ j.

Thank you!

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
remember).
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 :slight_smile: - 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?

Respectfully,

gk