handlebars_assets 0.21.0 → 0.22.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cedcbb74d51d63ae934dd1e3dbaa7adc06226d82
4
- data.tar.gz: 26d0e93e39e6eb27c1e12ccc276d0e4ed74d8411
3
+ metadata.gz: 8de571e23c242b137be55601f8747404dd31a3ac
4
+ data.tar.gz: 29a1f7ae70c9076bbaebfc8315cc9a7ea67a4ac4
5
5
  SHA512:
6
- metadata.gz: fa91addd696928465131389446b730ae05b8fc960fabd3cc80a2b5ed674c369967af5d5c0d7d06ebcdf06815a347384f2eedd214a86f2086b6265c0079927d79
7
- data.tar.gz: edabc19919a5d9f85663b8769b8691c4795760c55277eff4d99822cc0176028517f1d4c0f083be76deaf80e475c0889cf77032e7643d1730a45de195a5bc0a0e
6
+ metadata.gz: 1150eea0f96089095b79f70926bc14610d26b437122c162feeccfc7903dcffd66567f88c003f474811533f595cd9529fff87292266854e6d7433351c15e8643c
7
+ data.tar.gz: 992ca4a7b02b8f17a5eecea7f2b21653dd50cf614b4de74d837e058af4dcc63945e63b59e6e242f4425f12bf3e445f6b9094eab84cd2931f3b170d814cd8b491
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.22.0 (2015-11-23)
2
+
3
+ * Update Handlebars to v4.0.5
4
+
1
5
  ## 0.21.0 (2015-02-24)
2
6
 
3
7
  * Update Handlebars to v4.0.2
@@ -1,3 +1,3 @@
1
1
  module HandlebarsAssets
2
- VERSION = "0.21.0"
2
+ VERSION = "0.22.0"
3
3
  end
@@ -1,4 +1,6 @@
1
1
  require 'test_helper'
2
+ require 'haml'
3
+ require 'slim'
2
4
 
3
5
  module HandlebarsAssets
4
6
  class HandlebarsTemplateTest < Minitest::Test
@@ -11,11 +13,11 @@ module HandlebarsAssets
11
13
  end
12
14
 
13
15
  def compile_haml(source)
14
- Haml::Engine.new(source, HandlebarsAssets::Config.haml_options).render
16
+ ::Haml::Engine.new(source, HandlebarsAssets::Config.haml_options).render
15
17
  end
16
18
 
17
19
  def compile_slim(source)
18
- Slim::Template.new(HandlebarsAssets::Config.slim_options) { source }.render
20
+ ::Slim::Template.new(HandlebarsAssets::Config.slim_options) { source }.render
19
21
  end
20
22
 
21
23
  def test_render
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
 
3
- handlebars v4.0.2
3
+ handlebars v4.0.5
4
4
 
5
5
  Copyright (C) 2011-2015 by Yehuda Katz
6
6
 
