From: <jh...@us...> - 2009-02-06 19:47:36
|
Revision: 75 http://etch.svn.sourceforge.net/etch/?rev=75&view=rev Author: jheiss Date: 2009-02-06 19:47:29 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Work around LibXML's poor handling of non-existent files. Modified Paths: -------------- trunk/server/lib/etchserver.rb Modified: trunk/server/lib/etchserver.rb =================================================================== --- trunk/server/lib/etchserver.rb 2009-02-06 17:43:29 UTC (rev 74) +++ trunk/server/lib/etchserver.rb 2009-02-06 19:47:29 UTC (rev 75) @@ -333,8 +333,15 @@ end @filestack[file] = true + # LibXML doesn't handle attempting to open a non-existent file well + # http://rubyforge.org/tracker/index.php?func=detail&aid=23836&group_id=494&atid=1971 + config_xml_file = File.join(@sourcebase, file, 'config.xml') + if !File.exist?(config_xml_file) + raise "config.xml for #{file} does not exist" + end + # Load the config.xml file - config_xml = LibXML::XML::Document.file(File.join(@sourcebase, file, 'config.xml')) + config_xml = LibXML::XML::Document.file(config_xml_file) # Filter the config.xml file by looking for attributes configfilter!(config_xml.root) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |