haml_coffee_assets 1.14.1 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa1d0b5711934334f380182e359ac63089a72088
4
- data.tar.gz: 01a3abf96358488270710cb049da8d00a02050e6
3
+ metadata.gz: 0bd89ca47ef24516c5d86be7ee18b2c9335790db
4
+ data.tar.gz: 0d3f9c245d5eccdca1117824862ea11c59779e2f
5
5
  SHA512:
6
- metadata.gz: b4ff7a8c49889be4a7e1d887ba0ca53ea8d70127d52640b1082b59607d1af512979b0ebda52a751e5b67aeecf3af5d0bb27917d5c023aaa241d8e8f6350b5d77
7
- data.tar.gz: a4736ab36203046a86b84a5a2911210a807666fcb530c507329f18c58557a5250bf1e74d5905d7574a09d11ebd473b3cf2b75db68ec6f5344d9e1da290df678d
6
+ metadata.gz: 92896b473f7f10ee4fbbfbe58506cf345dd621c487ffe33943726148a6325ee8d8206169613106742e034e872ea5ed3a3363a754a318383d07366c9ea4018a00
7
+ data.tar.gz: afd6d4a27b9cff42b150c83b0f56f3842d0a5f1f06d392da4ed2f12737a2a3c4e0ef4c464a48f8f82295e920b9d32cc446f2ab2961e858fe799dd16a8f96c7d6
@@ -25,15 +25,11 @@ class ::ActionView::Template
25
25
  template = refresh(view)
26
26
  template.encode!
27
27
  end
28
- if ::ActionView::Template::Error.instance_method(:initialize).arity == 3
29
- # Rails < 4.0 expects three arguments here
28
+
29
+ if Rails::VERSION::STRING < "4"
30
30
  raise ::ActionView::Template::Error.new(template, assigns, e)
31
- elsif ::ActionView::Template::Error.instance_method(:initialize).arity == 2
32
- # and Rails >= 4.0 expects two arguments
33
- raise ::ActionView::Template::Error.new(template, e)
34
31
  else
35
- # try and fail graciously if this changes in the future
36
- raise e
32
+ raise ::ActionView::Template::Error.new(template, e)
37
33
  end
38
34
  end
39
35
  end
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module HamlCoffeeAssets
4
- VERSION = '1.14.1' unless defined?(HamlCoffeeAssets::VERSION)
4
+ VERSION = '1.15.0' unless defined?(HamlCoffeeAssets::VERSION)
5
5
  end
