From: daz Date: 2004-05-14T07:03:59+09:00 Subject: Re: Question regarding rb_include_module Daniel Berger wrote: > > [...] In pure Ruby I would do something like this: > > module Process > def fork > puts "fork!" > end > end > > class Object > include Process > end > > fork # -> "fork!" > > I can't get this to work on the C side, however. I tried this at the > end of "Init_process()": > > rb_include_module(rb_cObject,rb_mProcess); > > But, it didn't seem to work. What am I not seeing? > > Regards, > > Dan > In your example, you define fork as an instance method. In your ext, you defined fork etc. as singleton_methods which are not considered by #include for mixing in; so rb_include_module had nothing to work on (except the VERSION constant). Anyway, you've since fixed that and released it so this is just in case it was still nagging :) BTW: Much credit to yourself, Park Heesob, Shanko et al. for providing these utils. I hope that some of the restructuring was in preparation for submitting fork for inclusion into core. It was one of those eternal things that Ruby had missing in the Windows builds. daz