Where to put non-rails module in Rails tree?

Hi all -

Suppose I have developed a module that is neither a model or controller
(say, it parses a config file) in plain ruby (non-Rails), where should I
put it within the rails application tree? Also, where would I put the
corresponding unit tests so that rake will run them along with my Rails
tests?

Thanks,

Ken

On 2/14/07, Kenneth L. [email protected] wrote:

Hi all -

Suppose I have developed a module that is neither a model or controller
(say, it parses a config file) in plain ruby (non-Rails), where should I
put it within the rails application tree? Also, where would I put the
corresponding unit tests so that rake will run them along with my Rails
tests?

If it’s part of your biz logic, put it in /app/model (just don’t
inherit from AR::Base).

If it’s an ‘external’ library, add it to /lib, for instance using
svn:externals. Libraries should have their own tests, completely
unrelated to your rails project.

Isak

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs