From: tamouse mailing lists Date: 2013-01-04T11:49:59+09:00 Subject: Re: Require a ruby project to automatically include the modules in classes defined in the same .rb file On Wed, Jan 2, 2013 at 9:58 PM, Marc Heiler wrote: > I have a global colourizer method, which I use > for ALL my ruby projects and all my ruby classes, > but optionally. I.e. I want to toggle and control > whether to use ansicolours or not. Are you telling us that every class you've written writes output? This seems rather odd -- better to localise that to a specific class which you can switch colouring styles on and off with, rather than make every class do it's own colourised output. Think of Logger -- you can tell it to use a different formatter, and you can easily construct a global Logger object that writes where you wish. Then in your various classes, you call the Logger object and leave it to handle the formatting and writing.