From: Pete McBreen Date: 2002-03-07T12:37:07+09:00 Subject: Re: Loading ruby file in irb Nelson Wong wrote << wonder how do I load Ruby files at irb on a fly?>> D:\Ruby\bin>ruby irb irb(main):001:0> load "OdometerTest.rb" "012345" "00100000" true irb(main):002:0> exit require "OdometerTest.rb" would do a similar thing but it only loads a file one, whereas load "file.rb" loads the file every time. <> No problem, you can even dynamically add or redefine methods in classes. It is perfectly legal (and very useful) to just give a partial definition of a class at a irb prompt (and in ruby directly) to replace the definition of just that method, or to add a new method... class Odometer def increment @wheels.last.increment end end cheers, Pete ---- Pete McBreen, McBreen.Consulting , Cochrane, AB email: petemcbreen@acm.org http://www.mcbreen.ab.ca/ Author, "Software Craftsmanship The New Imperative" Addison-Wesley (C) 2002 http://www.amazon.com/exec/obidos/ASIN/0201733862 Finalist for the 2002 Jolt Awards