Sourcing files

Hi,

It struck me that you can actually accomplish what the orig poster wants
using eval and DATA. Unconventional, has drawbacks and not what you’d
typically do in his situation but anyway:

$ cat config
x = 1

$ cat c.rb
eval(File.open(“config”) {|f| f.read} + DATA.read)
END

p x

$ ruby -v c.rb
ruby 1.8.0 (2003-02-13) [i386-mingw32]
1

Regards,

Robert Feldt