derks/ruby-parseconfig — Issue #3: Config files not closed properly
Author: derks
Created: 2011-12-05 19:25:23+00:00
State: open

Originally posted here:

http://rubyforge.org/tracker/?func=detail&atid=16730&aid=29461&group_id=4356

(Ruby 1.9.3)

The code:

open(self.config_file).each do |line|

keeps the file open.

Code like:

ParseConfig.new("tmp.ini")
FileUtils.rm "tmp.ini"

will fail.

Workaround:

open(self.config_file) { |f| f.each do |line|