Ryan Davis
2/13/2008 8:10:00 AM
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.