After working for a while on my first non-web based ruby project, I’ve tried to integrate nicely with a number of different components which I was already familiar with within the rails environment like ActiveRecord. Having struggled a bit with the pure approach, I wouldn’t reccomend it.

Instead, what I’m doing is just spinning up an empty rails instance and just ignoring all the web based stuff. That is, I’m not spinning up a passenger instance, my app folder is empty but I can still access everything else inside Rails like:

  • ActiveRecord
  • Migrations and rake tasks
  • ruby script/console so I can interactively poke at the db
  • ruby script/runner to spin up my server
  • All the rails based testing frameworks

So even though it’s a bit more messy, it ends up saving a lot of hassle in the long run. So much for modular design huh?

Responses

  1. Ted Han says:

    February 7th, 2009 at 1:29 pm (#)

    Why aren’t you using DataMapper?

    It’s specifically designed to be stand alone, and covers all of the things that you’ve listed there.

    I’ve used DM for several strictly data related tasks that range from mocking up new app model structures, or to provide access to existing databases, and a lot more.

    And there aren’t any dependencies on a web application framework 🙂

    The syntax is negligibly different, and if you can get over the few best practice type things that DataMapperers dissuade (like STI, which they finally have relented on) then DM will do you fine.

  2. Ted Han says:

    February 7th, 2009 at 5:29 am (#)

    Why aren’t you using DataMapper?

    It’s specifically designed to be stand alone, and covers all of the things that you’ve listed there.

    I’ve used DM for several strictly data related tasks that range from mocking up new app model structures, or to provide access to existing databases, and a lot more.

    And there aren’t any dependencies on a web application framework 🙂

    The syntax is negligibly different, and if you can get over the few best practice type things that DataMapperers dissuade (like STI, which they finally have relented on) then DM will do you fine.

  3. Hang says:

    February 7th, 2009 at 2:04 pm (#)

    Ted, that’s a good point, I’ll check out data mapper.

  4. Hang says:

    February 7th, 2009 at 6:04 am (#)

    Ted, that’s a good point, I’ll check out data mapper.

  5. cheap uggs outlet says:

    October 21st, 2011 at 11:14 am (#)

    Thanks for your opinion. cheap uggs I totally like with it.I like cheap ugg outlet as well and someone is looking for ugg boots outlet People usually prefer ugg boots sale

Leave a Response