From: ts Date: 2002-10-28T21:22:55+09:00 Subject: Re: Ruby/DBI and remote db (Was: Re: SQLite) >>>>> "O" == Ollivier Robert writes: O> dbh = DBI.connect ("dbi:Pg:#{spamdb}:host=#{host}", "roberto", "", O> 'AutoCommit' => false) Well, it exist no ? ## # parse a string of the form "database=xxx;key=val;..." # or database:host and return hash of key/value pairs # # improved by John Gorman def Utils.parse_params(str) params = str.split(";") hash = {} params.each do |param| key, val = param.split("=") hash[key] = val if key and val end if hash.empty? database, host = str.split(":") hash['database'] = database if database hash['host'] = host if host end hash end Guy Decoux