Forum: Ruby on Rails where to put non-rails module in Rails tree?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cfda8d3a956b6bf4b73f8fc2132da051?d=identicon&s=25 Kenneth Liu (Guest)
on 2007-02-14 15:45
(Received via mailing list)
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
5233478c51a92b6a1a5c970cbf3a42f3?d=identicon&s=25 Isak Hansen (Guest)
on 2007-02-14 16:00
(Received via mailing list)
On 2/14/07, Kenneth Liu <ken.liu.pub@gmail.com> 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 topic is locked and can not be replied to.