From: Mike Fletcher Date: 2006-08-09T23:52:34+09:00 Subject: Re: Question on how to source a file with variables in it. Oscar Gon wrote: > Thanks, I took a look at the yaml page but I'm not sure how I would use > that in ruby. I understand the syntax that's used in YAML (I think) but > I'd still be left wondering how to read that into all/any of the ruby > scripts I need. vars.yml url: http://www.example.com/ contact: first: Joe last: Smith Then require 'yaml' data = YAML::load_file( "vars.yml" ) puts "#{ data['contact']['first'] } from #{ data['url'] }" -- Posted via http://www.ruby-forum.com/.