handlebars 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.mdown +4 -3
- data/lib/handlebars.rb +0 -2
- data/lib/handlebars/context.rb +1 -0
- data/lib/handlebars/version.rb +1 -1
- metadata +7 -7
data/README.mdown
CHANGED
@@ -9,7 +9,8 @@ This uses [therubyracer][1] to bind to the _actual_ JavaScript implementation of
|
|
9
9
|
Simple stuff
|
10
10
|
|
11
11
|
require 'handlebars'
|
12
|
-
|
12
|
+
handlebars = Handlebars::Context.new
|
13
|
+
template = handlebars.compile("{{say}}{{what}}")
|
13
14
|
template.call(:say => "Hey", :what => "Yuh!") #=> "Hey Yuh!"
|
14
15
|
|
15
16
|
With functions as properties
|
@@ -18,10 +19,10 @@ With functions as properties
|
|
18
19
|
|
19
20
|
Register block helpers:
|
20
21
|
|
21
|
-
|
22
|
+
handlebars.register_helper(:twice) do |block|
|
22
23
|
"#{block.call}#{block.call}"
|
23
24
|
end
|
24
|
-
template =
|
25
|
+
template = handlebars.compile({{#twice}}Hurray!{{/twice}})
|
25
26
|
template.call #=> Hurray!Hurray!
|
26
27
|
|
27
28
|
## Hack
|
data/lib/handlebars.rb
CHANGED
data/lib/handlebars/context.rb
CHANGED
data/lib/handlebars/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: handlebars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: therubyracer
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156892900 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.10.0beta1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156892900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: commonjs
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156891200 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.2.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156891200
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156890700 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '2.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2156890700
|
47
47
|
description: Uses the actual JavaScript implementation of Handlebars, but supports
|
48
48
|
using Ruby objects as template contexts and Ruby procs as view functions and named
|
49
49
|
helpers
|