handlebars_assets 0.12.3 → 0.13.0

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTViZmE5OTE0ZDFiNjU5ZTkzMjMyYjIwZjI5NzA0ZjdlMzE4ZTcwMQ==
4
+ YmEzZjUwYjkxNTRkMThiY2FkNjlmYmRmMWNjM2Q1ODhmYWU5MGUwZQ==
5
5
  data.tar.gz: !binary |-
6
- OGRhMTc5NTEzZThjZjI4YzM4M2IyYTUwMWVhZjE1NDliMDZhOGZmMA==
6
+ YmY3ZTU4YmE3ZmQ5MWQ1MTU2YzIyZGYxNWU3OTk2MDJlZDVkZWI5Mg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTFmODBjZmU0MDQwODkyZjEwNjMwYWJiNTY2NDhiNWNiOWNiNGE0M2Y3ZDM1
10
- YzIzMjMzMTRhMzIzODZkYjA0ZmFjNDhiZjlkNTlhNmJjMThiZTZiODUxNTk1
11
- ZWEwMzUxNzgyYzBmNDJkZDJmMWQzNzY4MmM2ZmIzYmRhZmI3NzY=
9
+ Y2E0NTFhOTZiODViZWM2YTcxZjE0NWRjNDVhYTU5NzY5YThjZDY0MjliNTk1
10
+ MWUxZWY0MmUxMTcxYWQxMjUyMmYzZDk3N2I0ZGZiZTlkYWI2Mjc1OWE2MGY0
11
+ YmI4YjNiNTZjNjE2Mjk1OGZlY2Y1ODhkY2M2NzMyMWZiODNhMjE=
12
12
  data.tar.gz: !binary |-
13
- M2U2MzU0MjczYjhlNzJkMDhmMDAyOGZhYjBmYTkzMTc1YjJjYzhlNzMxNGJh
14
- ZDA4NzRhYzkwNzY5NWUzMjk5Y2RlNTM3NmQ5YjdlODNmZDQ3YjY1ODQ1Nzk4
15
- MDIxNjgyZDBhYjExMmE1OTgyYThmZmY1MDU3MzM3MDE1MGM0ZTI=
13
+ YjVlMDU0OWJjMzlkNzg5ZjAxOWE1M2ZmNmMwZmVkM2I3OThhNTMxOWZiYjlh
14
+ ODVlOWEzYjk1ZjQ4ZTZiMjg2OTc1ZDBkOGJjM2RjYTZkNGNlZDA0NGFiYzc1
15
+ NDQzOTk4N2Q2ZjBmY2U1MGRlY2E3MTZjYWFhNGI3MTI2NzA4Y2Y=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## On master
2
2
 
3
+ ## 0.13.0 (2013-06-02)
4
+
5
+ * Update to handlebars 1.0.0 - @lee
6
+
3
7
  ## 0.12.3 (2013-05-28)
4
8
 
5
9
  * Pass scope and locals up the chain - @AlexRiedler
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- handlebars_assets (0.12.3)
4
+ handlebars_assets (0.13.0)
5
5
  execjs (>= 1.2.9)
6
6
  sprockets (>= 2.0.3)
7
7
  tilt