@@ -275,7 +275,7 @@ return /******/ (function(modules) { // webpackBootstrap
275
275
 
276
276
  var _logger2 = _interopRequireDefault(_logger);
277
277
 
278
- var VERSION = '4.0.2';
278
+ var VERSION = '4.0.5';
279
279
  exports.VERSION = VERSION;
280
280
  var COMPILER_REVISION = 7;
281
281
 
@@ -327,7 +327,7 @@ return /******/ (function(modules) { // webpackBootstrap
327
327
  _utils.extend(this.partials, name);
328
328
  } else {
329
329
  if (typeof partial === 'undefined') {
330
- throw new _exception2['default']('Attempting to register a partial as undefined');
330
+ throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
331
331
  }
332
332
  this.partials[name] = partial;
333
333
  }
@@ -663,12 +663,6 @@ return /******/ (function(modules) { // webpackBootstrap
663
663
  }
664
664
 
665
665
  function execIteration(field, index, last) {
666
- // Don't iterate over undefined values since we can't execute blocks against them
667
- // in non-strict (js) mode.
668
- if (context[field] == null) {
669
- return;
670
- }
671
-
672
666
  if (data) {
673
667
  data.key = field;
674
668
  data.index = index;
@@ -689,7 +683,9 @@ return /******/ (function(modules) { // webpackBootstrap
689
683
  if (context && typeof context === 'object') {
690
684
  if (_utils.isArray(context)) {
691
685
  for (var j = context.length; i < j; i++) {
692
- execIteration(i, i, i === context.length - 1);
686
+ if (i in context) {
687
+ execIteration(i, i, i === context.length - 1);
688
+ }
693
689
  }
694
690
  } else {
695
691
  var priorKey = undefined;
@@ -920,11 +916,14 @@ return /******/ (function(modules) { // webpackBootstrap
920
916
 
921
917
  /***/ },
922
918
  /* 17 */
923
- /***/ function(module, exports) {
919
+ /***/ function(module, exports, __webpack_require__) {
924
920
 
925
921
  'use strict';
926
922
 
927
923
  exports.__esModule = true;
924
+
925
+ var _utils = __webpack_require__(5);
926
+
928
927
  var logger = {
929
928
  methodMap: ['debug', 'info', 'warn', 'error'],
930
929
  level: 'info',
@@ -932,7 +931,7 @@ return /******/ (function(modules) { // webpackBootstrap
932
931
  // Maps a given level value to the `methodMap` indexes above.
933
932
  lookupLevel: function lookupLevel(level) {
934
933
  if (typeof level === 'string') {
935
- var levelMap = logger.methodMap.indexOf(level.toLowerCase());
934
+ var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
936
935
  if (levelMap >= 0) {
937
936
  level = levelMap;
938
937
  } else {
@@ -1238,6 +1237,7 @@ return /******/ (function(modules) { // webpackBootstrap
1238
1237
 
1239
1238
  var partialBlock = undefined;
1240
1239
  if (options.fn && options.fn !== noop) {
1240
+ options.data = _base.createFrame(options.data);
1241
1241
  partialBlock = options.data['partial-block'] = options.fn;
1242
1242
 
1243
1243
  if (partialBlock.partials) {
@@ -1295,6 +1295,7 @@ return /******/ (function(modules) { // webpackBootstrap
1295
1295
  if (root.Handlebars === Handlebars) {
1296
1296
  root.Handlebars = $Handlebars;
1297
1297
  }
1298
+ return Handlebars;
1298
1299
  };
1299
1300
  };
1300
1301
 
@@ -1399,7 +1400,8 @@ return /******/ (function(modules) { // webpackBootstrap
1399
1400
  symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
1400
1401
  terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
1401
1402
  productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
1402
- performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
1403
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
1404
+ /**/) {
1403
1405
 
1404
1406
  var $0 = $$.length - 1;
1405
1407
  switch (yystate) {
@@ -1936,7 +1938,8 @@ return /******/ (function(modules) { // webpackBootstrap
1936
1938
  this.begin(condition);
1937
1939
  } };
1938
1940
  lexer.options = {};
1939
- lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1941
+ lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
1942
+ /**/) {
1940
1943
 
1941
1944
  function strip(start, end) {
1942
1945
  return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
@@ -2103,7 +2106,7 @@ return /******/ (function(modules) { // webpackBootstrap
2103
2106
  return 72;
2104
2107
  break;
2105
2108
  case 42:
2106
- return 72;
2109
+ yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
2107
2110
  break;
2108
2111
  case 43:
2109
2112
  return 'INVALID';
@@ -2113,7 +2116,7 @@ return /******/ (function(modules) { // webpackBootstrap
2113
2116
  break;
2114
2117
  }
2115
2118
  };
2116
- lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[[^\]]*\])/, /^(?:.)/, /^(?:$)/];
2119
+ lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2117
2120
  lexer.conditions = { "mu": { "rules": [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, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
2118
2121
  return lexer;
2119
2122
  })();
@@ -4296,13 +4299,14 @@ return /******/ (function(modules) { // webpackBootstrap
4296
4299
  setupHelper: function setupHelper(paramSize, name, blockHelper) {
4297
4300
  var params = [],
4298
4301
  paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
4299
- var foundHelper = this.nameLookup('helpers', name, 'helper');
4302
+ var foundHelper = this.nameLookup('helpers', name, 'helper'),
4303
+ callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : {}');
4300
4304
 
4301
4305
  return {
4302
4306
  params: params,
4303
4307
  paramsInit: paramsInit,
4304
4308
  name: foundHelper,
4305
- callParams: [this.contextName(0)].concat(params)
4309
+ callParams: [callContext].concat(params)
4306
4310
  };
4307
4311
  },
4308
4312
 
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
 
3
- handlebars v4.0.2
3
+ handlebars v4.0.5
4
4
 
5
5
  Copyright (C) 2011-2015 by Yehuda Katz
6
6
 
@@ -207,7 +207,7 @@ return /******/ (function(modules) { // webpackBootstrap
207
207
 
208
208
  var _logger2 = _interopRequireDefault(_logger);
209
209
 
210
- var VERSION = '4.0.2';
210
+ var VERSION = '4.0.5';
211
211
  exports.VERSION = VERSION;
212
212
  var COMPILER_REVISION = 7;
213
213
 
@@ -259,7 +259,7 @@ return /******/ (function(modules) { // webpackBootstrap
259
259
  _utils.extend(this.partials, name);
260
260
  } else {
261
261
  if (typeof partial === 'undefined') {
262
- throw new _exception2['default']('Attempting to register a partial as undefined');
262
+ throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
263
263
  }
264
264
  this.partials[name] = partial;
265
265
  }
@@ -595,12 +595,6 @@ return /******/ (function(modules) { // webpackBootstrap
595
595
  }
596
596
 
597
597
  function execIteration(field, index, last) {
598
- // Don't iterate over undefined values since we can't execute blocks against them
599
- // in non-strict (js) mode.
600
- if (context[field] == null) {
601
- return;
602
- }
603
-
604
598
  if (data) {
605
599
  data.key = field;
606
600
  data.index = index;
@@ -621,7 +615,9 @@ return /******/ (function(modules) { // webpackBootstrap
621
615
  if (context && typeof context === 'object') {
622
616
  if (_utils.isArray(context)) {
623
617
  for (var j = context.length; i < j; i++) {
624
- execIteration(i, i, i === context.length - 1);
618
+ if (i in context) {
619
+ execIteration(i, i, i === context.length - 1);
620
+ }
625
621
  }
626
622
  } else {
627
623
  var priorKey = undefined;
@@ -852,11 +848,14 @@ return /******/ (function(modules) { // webpackBootstrap
852
848
 
853
849
  /***/ },
854
850
  /* 16 */
855
- /***/ function(module, exports) {
851
+ /***/ function(module, exports, __webpack_require__) {
856
852
 
857
853
  'use strict';
858
854
 
859
855
  exports.__esModule = true;
856
+
857
+ var _utils = __webpack_require__(4);
858
+
860
859
  var logger = {
861
860
  methodMap: ['debug', 'info', 'warn', 'error'],
862
861
  level: 'info',
@@ -864,7 +863,7 @@ return /******/ (function(modules) { // webpackBootstrap
864
863
  // Maps a given level value to the `methodMap` indexes above.
865
864
  lookupLevel: function lookupLevel(level) {
866
865
  if (typeof level === 'string') {
867
- var levelMap = logger.methodMap.indexOf(level.toLowerCase());
866
+ var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
868
867
  if (levelMap >= 0) {
869
868
  level = levelMap;
870
869
  } else {
@@ -1170,6 +1169,7 @@ return /******/ (function(modules) { // webpackBootstrap
1170
1169
 
1171
1170
  var partialBlock = undefined;
1172
1171
  if (options.fn && options.fn !== noop) {
1172
+ options.data = _base.createFrame(options.data);
1173
1173
  partialBlock = options.data['partial-block'] = options.fn;
1174
1174
 
1175
1175
  if (partialBlock.partials) {
@@ -1227,6 +1227,7 @@ return /******/ (function(modules) { // webpackBootstrap
1227
1227
  if (root.Handlebars === Handlebars) {
1228
1228
  root.Handlebars = $Handlebars;
1229
1229
  }
1230
+ return Handlebars;
1230
1231
  };
1231
1232
  };
1232
1233
 
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.21.0
4
+ version: 0.22.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: 2015-09-27 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs