lib/virtualbox/command.rb in virtualbox-0.4.3 vs lib/virtualbox/command.rb in virtualbox-0.5.0

- old
+ new

@@ -12,9 +12,22 @@ # class Command @@vboxmanage = "VBoxManage" class <<self + # Reads the XML file and returns a Nokogiri document. Reads the XML data + # from the specified file and returns a Nokogiri document. + # + # @param [String] File name. + # @return [Nokogiri::XML::Document] + def parse_xml(filename) + f = File.open(filename, "r") + result = Nokogiri::XML(f) + f.close + + result + end + # Returns true if the last run command was a success. Obviously this # will introduce all sorts of thread-safe problems. Those will have to # be addressed another time. def success? $?.to_i == 0 \ No newline at end of file