Ruby on Rails Friday, September 1, 2017

Great, just had a look at this, looks like just the ticket.

So I take it I need to run this from the rails app directory? Where should I put the scripts, vendor maybe?  There is at least one class (regarding screen scraping) that wont be needed from within ruby, where should I put this (currently everything is in a module called scrape so I would put it in the ruby app under lib/scrape, or I could have a lib under vendor.  What would be best proactive.

On Friday, September 1, 2017 at 5:47:37 PM UTC+1, Hassan Schroeder wrote:
On Fri, Sep 1, 2017 at 9:27 AM, Ben Edwards <lo...@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.s...@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/5eb6014c-0deb-4b66-a3f0-bb06f81a18b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment