Mercurial > hg > Members > e105711
view webGL/ruby/directoryReader.rb @ 17:1e8fa3c370ab draft
make select music scene
author | e105711 <yomitan.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 03 Jul 2012 23:39:21 +0900 |
parents | b322a8557f93 |
children |
line wrap: on
line source
#!/user/bin/ruby dir = Dir.open("../music/"); file = File.open("../src/loadMusicFiles.js","w"); file.print "function loadMusicFiles(){\n"; dir.each{|list| if list.match(".json") && !(list.match("~")) then file.print " musicsArray.push(\"music/" + list + "\");\n"; end } file.print " cursor.setMAX(musicsArray.length);\n"; file.print "}\n"; dir.close(); file.close();