#!/user/bin/ruby dir = Dir.open("../music/"); file = File.open("../src/loadMusicFiles.js","w"); file.print "function loadMusicFiles(){\n"; file.print "\tvar jsonArray=[];\n"; dir.each{|list| if list.match(".json") && !(list.match("~")) then file.print "\tjsonArray.push(\"music/" + list + "\");\n"; end } file.print "\tcursor.setMAX(jsonArray.length);\n"; file.print "\tfor(var i=0;i