lib/emberprecompile/compiler.rb in emberprecompile-0.1.1a vs lib/emberprecompile/compiler.rb in emberprecompile-0.1.1

- old
+ new

@@ -8,18 +8,20 @@ source = "views/" output = File.new(fileName, "w") Find.find(source) do |file| if !FileTest.directory?(file) - if(file.end_with?(".handlebars")) - print "Compiling "+file - templateName = file.chomp(".handlebars") - templateName.slice!(source) - result = Barber::Ember::FilePrecompiler.call(File.read(file)) - output.write('/* '+ templateName + ' Handlebar */') - output.write('Ember.TEMPLATES["' + templateName + '"] = ' + result + '') - print "\n" - end + print "Compiling "+file + templateName = file.chomp(".handlebars") + templateName.slice!(source) + result = Barber::Ember::FilePrecompiler.call(File.read(file)) + output.write('/* '+ templateName + ' Handlebar */') + output.puts @string + output.write('Ember.TEMPLATES["' + templateName + '"] = ' + result + '') + output.puts @string + print "\n" + else + next end end print "\n" print "Pre-Compiled handlebars are ready for use....\n-------------------------------------------------------\n" end \ No newline at end of file