* Added a few public API methods to JavaScriptCompiler.prototype, so it can be subclassed.

* made it possible to define an alternate name lookup scheme (so that {{foo}} does not have to be
    context.foo, but can instead be something like context.get('foo'))
  * made it possible to substitute an alternate buffer instead of the default empty String and override how
    the compiled template appends to the buffer
* Added the concept of template-local data. In order to enable template-local data, pass true
  as the second parameter to the template compiler. Then, pass in the data as the fourth
  parameter (context, helpers, partials, data). These signatures may change before the 1.0 release.
This commit is contained in:
tomhuda
2011-02-11 17:02:26 -08:00
parent 2eb1b30870
commit 88e7003331
4 changed files with 125 additions and 38 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ module Handlebars
context["Handlebars"]["logger"]["level"] = ENV["DEBUG_JS"] ? context["Handlebars"]["logger"][ENV["DEBUG_JS"]] : 4
context["Handlebars"]["logger"]["log"] = proc do |level, str|
logger_level = context["Handlebars"]["logger"]["level"]
logger_level = context["Handlebars"]["logger"]["level"].to_i
if logger_level <= level
puts str