data/README.md CHANGED
@@ -224,6 +224,7 @@ Follow me on [Github](https://github.com/leshill) and [Twitter](https://twitter.
224
224
  * Turadg Aleahmad (@turadg) : Update to handlebars 1.0.0-rc.4
225
225
  * Mark Rushakoff (@mark-rushakoff) : Synchronize Sprockets engine registers with Rails
226
226
  * Alex Riedler (@AlexRiedler) : Pass scope and locals up the chain
227
+ * lee (@lee) : Update to handlebars 1.0.0
227
228
 
228
229
  # Contributing
229
230
 
@@ -1,3 +1,3 @@
1
1
  module HandlebarsAssets
2
- VERSION = "0.12.3"
2
+ VERSION = "0.13.0"
3
3
  end
@@ -29,13 +29,14 @@ var Handlebars = {};
29
29
  ;
30
30
  // lib/handlebars/base.js
31
31
 
32
- Handlebars.VERSION = "1.0.0-rc.4";
33
- Handlebars.COMPILER_REVISION = 3;
32
+ Handlebars.VERSION = "1.0.0";
33
+ Handlebars.COMPILER_REVISION = 4;
34
34
 
35
35
  Handlebars.REVISION_CHANGES = {
36
36
  1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
37
37
  2: '== 1.0.0-rc.3',
38
- 3: '>= 1.0.0-rc.4'
38
+ 3: '== 1.0.0-rc.4',
39
+ 4: '>= 1.0.0'
39
40
  };
40
41
 
41
42
  Handlebars.helpers = {};
@@ -67,7 +68,7 @@ Handlebars.registerHelper('helperMissing', function(arg) {
67
68
  if(arguments.length === 2) {
68
69
  return undefined;
69
70
  } else {
70
- throw new Error("Could not find property '" + arg + "'");
71
+ throw new Error("Missing helper: '" + arg + "'");
71
72
  }
72
73
  });
73
74
 
@@ -124,6 +125,9 @@ Handlebars.registerHelper('each', function(context, options) {
124
125
  var fn = options.fn, inverse = options.inverse;
125
126
  var i = 0, ret = "", data;
126
127
 
128
+ var type = toString.call(context);
129
+ if(type === functionType) { context = context.call(this); }
130
+
127
131
  if (options.data) {
128
132
  data = Handlebars.createFrame(options.data);
129
133
  }
@@ -152,22 +156,25 @@ Handlebars.registerHelper('each', function(context, options) {
152
156
  return ret;
153
157
  });
154
158
 
155
- Handlebars.registerHelper('if', function(context, options) {
156
- var type = toString.call(context);
157
- if(type === functionType) { context = context.call(this); }
159
+ Handlebars.registerHelper('if', function(conditional, options) {
160
+ var type = toString.call(conditional);
161
+ if(type === functionType) { conditional = conditional.call(this); }
158
162
 
159
- if(!context || Handlebars.Utils.isEmpty(context)) {
163
+ if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
160
164
  return options.inverse(this);
161
165
  } else {
162
166
  return options.fn(this);
163
167
  }
164
168
  });
165
169
 
166
- Handlebars.registerHelper('unless', function(context, options) {
167
- return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
170
+ Handlebars.registerHelper('unless', function(conditional, options) {
171
+ return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
168
172
  });
169
173
 
170
174
  Handlebars.registerHelper('with', function(context, options) {
175
+ var type = toString.call(context);
176
+ if(type === functionType) { context = context.call(this); }
177
+
171
178
  if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
172
179
  });
173
180
 
@@ -181,9 +188,9 @@ Handlebars.registerHelper('log', function(context, options) {
181
188
  var handlebars = (function(){
182
189
  var parser = {trace: function trace() { },
183
190
  yy: {},
184
- symbols_: {"error":2,"root":3,"program":4,"EOF":5,"simpleInverse":6,"statements":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"partialName":25,"params":26,"hash":27,"DATA":28,"param":29,"STRING":30,"INTEGER":31,"BOOLEAN":32,"hashSegments":33,"hashSegment":34,"ID":35,"EQUALS":36,"PARTIAL_NAME":37,"pathSegments":38,"SEP":39,"$accept":0,"$end":1},
185
- terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"DATA",30:"STRING",31:"INTEGER",32:"BOOLEAN",35:"ID",36:"EQUALS",37:"PARTIAL_NAME",39:"SEP"},
186
- productions_: [0,[3,2],[4,2],[4,3],[4,2],[4,1],[4,1],[4,0],[7,1],[7,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[6,2],[17,3],[17,2],[17,2],[17,1],[17,1],[26,2],[26,1],[29,1],[29,1],[29,1],[29,1],[29,1],[27,1],[33,2],[33,1],[34,3],[34,3],[34,3],[34,3],[34,3],[25,1],[21,1],[38,3],[38,1]],
191
+ symbols_: {"error":2,"root":3,"program":4,"EOF":5,"simpleInverse":6,"statements":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"CLOSE_UNESCAPED":24,"OPEN_PARTIAL":25,"partialName":26,"params":27,"hash":28,"dataName":29,"param":30,"STRING":31,"INTEGER":32,"BOOLEAN":33,"hashSegments":34,"hashSegment":35,"ID":36,"EQUALS":37,"DATA":38,"pathSegments":39,"SEP":40,"$accept":0,"$end":1},
192
+ terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",31:"STRING",32:"INTEGER",33:"BOOLEAN",36:"ID",37:"EQUALS",38:"DATA",40:"SEP"},
193
+ productions_: [0,[3,2],[4,2],[4,3],[4,2],[4,1],[4,1],[4,0],[7,1],[7,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[6,2],[17,3],[17,2],[17,2],[17,1],[17,1],[27,2],[27,1],[30,1],[30,1],[30,1],[30,1],[30,1],[28,1],[34,2],[34,1],[35,3],[35,3],[35,3],[35,3],[35,3],[26,1],[26,1],[26,1],[29,2],[21,1],[39,3],[39,1]],
187
194
  performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
188
195
 
189
196
  var $0 = $$.length - 1;
@@ -224,7 +231,10 @@ case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
224
231
  break;
225
232
  case 18: this.$ = $$[$0-1];
226
233
  break;
227
- case 19: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
234
+ case 19:
235
+ // Parsing out the '&' escape token at this level saves ~500 bytes after min due to the removal of one parser node.
236
+ this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], $$[$0-2][2] === '&');
237
+
228
238
  break;
229
239
  case 20: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
230
240
  break;
@@ -242,7 +252,7 @@ case 26: this.$ = [[$$[$0-1]], $$[$0]];
242
252
  break;
243
253
  case 27: this.$ = [[$$[$0]], null];
244
254
  break;
245
- case 28: this.$ = [[new yy.DataNode($$[$0])], null];
255
+ case 28: this.$ = [[$$[$0]], null];
246
256
  break;
247
257
  case 29: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
248
258
  break;
@@ -256,7 +266,7 @@ case 33: this.$ = new yy.IntegerNode($$[$0]);
256
266
  break;
257
267
  case 34: this.$ = new yy.BooleanNode($$[$0]);
258
268
  break;
259
- case 35: this.$ = new yy.DataNode($$[$0]);
269
+ case 35: this.$ = $$[$0];
260
270
  break;
261
271
  case 36: this.$ = new yy.HashNode($$[$0]);
262
272
  break;
@@ -272,20 +282,26 @@ case 41: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])];
272
282
  break;
273
283
  case 42: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])];
274
284
  break;
275
- case 43: this.$ = [$$[$0-2], new yy.DataNode($$[$0])];
285
+ case 43: this.$ = [$$[$0-2], $$[$0]];
276
286
  break;
277
287
  case 44: this.$ = new yy.PartialNameNode($$[$0]);
278
288
  break;
279
- case 45: this.$ = new yy.IdNode($$[$0]);
289
+ case 45: this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0]));
290
+ break;
291
+ case 46: this.$ = new yy.PartialNameNode(new yy.IntegerNode($$[$0]));
280
292
  break;
281
- case 46: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
293
+ case 47: this.$ = new yy.DataNode($$[$0]);
282
294
  break;
283
- case 47: this.$ = [$$[$0]];
295
+ case 48: this.$ = new yy.IdNode($$[$0]);
296
+ break;
297
+ case 49: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2];
298
+ break;
299
+ case 50: this.$ = [{part: $$[$0]}];
284
300
  break;
285
301
  }
