addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1light-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [ruby-99] How to proceed?

From: Mark
Sent on: Monday, July 26, 2010 7:40 PM
Thanks for the info.

Why does the file changing event have to report to Rails? Does your Rails app have to be actively notified because it has to send out emails or something?

Yes, the Rails app would then send out/store a notification daily/weekly report of what was in the changes.

Basically what you need is some background program that will poll this file you speak of at a set time interval to see if it changed. If the file changed, then you do something. Rails has stuff for that http://www.igvita.com/2007/03/29/scheduling-tasks-in-ruby-rails/

The part I'm curious about is why Rails has to be directly notified. Because if what you're actually doing is changing the content that Rails displays, for example, you don't need to talk to Rails directly. Just directly talk to that content source (say a database) and update it instead of spending effort notifying Rails.

Ok, maybe I used the wrong terminology due to my newbieness. When I said that the code needed to send info back to Rails (which would then store it in the database) I guess the correct terminology is what you said which is to communicate directly to the database. I didn't know you could do that. So you are saying that the code could directly update the database without having to go through a Rails app?

Mark


In that case there are lots of other options too that range from a cron job script to something like Monit to poll (default is every 2 minutes) whether or not a file has changed, then execute some script http://mmonit.com/monit/ <-- Monit has a direct hook into detected file changes, so less messy





On Mon, Jul 26, 2010 at 6:35 PM, Mark <[address removed]> wrote:
I am a fairly new member to RoR community and programming for that matter. I want to create a Rails app that pulls info from a file on a computer every time that file changes.
-So I'm thinking I need to have some code installed on the client computer?
-the installed code would have to be at the admin level incase any user causes the file to change?
-the installed code would then report back to a Rails application after each change of the file
-the program would need to run in the background no matter who is logged in.

Would a Ruby written program be the correct choice on the client computer or should that part of the equation be written in something else?
Anyone see in problems with trying to create this?

Thanks,

Mark



--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/silicon-valley-ruby/
This message was sent by Mark ([address removed]) from Silicon Valley Ruby Meetup.
To learn more about Mark, visit his/her member profile: http://www.meetup.com/silicon-valley-ruby/members/4890954/
To unsubscribe or to update your mailing list settings, click here: http://www.meetup.com/silicon-valley-ruby/settings/
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]






--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by ambert ho ([address removed]) from Silicon Valley Ruby Meetup.
To learn more about ambert ho, visit his/her member profile
To unsubscribe or to update your mailing list settings, click here

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy