Reading and Writing Configuration Files
require 'yaml' configuration = { 'color' => 'blue', 'font' => 'new romain', 'font-size' => 7 } open('text.cfg', 'w') { |f| YAML.dump(configuration, f) } open('text.cfg') { |f| puts f.read } open('text.cfg') { |f| YAML.load(f) }