# File lib/inifile.rb, line 137 def read( opts = {} ) filename = opts.fetch(:filename, @filename) encoding = opts.fetch(:encoding, @encoding) return unless File.file? filename mode = (RUBY_VERSION >= '1.9' && encoding) ? "r:#{encoding.to_s}" : 'r' fd = File.open(filename, mode) @content = fd.read parse! self ensure fd.close if fd && !fd.closed? end