data/lib/js/hamlcoffee.js CHANGED
@@ -454,7 +454,7 @@ require.define("/haml-coffee.coffee",function(require,module,exports,__dirname,_
454
454
  indent = require('./util/text').indent;
455
455
 
456
456
  module.exports = HamlCoffee = (function() {
457
- HamlCoffee.VERSION = '1.12.0';
457
+ HamlCoffee.VERSION = '1.13.3';
458
458
 
459
459
  function HamlCoffee(options) {
460
460
  var segment, segments, _base, _base1, _base10, _base11, _base12, _base13, _base2, _base3, _base4, _base5, _base6, _base7, _base8, _base9, _i, _len;
@@ -674,13 +674,13 @@ require.define("/haml-coffee.coffee",function(require,module,exports,__dirname,_
674
674
  if (/^\s*$/.test(line)) {
675
675
  continue;
676
676
  }
677
- while (/^[%.#].*[{(]/.test(expression) && RegExp("^\\s{" + (this.tabSize + 2) + ",}").test(lines[0]) && !/^(\s*)[-=&!~.%#</]/.test(lines[0]) && /([-\w]+[\w:-]*\w?)\s*=|('\w+[\w:-]*\w?')\s*=|("\w+[\w:-]*\w?")\s*=|(\w+[\w:-]*\w?):|('[-\w]+[\w:-]*\w?'):|("[-\w]+[\w:-]*\w?"):|:(\w+[\w:-]*\w?)\s*=>|:?'([-\w]+[\w:-]*\w?)'\s*=>|:?"([-\w]+[\w:-]*\w?)"\s*=>/.test(lines[0])) {
677
+ while (/^[%.#].*[{(]/.test(expression) && RegExp("^\\s{" + (this.previousIndent + (this.tabSize || 2)) + "}").test(lines[0]) && !/^(\s*)[-=&!~.%#</]/.test(lines[0]) && /([-\w]+[\w:-]*\w?)\s*=|('\w+[\w:-]*\w?')\s*=|("\w+[\w:-]*\w?")\s*=|(\w+[\w:-]*\w?):|('[-\w]+[\w:-]*\w?'):|("[-\w]+[\w:-]*\w?"):|:(\w+[\w:-]*\w?)\s*=>|:?'([-\w]+[\w:-]*\w?)'\s*=>|:?"([-\w]+[\w:-]*\w?)"\s*=>/.test(lines[0]) && !/;\s*$/.test(lines[0])) {
678
678
  attributes = lines.shift();
679
679
  expression = expression.replace(/(\s)+\|\s*$/, '');
680
680
  expression += ' ' + attributes.match(/^\s*(.*?)(\s+\|\s*)?$/)[1];
681
681
  this.lineNumber++;
682
682
  }
683
- while (/^-#/.test(expression) && !/^(\s*)[-=&!~.%#</]/.test(lines[0]) && lines.length > 0) {
683
+ while (/^-#/.test(expression) && RegExp("^\\s{" + (this.previousIndent + (this.tabSize || 2)) + "}").test(lines[0]) && lines.length > 0) {
684
684
  lines.shift();
685
685
  this.lineNumber++;
686
686
  }
@@ -2093,7 +2093,7 @@ require.define("/nodes/filter.coffee",function(require,module,exports,__dirname,
2093
2093
  });
2094
2094
 
2095
2095
  require.define("/nodes/directive.coffee",function(require,module,exports,__dirname,__filename,process,global){(function() {
2096
- var Directive, Node, path, _ref,
2096
+ var CoffeeScript, Directive, Node, fs, path, _ref,
2097
2097
  __hasProp = {}.hasOwnProperty,
2098
2098
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
2099
2099
 
@@ -2101,6 +2101,11 @@ require.define("/nodes/directive.coffee",function(require,module,exports,__dirna
2101
2101
 
2102
2102
  Node = require('./node');
2103
2103
 
2104
+ if (!process.browser) {
2105
+ fs = require('fs');
2106
+ CoffeeScript = require('coffee-script');
2107
+ }
2108
+
2104
2109
  module.exports = Directive = (function(_super) {
2105
2110
  __extends(Directive, _super);
2106
2111
 
@@ -2111,7 +2116,7 @@ require.define("/nodes/directive.coffee",function(require,module,exports,__dirna
2111
2116
 
2112
2117
  Directive.prototype.directives = {
2113
2118
  include: function(expression) {
2114
- var context, e, name, statement, _ref1;
2119
+ var Compiler, code, compiler, context, e, error, name, source, statement, _ref1;
2115
2120
  try {
2116
2121
  _ref1 = expression.match(/\s*['"](.*?)['"](?:,\s*(.*))?\s*/), _ref1[0], name = _ref1[1], context = _ref1[2];
2117
2122
  } catch (_error) {
@@ -2127,6 +2132,26 @@ require.define("/nodes/directive.coffee",function(require,module,exports,__dirna
2127
2132
  return "" + this.namespace + "['" + name + "'].apply(" + context + ")";
2128
2133
  case 'amd':
2129
2134
  return "require('" + name + "').apply(" + context + ")";
2135
+ case 'standalone':
2136
+ if (browser.process) {
2137
+ throw new Error("Include directive not available in the Browser when placement is standalone.");
2138
+ } else {
2139
+ try {
2140
+ source = fs.readFileSync(name).toString();
2141
+ } catch (_error) {
2142
+ error = _error;
2143
+ console.error(" Error opening file: %s", error);
2144
+ console.error(error);
2145
+ }
2146
+ Compiler = require('../haml-coffee');
2147
+ compiler = new Compiler(this.options);
2148
+ compiler.parse(source);
2149
+ code = CoffeeScript.compile(compiler.precompile(), {
2150
+ bare: true
2151
+ });
2152
+ return statement = "`(function(){" + code + "}).apply(" + context + ")`";
2153
+ }
2154
+ break;
2130
2155
  default:
2131
2156
  throw new Error("Include directive not available when placement is " + this.placement);
2132
2157
  }
@@ -2155,6 +2180,10 @@ require.define("/nodes/directive.coffee",function(require,module,exports,__dirna
2155
2180
 
2156
2181
  });
2157
2182
 
2183
+ require.define("fs",function(require,module,exports,__dirname,__filename,process,global){// nothing to see here... no file methods for the browser
2184
+
2185
+ });
2186
+
2158
2187
  require.define("/hamlc.coffee",function(require,module,exports,__dirname,__filename,process,global){(function() {
2159
2188
  var CoffeeScript, Compiler, fs, __expressCache;
2160
2189
 
@@ -2171,6 +2200,22 @@ require.define("/hamlc.coffee",function(require,module,exports,__dirname,__filen
2171
2200
  __expressCache = {};
2172
2201
 
2173
2202
  module.exports = {
2203
+ render: function(source, context, options) {
2204
+ var compiler, template;
2205
+ if (context == null) {
2206
+ context = {};
2207
+ }
2208
+ if (options == null) {
2209
+ options = {};
2210
+ }
2211
+ options.placement = 'standalone';
2212
+ compiler = new Compiler(options);
2213
+ compiler.parse(source);
2214
+ template = new Function(CoffeeScript.compile(compiler.precompile(), {
2215
+ bare: true
2216
+ }));
2217
+ return template.call(context);
2218
+ },
2174
2219
  compile: function(source, options) {
2175
2220
  var compiler, template;
2176
2221
  if (options == null) {
@@ -2225,7 +2270,3 @@ require.define("/hamlc.coffee",function(require,module,exports,__dirname,__filen
2225
2270
  }).call(this);
2226
2271
 
2227
2272
  });
2228
-
2229
- require.define("fs",function(require,module,exports,__dirname,__filename,process,global){// nothing to see here... no file methods for the browser
2230
-
2231
- });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_coffee_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-02 00:00:00.000000000 Z
11
+ date: 2013-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script
@@ -91,7 +91,8 @@ files:
91
91
  - LICENSE
92
92
  - README.md
93
93
  homepage: https://github.com/netzpirat/haml_coffee_assets
94
- licenses: []
94
+ licenses:
95
+ - MIT
95
96
  metadata: {}
96
97
  post_install_message:
97
98
  rdoc_options: []
@@ -109,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  version: 1.3.6
110
111
  requirements: []
111
112
  rubyforge_project: haml_coffee_assets
112
- rubygems_version: 2.1.5
113
+ rubygems_version: 2.1.9
113
114
  signing_key:
114
115
  specification_version: 4
115
116
  summary: Haml CoffeeScript templates