From: Ryan Davis Date: 2008-02-13T17:10:14+09:00 Subject: Re: ERB: import function On Feb 12, 2008, at 3:48 PM, Alvaro Bautista wrote: > def import(fn) > e = "" > File.open(fn) do |f| > e = ERB.new(f.read) > end > e.result > end I can't help you with your actual problem, but I can suggest how to simplify the code: def import path ERB.new(File.read(path)).result end I doubt that'll have any impact on the problem at hand, and it won't affect the performance by much, but it is entirely comprehensible at a glance and I think that counts for a lot.