How to architect Rails site that can be edited while running?

Posted by Chris Kimpton on Stack Overflow See other posts from Stack Overflow or by Chris Kimpton
Published on 2011-01-07T13:06:13Z Indexed on 2011/01/08 15:54 UTC
Read the original article Hit count: 383

Filed under:
|

Hi,

I am writing a Rails app that "scrapes/navigates" some other websites and webservices for content. I am using Mechanize and Savon to do the heavylifting.

But given the dynamic nature of the web, I'd like to make my calls to these editable by the admin users of the site - rather than requiring me to release a new version of the site.

The actual scraping thread happens async to the website, using the daemons gem.

My requirements are:

  1. Thinking that the scraping/webservice calling code is quite simple, the easiest route is to make the whole class editable by the admins.
  2. Keep a history of the scraping code - so that we can fairly easily revert if we introduce a problem.
  3. Initially use the code from the file system, but as soon as thats been edited and stored somewhere, to use that code instead.

I am thinking my options are:

  1. Store the code in the db (with a history table for the old versions)
  2. Store the code in a private git repo somewhere and access that for the history/latest versions.

I am thinking the git route might be easiest, given its raison d'etre is to track file history... But perhaps there is a gem/plugin that does all this for me, out of the box?

Thanks in advance for any tips/advice. ~chris

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby