From: "David A. Black" Date: 2008-09-28T09:47:22+09:00 Subject: Re: Help, Ruby 1.8.6-p287 broke my "use" library and I don't know why --1926193751-2083433356-1222562880=:8425 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-2083433356-1222562880=:8425" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-2083433356-1222562880=:8425 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Sun, 28 Sep 2008, Daniel Berger wrote: > On Sep 27, 3:14=A0pm, "David A. Black" wrote: >> Hi Dan -- >> >> On Sun, 28 Sep 2008, Daniel Berger wrote: >>> Hi everyone, >> >>> I need help! >> >>> I've got a library called "use" that let's you mixin methods from modul= es in >>> a fine-grained fashion. Unfortunately, something broke it between Ruby >>> 1.8.6-p111 and Ruby 1.8.6-p287. >> >>> It may have something to do with the way I autogenerate some methods in= the >>> windows-api library, as simple cases still work fine, but I'm not sure = how or >>> why. >> >> Do you have a non-Windows example where it does this? > > Nobu's example summarizes the problem: > > require 'use' > > module X > XXX =3D 1 > def xxx > XXX > end > end > > class Foo > use X > end > > Foo.new.xxx For what it's worth, here's an even simpler example, not involving your "use" library: class Class def myuse(mod) include mod.clone end end module X XXX =3D 1 def xxx XXX end end class Foo myuse X end Foo.new.xxx This works with p230 but not p287. I guess it has to do with module cloning and constants, but I haven't tracked it down beyond that. David --=20 Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates! --1926193751-2083433356-1222562880=:8425-- --1926193751-2083433356-1222562880=:8425--