handlebars 0.3.2beta3 → 0.3.2beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog.md +3 -0
- data/lib/handlebars/context.rb +5 -1
- data/lib/handlebars/version.rb +1 -1
- data/spec/handlebars_spec.rb +11 -0
- metadata +3 -5
data/Changelog.md
ADDED
data/lib/handlebars/context.rb
CHANGED
@@ -27,6 +27,10 @@ module Handlebars
|
|
27
27
|
::Handlebars::Template.new(self, handlebars.compile(*args))
|
28
28
|
end
|
29
29
|
|
30
|
+
def precompile(*args)
|
31
|
+
handlebars.precompile(*args)
|
32
|
+
end
|
33
|
+
|
30
34
|
def register_helper(name, &fn)
|
31
35
|
handlebars.registerHelper(name, fn)
|
32
36
|
end
|
@@ -65,4 +69,4 @@ module Handlebars
|
|
65
69
|
handlebars[:_rubydata] ||= @js.new_object
|
66
70
|
end
|
67
71
|
end
|
68
|
-
end
|
72
|
+
end
|
data/lib/handlebars/version.rb
CHANGED
data/spec/handlebars_spec.rb
CHANGED
@@ -79,7 +79,18 @@ describe(Handlebars::Context) do
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
describe "precompiling templates" do
|
83
|
+
let(:t) {precompile("foo {{bar}}")}
|
84
|
+
it "should compile down to javascript" do
|
85
|
+
t.should be_start_with 'function'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
82
89
|
def compile(*args)
|
83
90
|
subject.compile(*args)
|
84
91
|
end
|
92
|
+
|
93
|
+
def precompile(*args)
|
94
|
+
subject.precompile(*args)
|
95
|
+
end
|
85
96
|
end
|
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.3.
|
4
|
+
version: 0.3.2beta4
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: therubyracer
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- .gitignore
|
88
88
|
- .gitmodules
|
89
89
|
- .rspec
|
90
|
+
- Changelog.md
|
90
91
|
- Gemfile
|
91
92
|
- README.mdown
|
92
93
|
- Rakefile
|
@@ -141,9 +142,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
142
|
- - ! '>='
|
142
143
|
- !ruby/object:Gem::Version
|
143
144
|
version: '0'
|
144
|
-
segments:
|
145
|
-
- 0
|
146
|
-
hash: 671216264178140519
|
147
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
146
|
none: false
|
149
147
|
requirements:
|