Quoting Mauricio Fernández batsman.geo@yahoo.com:
The following code worked in 1.6.8:
require ‘Mymodule’
include MymoduleThis includes Mymodule in Object (and hence in every Ruby object), are
you sure you want to do that?
This is interesting question. In fact I experienced the error in one of my
FXRuby applications where I add a method to the existing class. AFAIK lot of
FXRuby scripts (including samples) starts with
require ‘fox’
include Fox
Now you have all the Fox classes handy in the common namespace.
Does this mean a possible performance penalty if every object “knows” about all
definitions from the Fox module? Should this be considered as a bad programming
practice?
The right Ruby way should probably be
require ‘fox’
class MyApp
include Fox
…
…
end
which does not generate the error.
Dalibor Sramek