Ruby on Rails Friday, September 1, 2017

On Fri, Sep 1, 2017 at 9:27 AM, Ben Edwards <login@funkytwig.com> wrote:

> I have writtern a set of ruby scripts that are used to poulate a database
> that I am going to use rails as a front end for users. Curently they are
> stand alone, having there own lib directory and a few classes. These
> scripts are run every night using cron/bash.
>
> I am planing on changing the database to conform to ActiveRecord so rails
> can easily access it but I am wondering if ti is worth moving the scripts
> within rails rather than having them stand alone. If doing this is a good
> idea I dont really know where to start. The key thing is I need to be able
> to scedurle tham to run every night.

Personally I'd recommend having them take advantage of running
in the actual Rails environment, and luckily there's an easy way to
do exactly that:

`rails runner --help`

should get you started.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBtus2tSeqpqvNw2t0pw3AnoLSuH6_6zkSy%3Dv%3DSma_Lig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment