ngannotate-rails 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTU4MjFkOTczODkxOTFmZjMwYjhiYWJhNzJmNGU2YmU0OTNlZWQ5Yw==
4
+ MWM2Yzk4NzkwZDA0Zjk3YmU5YTMwYTU5Y2Q0Mzg3NTQxODUyZjdmYg==
5
5
  data.tar.gz: !binary |-
6
- MDdlMjViMzY1YzgwNmE3MWUxOWZiOTFmMTA0NjgxNWZkMzUyMTA0NQ==
6
+ ZmUwMWE3MjBlYzA5YTg5NjAzOTIyNmMxYmYxODAyYzUyODUzN2I5NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzNmODlhNjg2MWMwNTJiOWQ2YmViNWUxZTUzZmM0YTAzNTBmYzU5OTE0YTkz
10
- OTE5ZDk5N2RlMGFjNTI0ZjQxZTkzNjg0OWE1NDdmNGZjYjk0NjBmNmZmYjU4
11
- ZTFhNThhMzkxNTRiZTEwYTYzNzBkNWMzMjZkM2RkOTQxNGUxMjk=
9
+ NjA0N2RjNDEwODk5NzI4MGI4NjBhYjNmMzQ1MDFjMTFjODI0ZDNlMTM3MDgx
10
+ MmJhZDNhOGE3OTU4OGFjM2QxZGMwNWYzZTFhNDkwNmNhMmUzNTgzN2FkZmFj
11
+ NDQ5MTgwNzhiY2RiYjRjMzYyMDIwY2ZmZmNlNjI2YjQ2YjM5YjM=
12
12
  data.tar.gz: !binary |-
13
- MmQ2N2Q4YzczMjJkMjM3OWM3NDNjYTIwMWRlMjY4YjhmYzhiZDQ3YzM1Mzc4
14
- YzhkMzVkYjI4OWVhNTE5ZjgxODhlOTQyYWYyYThiMDczMWEzMjY0MTc1ZjFk
15
- M2FkMTg1MTBhMTdmZDUxMDRlYmUxZmExNzE1ZmUzMjY5OTE5Y2E=
13
+ ZTc4N2RkM2M5N2I3YTY1NTAzMzVhYzUyNjIxZDg4NWI0NjcyMjNkMmY1MDFh
14
+ Y2Q3ZWEwOGU5ZjY3Y2RmZTg2M2MwMzFiYjZlMmJiZWVjNTg5MTJiMzQ5YzMx
15
+ ZDE2MzRlYTBjMjNkNTQxZDI4MTFlNjk2M2MyZTM3NmMxNDQ1OTg=
@@ -1,5 +1,5 @@
1
1
  module Ngannotate
2
2
  module Rails
3
- VERSION = "0.9.5"
3
+ VERSION = "0.9.6"
4
4
  end
5
5
  end
data/vendor/ngannotate.js CHANGED
@@ -1104,7 +1104,7 @@ var chainedUrlRouterProvider = 2;
1104
1104
  var chainedStateProvider = 3;
1105
1105
  var chainedRegular = 4;
1106
1106
 
