Marc Heiler wrote in post #1126288:
> Hi,
>
> Yes, but you used include.
>
> I want it to be auto-included on require.

I'd like to know your motivation.  Why do you want it to auto-include 
the module?  Or, more importantly: why do you want it to be in a module?

Compare:

--- foo1.rb -----
module Foo
  def bar() 42; end
end
--- bar1.rb -----
require 'foo1'
include Foo
bar
--- end ---------

--- foo2.rb -----
module Foo
  def bar() 42; end
end
include Foo
--- bar2.rb -----
require 'foo2'
bar
--- end ---------

--- foo3.rb -----
def bar() 42; end
--- bar3.rb -----
require 'foo3'
bar
--- end ---------

But to answer your question: there's no practical way to have an 
include-on-require trigger, because there is no rule that says how many 
modules are defined in a given source file, or what they might be 
called, or whether they might not be reopened pre-existing modules, etc.

-- 
Posted via http://www.ruby-forum.com/.