From: ChrisKaelin Date: 2007-01-31T04:30:06+09:00 Subject: Howto parse or eval a config-file? I'm currently looking for a simple way to parse a configuration file in a ruby-script. Is eval a good way to do that? YAML seems a bit an overkill to learn for such a small task... Thanks in advance for any suggestions. So far I'm doing this: the config-file: Conf = { 'host' => 'localhost', 'title' => 'TIITEL', 'mailhost' => 'mailhost' } the eval-code: begin eval File.new(configFile).read rescue ScriptError=>e warn("An error occurred while reading #{$configFile}: ", e) else $host = Conf['host'] $title = Conf['title'] $mailhost = Conf['mailhost'] end