Forum: Ruby on Rails Suggestions on automation?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
jasonlee9 (Guest)
on 2005-11-26 19:47
(Received via mailing list)
Hi all,

In continuing with my port from Java to Rails I wanted to ask what
people are using for automated tasks. In our current app we have a
standalone server that pulls RSS feeds everyday and converts them to
the appropriate content types on our system and then another task
fires which goes thru these content types and generates an automated
email message notifying users of any matches for the day.

Currently we're using Spring and Hibernate with Spring's Quartz timer
functionality. I could easily move the firing of the processes
themselves to the appropriate cron jobs (which I'll prob do), but I'd
still like to use AR and whatever else of Rails is necessary to read/
write from the db. Does anyone have a preferred way of doing this so
that I can call a Ruby file and have it use all my existing code and
support from Rails?

Thanks,

- jason
dom (Guest)
on 2005-11-26 20:19
(Received via mailing list)
On Saturday 26 November 2005 17:44, Jason L. wrote:
> functionality. I could easily move the firing of the processes
> themselves to the appropriate cron jobs (which I'll prob do), but I'd
> still like to use AR and whatever else of Rails is necessary to read/
> write from the db. Does anyone have a preferred way of doing this so
> that I can call a Ruby file and have it use all my existing code and
> support from Rails?

Why not write a little Ruby daemon which uses ActiveRecord? You
can use AR outside of Rails. If you don't like that idea you could
put the work into a action which you 'call' by requesting it
when you want the tasks to be performed. You just need to make
your models available to the daemon script.

I have lots of little Ruby daemons which use AR for all sorts
of things.

> Thanks,
>
> - jason
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

HTH,
christopher.k.hall (Guest)
on 2005-11-26 20:27
(Received via mailing list)
cuong.tran (Guest)
on 2005-11-26 20:27
(Received via mailing list)
jasonlee9 (Guest)
on 2005-11-26 20:39
(Received via mailing list)
Hi,

yes, I saw this. However, I'm not really looking to run jobs in the
background or to fork functionality during a webapp. I'm actually
looking to run jobs on a separate machine (altho, the machine is not
really the issue) and to actually include my Rails code into the task
I'm doing. So like cron -> MyTask.rb -> use existing AR objects.
Thanks tho, I'll keep looking.

-jason
cuong.tran (Guest)
on 2005-11-26 21:04
(Received via mailing list)
Yes, if you really the page closely, it describes just that (plus some
more)
(hint: script/runner)
jasonlee9 (Guest)
on 2005-11-26 21:56
(Received via mailing list)
Ok, I'll re-read it again, but more carefully this time. ;) thx.
This topic is locked and can not be replied to.