286
302
  },
287
- table: [{3:1,4:2,5:[2,7],6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],22:[1,14],23:[1,15],24:[1,16]},{1:[3]},{5:[1,17]},{5:[2,6],7:18,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,6],22:[1,14],23:[1,15],24:[1,16]},{5:[2,5],6:20,8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,5],22:[1,14],23:[1,15],24:[1,16]},{17:23,18:[1,22],21:24,28:[1,25],35:[1,27],38:26},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{4:28,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],24:[1,16]},{4:29,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],24:[1,16]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{17:30,21:24,28:[1,25],35:[1,27],38:26},{17:31,21:24,28:[1,25],35:[1,27],38:26},{17:32,21:24,28:[1,25],35:[1,27],38:26},{25:33,37:[1,34]},{1:[2,1]},{5:[2,2],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,2],22:[1,14],23:[1,15],24:[1,16]},{17:23,21:24,28:[1,25],35:[1,27],38:26},{5:[2,4],7:35,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,4],22:[1,14],23:[1,15],24:[1,16]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,23],14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],24:[2,23]},{18:[1,36]},{18:[2,27],21:41,26:37,27:38,28:[1,45],29:39,30:[1,42],31:[1,43],32:[1,44],33:40,34:46,35:[1,47],38:26},{18:[2,28]},{18:[2,45],28:[2,45],30:[2,45],31:[2,45],32:[2,45],35:[2,45],39:[1,48]},{18:[2,47],28:[2,47],30:[2,47],31:[2,47],32:[2,47],35:[2,47],39:[2,47]},{10:49,20:[1,50]},{10:51,20:[1,50]},{18:[1,52]},{18:[1,53]},{18:[1,54]},{18:[1,55],21:56,35:[1,27],38:26},{18:[2,44],35:[2,44]},{5:[2,3],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,3],22:[1,14],23:[1,15],24:[1,16]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{18:[2,25],21:41,27:57,28:[1,45],29:58,30:[1,42],31:[1,43],32:[1,44],33:40,34:46,35:[1,47],38:26},{18:[2,26]},{18:[2,30],28:[2,30],30:[2,30],31:[2,30],32:[2,30],35:[2,30]},{18:[2,36],34:59,35:[1,60]},{18:[2,31],28:[2,31],30:[2,31],31:[2,31],32:[2,31],35:[2,31]},{18:[2,32],28:[2,32],30:[2,32],31:[2,32],32:[2,32],35:[2,32]},{18:[2,33],28:[2,33],30:[2,33],31:[2,33],32:[2,33],35:[2,33]},{18:[2,34],28:[2,34],30:[2,34],31:[2,34],32:[2,34],35:[2,34]},{18:[2,35],28:[2,35],30:[2,35],31:[2,35],32:[2,35],35:[2,35]},{18:[2,38],35:[2,38]},{18:[2,47],28:[2,47],30:[2,47],31:[2,47],32:[2,47],35:[2,47],36:[1,61],39:[2,47]},{35:[1,62]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{21:63,35:[1,27],38:26},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],24:[2,21]},{18:[1,64]},{18:[2,24]},{18:[2,29],28:[2,29],30:[2,29],31:[2,29],32:[2,29],35:[2,29]},{18:[2,37],35:[2,37]},{36:[1,61]},{21:65,28:[1,69],30:[1,66],31:[1,67],32:[1,68],35:[1,27],38:26},{18:[2,46],28:[2,46],30:[2,46],31:[2,46],32:[2,46],35:[2,46],39:[2,46]},{18:[1,70]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],24:[2,22]},{18:[2,39],35:[2,39]},{18:[2,40],35:[2,40]},{18:[2,41],35:[2,41]},{18:[2,42],35:[2,42]},{18:[2,43],35:[2,43]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]}],
288
- defaultActions: {17:[2,1],25:[2,28],38:[2,26],57:[2,24]},
303
+ table: [{3:1,4:2,5:[2,7],6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],22:[1,14],23:[1,15],25:[1,16]},{1:[3]},{5:[1,17]},{5:[2,6],7:18,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,6],22:[1,14],23:[1,15],25:[1,16]},{5:[2,5],6:20,8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,5],22:[1,14],23:[1,15],25:[1,16]},{17:23,18:[1,22],21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],25:[2,8]},{4:29,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{4:30,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{17:31,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:32,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:33,21:24,29:25,36:[1,28],38:[1,27],39:26},{21:35,26:34,31:[1,36],32:[1,37],36:[1,28],39:26},{1:[2,1]},{5:[2,2],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,2],22:[1,14],23:[1,15],25:[1,16]},{17:23,21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,4],7:38,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,4],22:[1,14],23:[1,15],25:[1,16]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{5:[2,23],14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{18:[1,39]},{18:[2,27],21:44,24:[2,27],27:40,28:41,29:48,30:42,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,28],24:[2,28]},{18:[2,48],24:[2,48],31:[2,48],32:[2,48],33:[2,48],36:[2,48],38:[2,48],40:[1,51]},{21:52,36:[1,28],39:26},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],38:[2,50],40:[2,50]},{10:53,20:[1,54]},{10:55,20:[1,54]},{18:[1,56]},{18:[1,57]},{24:[1,58]},{18:[1,59],21:60,36:[1,28],39:26},{18:[2,44],36:[2,44]},{18:[2,45],36:[2,45]},{18:[2,46],36:[2,46]},{5:[2,3],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,3],22:[1,14],23:[1,15],25:[1,16]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{18:[2,25],21:44,24:[2,25],28:61,29:48,30:62,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,26],24:[2,26]},{18:[2,30],24:[2,30],31:[2,30],32:[2,30],33:[2,30],36:[2,30],38:[2,30]},{18:[2,36],24:[2,36],35:63,36:[1,64]},{18:[2,31],24:[2,31],31:[2,31],32:[2,31],33:[2,31],36:[2,31],38:[2,31]},{18:[2,32],24:[2,32],31:[2,32],32:[2,32],33:[2,32],36:[2,32],38:[2,32]},{18:[2,33],24:[2,33],31:[2,33],32:[2,33],33:[2,33],36:[2,33],38:[2,33]},{18:[2,34],24:[2,34],31:[2,34],32:[2,34],33:[2,34],36:[2,34],38:[2,34]},{18:[2,35],24:[2,35],31:[2,35],32:[2,35],33:[2,35],36:[2,35],38:[2,35]},{18:[2,38],24:[2,38],36:[2,38]},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],37:[1,65],38:[2,50],40:[2,50]},{36:[1,66]},{18:[2,47],24:[2,47],31:[2,47],32:[2,47],33:[2,47],36:[2,47],38:[2,47]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{21:67,36:[1,28],39:26},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,68]},{18:[2,24],24:[2,24]},{18:[2,29],24:[2,29],31:[2,29],32:[2,29],33:[2,29],36:[2,29],38:[2,29]},{18:[2,37],24:[2,37],36:[2,37]},{37:[1,65]},{21:69,29:73,31:[1,70],32:[1,71],33:[1,72],36:[1,28],38:[1,27],39:26},{18:[2,49],24:[2,49],31:[2,49],32:[2,49],33:[2,49],36:[2,49],38:[2,49],40:[2,49]},{18:[1,74]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{18:[2,39],24:[2,39],36:[2,39]},{18:[2,40],24:[2,40],36:[2,40]},{18:[2,41],24:[2,41],36:[2,41]},{18:[2,42],24:[2,42],36:[2,42]},{18:[2,43],24:[2,43],36:[2,43]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]}],
304
+ defaultActions: {17:[2,1]},
289
305
  parseError: function parseError(str, hash) {
290
306
  throw new Error(str);
291
307
  },
