Hi,

Using a Module as Jam suggested is probably the simplest way.

But of course there are also many data formats you can use. I actually 
prefer JSON over YAML, because it's simpler and more "robust". Reading 
and writing works pretty much like with YAML:



require 'json'


config_file = 'config.json'

# write
new_config = {
  name: 'some name',
  address: 'some address'
}
File.open('config.json', 'w') {|f| f << new_config.to_json}

#read
current_config = JSON.parse File.read config_file
puts current_config

-- 
Posted via http://www.ruby-forum.com/.