From: "Rebhan, Gilbert" Date: 2007-03-13T17:15:28+09:00 Subject: Re: YAML.load_file problems Hi, -----Original Message----- From: Stefano Crocco [mailto:stefano.crocco@alice.it] Sent: Monday, March 12, 2007 1:08 PM To: ruby-talk ML Subject: Re: YAML.load_file problems /* First point: your second yaml file contains a mistake: you need to put a space between the key of a hash and the value, so the second line should be CVSEXE: "//foobar/c$/tools/cvsnt/cvs.exe" (note the space after the :) */ thanks for the pointer ! /* At any rate, I don't think you need to use two yaml documents for what you're doing. Simply use a top-level hash, with keys CVSEXE and cvsrepos: --- CVSEXE: "//foobar/c$/tools/cvsnt/cvs.exe" cvsrepos: - test - test1 - foo - bar - foobar YAML.load_file('config.yaml') => "CVSEXE"=>"//foobar/c$/tools/cvsnt/cvs.exe", "cvsrepos"=>["test", "test1", "foo", "bar", "foobar"]} */ yup that works in irb, but not in my script, i think the config.yaml format is ok, but my access of cvsrepos and CVSEXE is wrong = require 'yaml' require "highline/import" YAML.load_file("config.yaml") cvsuser = ask("Enter CVS User: ") {|q| q.default = "#{ENV["USERNAME"]}" q.echo = true} cvspass = ask("Enter your password: ") { |q| q.echo = '*' } cvsrepos.each {|x| puts "Login CVS Repository >> #{x} ..." IO.popen("#{CVSEXE} -d :pserver:#{cvsuser}:#{cvspass}@cvsprod:d:/cvsrepos/#{x} login") } puts "Login successful !!" and config.yaml --- CVSEXE: "//foobar/c$/tools/cvsnt/cvs.exe" cvsrepos: - test - test1 - foo - bar - foobar the shell disappears right after the input of the password, without any further (error)message. Hm, any ideas what's wrong ? I thought YAML would be the recommended way for configfiles in ruby. Or a simple alternative to yaml ? Regards, Gilbert