@@ -584,7 +600,7 @@ case 3:
584
600
  break;
585
601
  case 4: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15;
586
602
  break;
587
- case 5: this.begin("par"); return 24;
603
+ case 5: return 25;
588
604
  break;
589
605
  case 6: return 16;
590
606
  break;
@@ -596,7 +612,7 @@ case 9: return 19;
596
612
  break;
597
613
  case 10: return 23;
598
614
  break;
599
- case 11: return 23;
615
+ case 11: return 22;
600
616
  break;
601
617
  case 12: this.popState(); this.begin('com');
602
618
  break;
@@ -604,48 +620,44 @@ case 13: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return
604
620
  break;
605
621
  case 14: return 22;
606
622
  break;
607
- case 15: return 36;
623
+ case 15: return 37;
608
624
  break;
609
- case 16: return 35;
625
+ case 16: return 36;
610
626
  break;
611
- case 17: return 35;
627
+ case 17: return 36;
612
628
  break;
613
- case 18: return 39;
629
+ case 18: return 40;
614
630
  break;
615
631
  case 19: /*ignore whitespace*/
616
632
  break;
617
- case 20: this.popState(); return 18;
633
+ case 20: this.popState(); return 24;
618
634
  break;
619
635
  case 21: this.popState(); return 18;
620
636
  break;
