From: ts Date: 2002-01-26T22:24:20+09:00 Subject: Re: Sourcecode dump? >>>>> "O" == Olivier CARRERE writes: O> I would like to do something like this : irb> class Thing irb> def oneMethod irb> end irb> end O> then : irb> Thing.dumpSource("thing.rb") pigeon% cat b.rb #!/usr/bin/ruby require 'iis' class Thing def oneMethod a ||= 0 a += 1 end end f = File.open("thing.rb", "w") Thing.instance_methods.each do |m| f.puts dump Thing, m end pigeon% pigeon% b.rb pigeon% pigeon% cat thing.rb def oneMethod a ||= 0 a = a + 1 end pigeon% iis is a *toy* Guy Decoux