>>>>> "O" == Ollivier Robert <roberto / REMOVETHIS.eu.org> 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 <jgorman / webbysoft.com>
  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