updated compile.rb - simplified public directory file name conflict resolution