rendered paste body#!/usr/bin/rubyxml = File.new("test.xml","w")[ '<?xml version="1.0" encoding="iso-8859-1" ?>', '<movie width="640" height="480" framerate="40">', ' <background color="#ffffff"/>', ' <frame>', ' <library>"'].each { |line| xml.write line + "\n"}["snd","gfx"].each { |rep| Dir.new(rep).each { |file| next if (file == "." or file == "..") name = file[0...-4] xml.write "\t\t<clip id=\"#{name}\" import=\"./#{rep}/#{file}\"/>\n" }}[ ' </library>', ' </frame>', '</movie>',].each { |line| xml.write line + "\n"}