ejs-rcompiler 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@ This will create a .js file with a JavaScript class name that matches the file n
19
19
  == You can then require the output js file as such.
20
20
  <script src="/javascripts/or.ui.Cities.js"></script>
21
21
  <script>
22
- document.body.innerHTML = or.ui.Cities.template({
22
+ document.body.innerHTML = or.ui.Cities.render({
23
23
  cities: [{ name: "Paris" }, { name: "Mountain View" }, { name: "Las Vegas" }]
24
24
  });
25
25
  </script>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ejs-rcompiler}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Curren"]
@@ -54,7 +54,7 @@ module Ejs
54
54
  end
55
55
 
56
56
  def template_header(buffer, template_name)
57
- buffer.push("#{template_name}.template = function(options) {")
57
+ buffer.push("#{template_name}.render = function(options) {")
58
58
  buffer.push(" var p = [];")
59
59
  buffer.push(" with(options) {")
60
60
  end
@@ -11,7 +11,7 @@ describe "Compiler" do
11
11
  compiled = @compiler.js_source_from_string("TemplateName", "", true)
12
12
 
13
13
  compiled[0].should == "window.TemplateName = window.TemplateName || {};"
14
- compiled[1].should == "TemplateName.template = function(options) {"
14
+ compiled[1].should == "TemplateName.render = function(options) {"
15
15
  compiled[2].should == " var p = [];"
16
16
  compiled[3].should == " with(options) {"
17
17
 
@@ -25,7 +25,7 @@ describe "Compiler" do
25
25
  compiled[0].should == "window.my = window.my || {};"
26
26
  compiled[1].should == "window.my.namespace = window.my.namespace || {};"
27
27
  compiled[2].should == "window.my.namespace.MyClass = window.my.namespace.MyClass || {};"
28
- compiled[3].should == "my.namespace.MyClass.template = function(options) {"
28
+ compiled[3].should == "my.namespace.MyClass.render = function(options) {"
29
29
  end
30
30
 
31
31
  it "should js_source_from_string static content" do
@@ -4,7 +4,7 @@
4
4
  window.or = window.or || {};
5
5
  window.or.ui = window.or.ui || {};
6
6
  window.or.ui.Cities = window.or.ui.Cities || {};
7
- or.ui.Cities.template = function(options) {
7
+ or.ui.Cities.render = function(options) {
8
8
  var p = [];
9
9
  with(options) {
10
10
  p.push('<ul>\n ');
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben Curren