621
- case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 30;
637
+ case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 31;
622
638
  break;
623
- case 23: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 30;
639
+ case 23: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 31;
624
640
  break;
625
- case 24: yy_.yytext = yy_.yytext.substr(1); return 28;
641
+ case 24: return 38;
626
642
  break;
627
- case 25: return 32;
643
+ case 25: return 33;
628
644
  break;
629
- case 26: return 32;
645
+ case 26: return 33;
630
646
  break;
631
- case 27: return 31;
647
+ case 27: return 32;
632
648
  break;
633
- case 28: return 35;
649
+ case 28: return 36;
634
650
  break;
635
- case 29: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 35;
651
+ case 29: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 36;
636
652
  break;
637
653
  case 30: return 'INVALID';
638
654
  break;
639
- case 31: /*ignore whitespace*/
640
- break;
641
- case 32: this.popState(); return 37;
642
- break;
643
- case 33: return 5;
655
+ case 31: return 5;
644
656
  break;
645
657
  }
646
658
  };
647
- lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$:\-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$\-\/]+)/,/^(?:$)/];
648
- lexer.conditions = {"mu":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33],"inclusive":false},"emu":{"rules":[3],"inclusive":false},"com":{"rules":[4],"inclusive":false},"par":{"rules":[31,32],"inclusive":false},"INITIAL":{"rules":[0,1,2,33],"inclusive":true}};
659
+ lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}\/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
660
+ lexer.conditions = {"mu":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],"inclusive":false},"emu":{"rules":[3],"inclusive":false},"com":{"rules":[4],"inclusive":false},"INITIAL":{"rules":[0,1,2,31],"inclusive":true}};
649
661
  return lexer;})()
