README.mdown in handlebars-0.2.0 vs README.mdown in handlebars-0.2.1
- old
+ new
@@ -7,22 +7,23 @@
## Usage
Simple stuff
require 'handlebars'
- template = Handlebars.compile("{{say}}{{what}}")
+ handlebars = Handlebars::Context.new
+ template = handlebars.compile("{{say}}{{what}}")
template.call(:say => "Hey", :what => "Yuh!") #=> "Hey Yuh!"
With functions as properties
template.call(:say => "Hey", :what => lambda {|this| ("yo" * 2) + "!"}) #=> "Hey yoyo!"
Register block helpers:
- Handlebars.register_helper(:twice) do |block|
+ handlebars.register_helper(:twice) do |block|
"#{block.call}#{block.call}"
end
- template = Handlebars.compile({{#twice}}Hurray!{{/twice}})
+ template = handlebars.compile({{#twice}}Hurray!{{/twice}})
template.call #=> Hurray!Hurray!
## Hack
git clone git@github.com:cowboyd/handlebars.rb.git #git it