# Where to put class to run in everything

**URL:** <https://www.ruby-forum.com/t/where-to-put-class-to-run-in-everything/154972>\
**Category:** Ruby\
**Created:** [December 5, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/where-to-put-class-to-run-in-everything/154972 "2008-12-05T18:31:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [December 5, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/where-to-put-class-to-run-in-everything/154972/1 "2008-12-05T18:31:27Z")

</div>

Hey there all,

I am using ruby to run both the processing engine for my companies  
data provider, ruby in most of the housekeeping cron scripts, and ruby  
on rails powers the website. This is all on an Ubuntu linux server.

The thing is, we host a few domain websites that, although very  
different, use a lot of the shared code.

What I would like to do is have all my ruby classes and functions that  
are common to everything be in one location that I can require from.  
I just don’t know how I would use them for things like Rails that has  
all models in one folder, controllers in another, etc…

Anyone have a solution to share?  
thanks

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [December 5, 2008, 7:10pm UTC](https://www.ruby-forum.com/t/where-to-put-class-to-run-in-everything/154972/2 "2008-12-05T19:10:43Z")

</div>

On Sat, Dec 6, 2008 at 2:24 AM, shawn bright [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> are common to everything be in one location that I can require from.  
> I just don’t know how I would use them for things like Rails that has  
> all models in one folder, controllers in another, etc…
> 
> Anyone have a solution to share?  
> thanks

put it in your filesystem at a place everybody has read access to,  
then use the almighty require

---

<div class="post-metadata">

**Author:** ![nephish](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8e7dd6/32.png) [@nephish](https://www.ruby-forum.com/u/nephish)\
**Post date:** [December 5, 2008, 7:51pm UTC](https://www.ruby-forum.com/t/where-to-put-class-to-run-in-everything/154972/3 "2008-12-05T19:51:48Z")

</div>

thanks

On Fri, Dec 5, 2008 at 12:04 PM, Michael F.