650
662
  parser.lexer = lexer;
651
663
  function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
@@ -731,21 +743,24 @@ Handlebars.AST.HashNode = function(pairs) {
731
743
 
732
744
  Handlebars.AST.IdNode = function(parts) {
733
745
  this.type = "ID";
734
- this.original = parts.join(".");
735
746
 
736
- var dig = [], depth = 0;
747
+ var original = "",
748
+ dig = [],
749
+ depth = 0;
737
750
 
738
751
  for(var i=0,l=parts.length; i<l; i++) {
739
- var part = parts[i];
752
+ var part = parts[i].part;
753
+ original += (parts[i].separator || '') + part;
740
754
 
741
755
  if (part === ".." || part === "." || part === "this") {
742
- if (dig.length > 0) { throw new Handlebars.Exception("Invalid path: " + this.original); }
756
+ if (dig.length > 0) { throw new Handlebars.Exception("Invalid path: " + original); }
743
757
  else if (part === "..") { depth++; }
744
758
  else { this.isScoped = true; }
745
759
  }
746
760
  else { dig.push(part); }
747
761
  }
748
762
 
763
+ this.original = original;
749
764
  this.parts = dig;
750
765
  this.string = dig.join('.');
751
766
  this.depth = depth;
@@ -759,7 +774,7 @@ Handlebars.AST.IdNode = function(parts) {
759
774
 
760
775
  Handlebars.AST.PartialNameNode = function(name) {
761
776
  this.type = "PARTIAL_NAME";
762
- this.name = name;
777
+ this.name = name.original;
763
778
  };
764
779
 
765
780
  Handlebars.AST.DataNode = function(id) {
@@ -769,13 +784,15 @@ Handlebars.AST.DataNode = function(id) {
769
784
 
770
785
  Handlebars.AST.StringNode = function(string) {
771
786
  this.type = "STRING";
772
- this.string = string;
773
- this.stringModeValue = string;
787
+ this.original =
788
+ this.string =
789
+ this.stringModeValue = string;
774
790
  };
775
791
 
776
792
  Handlebars.AST.IntegerNode = function(integer) {
777
793
  this.type = "INTEGER";
778
- this.integer = integer;
794
+ this.original =
795
+ this.integer = integer;
779
796
  this.stringModeValue = Number(integer);
780
797
  };
781
798
 
@@ -1162,7 +1179,15 @@ Compiler.prototype = {
1162
1179
 
1163
1180
  DATA: function(data) {
1164
1181
  this.options.data = true;
1165
- this.opcode('lookupData', data.id);
1182
+ if (data.id.isScoped || data.id.depth) {
1183
+ throw new Handlebars.Exception('Scoped data references are not supported: ' + data.original);
1184
+ }
1185
+
1186
+ this.opcode('lookupData');
1187
+ var parts = data.id.parts;
1188
+ for(var i=0, l=parts.length; i<l; i++) {
1189
+ this.opcode('lookup', parts[i]);
1190
+ }
1166
1191
  },
1167
1192
 
1168
1193
  STRING: function(string) {
@@ -1361,8 +1386,9 @@ JavaScriptCompiler.prototype = {
1361
1386
 
1362
1387
  if (!this.isChild) {
1363
1388
  var namespace = this.namespace;
1364
- var copies = "helpers = helpers || " + namespace + ".helpers;";
1365
- if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
1389
+
1390
+ var copies = "helpers = this.merge(helpers, " + namespace + ".helpers);";
1391
+ if (this.environment.usePartial) { copies = copies + " partials = this.merge(partials, " + namespace + ".partials);"; }
1366
1392
  if (this.options.data) { copies = copies + " data = data || {};"; }
1367
1393
  out.push(copies);
1368
1394
  } else {
@@ -1391,7 +1417,9 @@ JavaScriptCompiler.prototype = {
1391
1417
  // Generate minimizer alias mappings
1392
1418
  if (!this.isChild) {
1393
1419
  for (var alias in this.context.aliases) {
1394
- this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
1420
+ if (this.context.aliases.hasOwnProperty(alias)) {
1421
+ this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
1422
+ }
1395
1423
  }
1396
1424
  }
1397
1425
 
@@ -1610,7 +1638,7 @@ JavaScriptCompiler.prototype = {
1610
1638
  //
1611
1639
  // Push the result of looking up `id` on the current data
1612
1640
  lookupData: function(id) {
1613
- this.push(this.nameLookup('data', id, 'data'));
1641
+ this.push('data');
1614
1642
  },
1615
1643
 
1616
1644
  // [pushStringParam]
@@ -1717,8 +1745,9 @@ JavaScriptCompiler.prototype = {
1717
1745
  this.context.aliases.helperMissing = 'helpers.helperMissing';
1718
1746
 
1719
1747
  var helper = this.lastHelper = this.setupHelper(paramSize, name, true);
1748
+ var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
1720
1749
 
1721
- this.push(helper.name);
1750
+ this.push(helper.name + ' || ' + nonHelper);
1722
1751
  this.replaceStack(function(name) {
1723
1752
  return name + ' ? ' + name + '.call(' +
1724
1753
  helper.callParams + ") " + ": helperMissing.call(" +
@@ -2163,6 +2192,16 @@ Handlebars.VM = {
2163
2192
  }
2164
2193
  return programWrapper;
2165
2194
  },
2195
+ merge: function(param, common) {
2196
+ var ret = param || common;
2197
+
2198
+ if (param && common) {
2199
+ ret = {};
2200
+ Handlebars.Utils.extend(ret, common);
2201
+ Handlebars.Utils.extend(ret, param);
2202
+ }
2203
+ return ret;
2204
+ },
2166
2205
  programWithDepth: Handlebars.VM.programWithDepth,
2167
2206
  noop: Handlebars.VM.noop,
2168
2207
  compilerInfo: null
@@ -29,13 +29,14 @@ var Handlebars = {};
29
29
  ;
30
30
  // lib/handlebars/base.js
31
31
 
32
- Handlebars.VERSION = "1.0.0-rc.4";
33
- Handlebars.COMPILER_REVISION = 3;
32
+ Handlebars.VERSION = "1.0.0";
33
+ Handlebars.COMPILER_REVISION = 4;
34
34
 
35
35
  Handlebars.REVISION_CHANGES = {
36
36
  1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
37
37
  2: '== 1.0.0-rc.3',
38
- 3: '>= 1.0.0-rc.4'
38
+ 3: '== 1.0.0-rc.4',
39
+ 4: '>= 1.0.0'
39
40
  };
40
41
 
41
42
  Handlebars.helpers = {};
@@ -67,7 +68,7 @@ Handlebars.registerHelper('helperMissing', function(arg) {
67
68
  if(arguments.length === 2) {
68
69
  return undefined;
69
70
  } else {
70
- throw new Error("Could not find property '" + arg + "'");
71
+ throw new Error("Missing helper: '" + arg + "'");
71
72
  }
72
73
  });
73
74
 
@@ -124,6 +125,9 @@ Handlebars.registerHelper('each', function(context, options) {
124
125
  var fn = options.fn, inverse = options.inverse;
125
126
  var i = 0, ret = "", data;
126
127
 
128
+ var type = toString.call(context);
129
+ if(type === functionType) { context = context.call(this); }
130
+
127
131
  if (options.data) {
128
132
  data = Handlebars.createFrame(options.data);
129
133
  }
@@ -152,22 +156,25 @@ Handlebars.registerHelper('each', function(context, options) {
152
156
  return ret;
153
157
  });
154
158
 
155
- Handlebars.registerHelper('if', function(context, options) {
156
- var type = toString.call(context);
157
- if(type === functionType) { context = context.call(this); }
159
+ Handlebars.registerHelper('if', function(conditional, options) {
160
+ var type = toString.call(conditional);
161
+ if(type === functionType) { conditional = conditional.call(this); }
158
162
 
159
- if(!context || Handlebars.Utils.isEmpty(context)) {
163
+ if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
160
164
  return options.inverse(this);
161
165
  } else {
162
166
  return options.fn(this);
163
167
  }
164
168
  });
165
169
 
166
- Handlebars.registerHelper('unless', function(context, options) {
167
- return Handlebars.helpers['if'].call(this, context, {fn: options.inverse, inverse: options.fn});
170
+ Handlebars.registerHelper('unless', function(conditional, options) {
171
+ return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
168
172
  });
169
173
 
170
174
  Handlebars.registerHelper('with', function(context, options) {
175
+ var type = toString.call(context);
176
+ if(type === functionType) { context = context.call(this); }
177
+
171
178
  if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
172
179
  });
173
180
 
@@ -269,6 +276,16 @@ Handlebars.VM = {
269
276
  }
270
277
  return programWrapper;
271
278
  },
279
+ merge: function(param, common) {
280
+ var ret = param || common;
281
+
282
+ if (param && common) {
283
+ ret = {};
284
+ Handlebars.Utils.extend(ret, common);
285
+ Handlebars.Utils.extend(ret, param);
286
+ }
287
+ return ret;
288
+ },
272
289
  programWithDepth: Handlebars.VM.programWithDepth,
273
290
  noop: Handlebars.VM.noop,
274
291
  compilerInfo: null
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: handlebars_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Hill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-28 00:00:00.000000000 Z
11
+ date: 2013-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs