def load_properties(properties_filename) properties = {} File.open(properties_filename, 'r') do |properties_file| properties_file.read.each_line do |line| line.strip! if (line[0] != ?# and line[0] != ?=) i = line.index('=') if (i) properties[line[0..i - 1].strip] = line[i + 1..-1].strip else properties[line] = '' end end end end properties end
You need to create an account or log in to post comments to this site.