1107
- function match(node, re, matchPlugins) {
1107
+ function match(node, ctx, matchPlugins) {
1108
1108
  var isMethodCall = (
1109
1109
  node.type === "CallExpression" &&
1110
1110
  node.callee.type === "MemberExpression" &&
@@ -1112,7 +1112,7 @@ function match(node, re, matchPlugins) {
1112
1112
  );
1113
1113
 
1114
1114
  var matchMethodCalls = (isMethodCall &&
1115
- (matchRegular(node, re) || matchNgRoute(node) || matchNgUi(node) || matchHttpProvider(node)));
1115
+ (matchRegular(node, ctx) || matchNgRoute(node) || matchNgUi(node) || matchHttpProvider(node)));
1116
1116
 
1117
1117
  return matchMethodCalls ||
1118
1118
  (matchPlugins && matchPlugins(node)) ||
@@ -1285,14 +1285,14 @@ function matchHttpProvider(node) {
1285
1285
  node.arguments.length >= 1 && node.arguments);
1286
1286
  }
1287
1287
 
1288
- function matchRegular(node, re) {
1288
+ function matchRegular(node, ctx) {
1289
1289
  // we already know that node is a (non-computed) method call
1290
1290
  var callee = node.callee;
1291
1291
  var obj = callee.object; // identifier or expression
1292
1292
  var method = callee.property; // identifier
1293
1293
 
1294
- var matchAngularModule = (obj.$chained === chainedRegular || isShortDef(obj, re) || isMediumDef(obj, re) || isLongDef(obj)) &&
1295
- is.someof(method.name, ["provider", "value", "constant", "bootstrap", "config", "factory", "directive", "filter", "run", "controller", "service", "decorator", "animation"]);
1294
+ var matchAngularModule = (obj.$chained === chainedRegular || isReDef(obj, ctx) || isLongDef(obj)) &&
1295
+ is.someof(method.name, ["provider", "value", "constant", "bootstrap", "config", "factory", "directive", "filter", "run", "controller", "service", "decorator", "animation", "invoke"]);
1296
1296
  if (!matchAngularModule) {
1297
1297
  return false;
1298
1298
  }
@@ -1313,17 +1313,14 @@ function matchRegular(node, re) {
1313
1313
  return target;
1314
1314
  }
1315
1315
 
1316
- // Short form: *.controller("MyCtrl", function($scope, $timeout) {});
1317
- function isShortDef(node, re) {
1318
- return node.type === "Identifier" && is.string(node.name) && (!re || re.test(node.name));
1319
- }
1320
-
1321
- // Medium form: *.*.controller("MyCtrl", function($scope, $timeout) {});
1322
- function isMediumDef(node, re) {
1323
- if (node.type === "MemberExpression" && is.string(node.object.name) && is.string(node.property.name)) {
1324
- return (!re || re.test(node.object.name + "." + node.property.name));
1325
- }
1326
- return false;
1316
+ // matches with default regexp
1317
+ // *.controller("MyCtrl", function($scope, $timeout) {});
1318
+ // *.*.controller("MyCtrl", function($scope, $timeout) {});
1319
+ // matches with --regexp "^require(.*)$"
1320
+ // require("app-module").controller("MyCtrl", function($scope) {});
1321
+ function isReDef(node, ctx) {
1322
+ var slice = ctx.src.slice(node.range[0], node.range[1]);
1323
+ return ctx.re.test(slice);
1327
1324
  }
1328
1325
 
1329
1326
  // Long form: angular.module(*).controller("MyCtrl", function($scope, $timeout) {});
@@ -1470,7 +1467,7 @@ window.annotate = function ngAnnotate(src, options) {
1470
1467
  }
1471
1468
 
1472
1469
  var quot = options.single_quotes ? "'" : '"';
1473
- var re = (options.regexp && new RegExp(options.regexp));
1470
+ var re = (options.regexp ? new RegExp(options.regexp) : /^[a-zA-Z0-9_\$\.\s]+$/);
1474
1471
  var ast;
1475
1472
  var stats = {};
1476
1473
  try {
@@ -1524,6 +1521,7 @@ window.annotate = function ngAnnotate(src, options) {
1524
1521
  mode: mode,
1525
1522
  quot: quot,
1526
1523
  src: src,
1524
+ re: re,
1527
1525
  comments: comments,
1528
1526
  fragments: fragments,
1529
1527
  triggers: triggers,
@@ -1573,7 +1571,7 @@ window.annotate = function ngAnnotate(src, options) {
1573
1571
  recentCaller = last(callerIds);
1574
1572
  }
1575
1573
 
1576
- var targets = match(node, re, matchPluginsOrNull);
1574
+ var targets = match(node, ctx, matchPluginsOrNull);
1577
1575
  if (!targets) {
1578
1576
  return;
1579
1577
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ngannotate-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kari Ikonen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-02 00:00:00.000000000 Z
11
+ date: 2014-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails