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 The UI wireframe looks some thing like this Add New Script (button) Show current Scripts 1.pl Edit Execute Manage-Versions Delete Rename Copy 2.pl Edit Execute Manage-Versions Delete Rename Copy . . . 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) thanks a lot in advance Kiran -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> How can I use this model to write a CLI program,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. gl -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks, that helped me a lot :-) 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 On Sep 12, 6:25 pm, 7stud -- <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > How can I use this model to write a CLI program, > > 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. > > gl > > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sep 13, 2011, at 5:19 AM, maskiran wrote:> Thanks, that helped me a lot :-) > > 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 mentionedrender 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. Walter> > On Sep 12, 6:25 pm, 7stud -- <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> How can I use this model to write a CLI program, >> >> 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. >> >> gl >> >> -- >> Posted viahttp://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails- > talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > . >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Sep 13, 2011 at 1:53 AM, maskiran <maskiran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > >On form submit, save the script to a temp file or an IO object, and use it as a paperclip attachment to a script model. As for the output logging, you can create another model that has the log files as attachments, and is connected to the script model in a one-to-many relationship.> The UI wireframe looks some thing like this > > Add New Script (button) > > Show current Scripts > > 1.pl Edit Execute Manage-Versions Delete Rename Copy > 2.pl Edit Execute Manage-Versions Delete Rename Copy > . > . > . > > 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) > > thanks a lot in advance > > Kiran > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.