From: Brian Candler Date: 2009-08-10T22:22:26+09:00 Subject: Re: Reading contents of a file and storing A lot of people use YAML, a different format like this: url: http://localhost emailid: User@htmdec.com password: "12345678" browser: iexplore However personally I dislike YAML because it's very data-sensitive (note the need for quotes around the password above) and sometimes buggy. If you google for "ruby ini file" you'll find some code which probably does what you need. Otherwise, it's pretty easy to roll your own: conf = {} File.open("conf.ini") do |source| source.each_line do |line| if line =~ /^(\w+)\s*=\s*"(.*)"\s*$/ conf[$1] = $2 end end end Here I build a Hash, so you can access it as conf['url'] But you could build an OpenStruct instead (look at ostruct.rb) so you could access it as conf.url -- Posted via http://www.ruby-forum.com/.