Hi
I am writing an application where the form data needs to be stored as
xml file. I cannot use data base as I want to provide version
management for this data (currently planning on SVN). The form data is
a perl script file. Users write the perl script in the form and save
it to the server (which gets saved as .pl file). The web UI also
provides a way to execute that file by clicking the execute button. On
the server the file gets executed and output is stored into a log
file. I would like to manage these log files using the web UI
Please help me on how I can create a model for this. Model is not a
data base (I will eventually create a database to store the list of
scripts and their metadata, but the content of the scripts is going to
be in a file)
I need a config variable, that defines where the data can be stored on
the file system. Where can I put this config and how can I access it
DATA_STORAGE = /opt/perlscripts/
How can I use this model to write a CLI program, along with the webUI
(for CLI fans)
Well, you might offer random people $100 so that you can get them to
read through all your specs. Then you can pay someone $5,000 to write
the code for you.
I don't need the model or the code, all I want is the way to store the
data in a file in a directory. How do I keep track of the variables.
The reason why I explained in detail: I looked at other posts and got
suggestions saying why don't you store the data in the database.
That's not going to help me because of the reasons mentioned
I don't need the model or the code, all I want is the way to store the
data in a file in a directory. How do I keep track of the variables.
The reason why I explained in detail: I looked at other posts and got
suggestions saying why don't you store the data in the database.
That's not going to help me because of the reasons mentioned
render to string, then File.new('path/to/file', 'w').print your_string
That's assuming you will only ever do this once per file, and wipe out the file if you need to do it again. Look at the File class for the relevant flags to #open -- there are some that will let you append lines or rewrite an existing file (create it if it's not there) etc.