def parse(contents, name, ext)
      hash = case ext
        when *YML_FILE_TYPES
          YAML::load(contents)
        when *XML_FILE_TYPES
          parse_xml(contents, name)
        when *CNF_FILE_TYPES
          RConfig::PropertiesFile.parse(contents)
        else
          raise ConfigError, "Unknown File type: #{ext}"
        end
      hash.freeze
    end
def parse(contents, name, ext)
      hash = case ext
        when *YML_FILE_TYPES
          YAML::load(contents)
        when *XML_FILE_TYPES
          parse_xml(contents, name)
        when *CNF_FILE_TYPES
          RConfig::PropertiesFile.parse(contents)
        else
          raise ConfigError, "Unknown File type: #{ext}"
        end
      hash.freeze
    end
Parses contents of the config file based on file type.
 XML files expect the root element to be the same as the
 file name.