ngannotate-rails 0.9.6.2 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fbf0f62be2ffca2b0dbcfbde24f5a2104562773f
4
- data.tar.gz: 01d71388ee9ed9381abab2e89b0c07fb58096fcc
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZGFiNDQ4MDBiM2ZmYjQ0NjJiMmQ1MjViMjcwY2YyNTM1YTY2MmQ0Yg==
5
+ data.tar.gz: !binary |-
6
+ MjNlMDMzZTUzMTVlYWEzY2FmODJhM2M1MDQzNzRhYjE0YzhiZTJkZQ==
5
7
  SHA512:
6
- metadata.gz: 3053526a2a1dcce45c562a76a9a3609ebecc9e8fefb929d3443d9845107c90af1891b5439a8aed6403a81ad9c086d5bd456d8963dfd50b6c0f5c2fb56b2b5a59
7
- data.tar.gz: 5d26ce0de01d737665becfd20e2e9223d0146001a956d4c188f5bcf9ce8f70829e5b3786d3d6f2dbf987ff1c2320438e6631f487054e3dbff54d00af2cfa2648
8
+ metadata.gz: !binary |-
9
+ MDcxNDAzMmIwMDU1ZWU4MGEwMWIwMzkyZmFlOTYyYzQ2NmY4NTQxMDkyOWY1
10
+ NjVlYTY4ZWE2ZTU0YmY4N2I0YTI0Mzg2MDliNGY0YzQwNmY0OGUxMWFlYWU3
11
+ YjVhMWI1NzQyYzFkMGIyZGM3ZmQ0MzJjNjE1ZGVmYzZlN2IxNzA=
12
+ data.tar.gz: !binary |-
13
+ Y2U4ZGYyYjFjNWFhZTNjMWVjMWUyZDM2OTU2NGNlZTYyNGY5ZjQwNDI1MzY2
14
+ NmI1MThiOTdmYzk4MzAyNjY1MDY0MWEyMjIyODhlZTIzZTJkYWVmYjMzOTQy
15
+ NTgyYzFhNDI5ZTJhNDMxZmFhYWQyZDFmYjRlYTUwYzBkMmRiODc=
data/README.md CHANGED
@@ -14,7 +14,7 @@ And then execute:
14
14
 
15
15
  $ bundle
16
16
 
17
- That's it! ngannotate-rails integrates seamlessly into the Rails asset pipeline; your JavaScript or CoffeeScript assets will automatically be run through the ngannotate pre-minifier.
17
+ That's it! ngannotate-rails integrates seamlessly into the Rails asset pipeline; your JavaScript or CoffeeScript assets will automatically be run through the ng-annotate pre-minifier.
18
18
 
19
19
  Usage
20
20
  -----
@@ -38,30 +38,58 @@ Examples,
38
38
  NG_FORCE=true RAILS_ENV=development bundle exec rake assets:clean assets:precompile
39
39
 
40
40
 
41
+ Testing assets locally
42
+ ----------------------
43
+
44
+ To allow testing precompiled assets locally in development environment.
45
+
46
+ config/environments/development.yml
47
+
48
+ #
49
+ # to allow testing assets:precompile in development environment
50
+ # Usage:
51
+ # time NG_FORCE=true RAILS_ENV=development bundle exec rake assets:clean assets:precompile:primary
52
+ # NG_FORCE=true rails s -p 3001
53
+ #
54
+ if ENV['NG_FORCE'] == 'true'
55
+ config.assets.compress = true
56
+ config.assets.compile = false
57
+ config.assets.digest = true
58
+ config.assets.debug = false
59
+ end
60
+
61
+ precompile & start server
62
+
63
+ time NG_FORCE=true RAILS_ENV=development bundle exec rake assets:clean assets:precompile:primary
64
+ NG_FORCE=true rails s -p 3001
65
+
66
+
41
67
  Versioning
42
68
  ----------
43
69
 
44
- The ngannotate-rails version number mirrors the version number for the version of ngannotate that is bundled with it.
70
+ The ngannotate-rails version number mirrors the version number for the version of ng-annotate that is bundled with it.
71
+ For minor patch releases, when ng-annotate version is not changing, 4th digit is used (For example, "0.9.6.1").
72
+ Every released version is tagged with tag "v[VERSION]".
45
73
 
46
74
  Help
47
75
  ----
48
76
 
49
- * **Q**: I installed ngannotate-rails, but my assets aren't getting processed with ngannotate.
77
+ * **Q**: I installed ngannotate-rails, but my assets aren't getting processed with ng-annotate.
50
78
 
51
79
  **A:** Remember to delete `tmp/cache/assets` or `touch` all the related asset files so that the cached versions get regenerated. If you've precompiled your assets into `public/assets`, you'll need to re-precompile them.
52
80
 
53
81
  Hacking
54
82
  -------
55
83
 
56
- ### Upgrading ngannotate
84
+ ### Upgrading ng-annotate
57
85
 
58
- The actual ngannotate project is bundled into this gem via [Browserify](https://github.com/substack/node-browserify). You can update to the latest version of ngannotate via Rake:
86
+ The actual ngannotate project is bundled into this gem via [Browserify](https://github.com/substack/node-browserify). You can update to the latest version of ng-annotate via Rake:
59
87
 
60
88
  rake ngannotate:build
61
89
 
62
90
  ### Test Application
63
91
 
64
- There is a Rails 3 application bundled in `example/` that you can use to test the asset pipeline integration. Don't forget to remove `tmp/cache/assets` after upgrading to the latest version of ngannotate.
92
+ There is a Rails 3 application bundled in `example/` that you can use to test the asset pipeline integration. Don't forget to remove `tmp/cache/assets` after upgrading to the latest version of ng-annotate.
65
93
 
66
94
  Credits
67
95
  -------
@@ -1,5 +1,5 @@
1
1
  module Ngannotate
2
2
  module Rails
3
- VERSION = "0.9.6.2"
3
+ VERSION = "0.9.7"
4
4
  end
5
5
  end
@@ -1319,8 +1319,7 @@ function matchRegular(node, ctx) {
1319
1319
  // matches with --regexp "^require(.*)$"
1320
1320
  // require("app-module").controller("MyCtrl", function($scope) {});
1321
1321
  function isReDef(node, ctx) {
1322
- var slice = ctx.src.slice(node.range[0], node.range[1]);
1323
- return ctx.re.test(slice);
1322
+ return ctx.re.test(ctx.srcForRange(node.range));
1324
1323
  }
1325
1324
 
1326
1325
  // Long form: angular.module(*).controller("MyCtrl", function($scope, $timeout) {});
@@ -1521,6 +1520,9 @@ window.annotate = function ngAnnotate(src, options) {
1521
1520
  mode: mode,
1522
1521
  quot: quot,
1523
1522
  src: src,
1523
+ srcForRange: function(range) {
1524
+ return src.slice(range[0], range[1]);
1525
+ },
1524
1526
  re: re,
1525
1527
  comments: comments,
1526
1528
  fragments: fragments,
@@ -1661,6 +1663,11 @@ function visitNodeFollowingNgInjectComment(node, ctx) {
1661
1663
  addRemoveInjectArray(d0.init.params, isSemicolonTerminated ? nr1 : d0.init.range[1], d0.id.name);
1662
1664
  } else if (ctx.isFunctionDeclarationWithArgs(node)) {
1663
1665
  addRemoveInjectArray(node.params, nr1, node.id.name);
1666
+ } else if (node.type === "ExpressionStatement" && node.expression.type === "AssignmentExpression" &&
1667
+ ctx.isFunctionExpressionWithArgs(node.expression.right)) {
1668
+ var isSemicolonTerminated$0 = (ctx.src[nr1 - 1] === ";");
1669
+ var name = ctx.srcForRange(node.expression.left.range);
1670
+ addRemoveInjectArray(node.expression.right.params, isSemicolonTerminated$0 ? nr1 : node.expression.right.range[1], name);
1664
1671
  }
1665
1672
 
1666
1673
  function getIndent(pos) {
@@ -1687,7 +1694,7 @@ function visitNodeFollowingNgInjectComment(node, ctx) {
1687
1694
  var hasInjectArray = (nextNode.type === "ExpressionStatement" && assignment.type === "AssignmentExpression" &&
1688
1695
  assignment.operator === "=" &&
1689
1696
  (lvalue = assignment.left).type === "MemberExpression" &&
1690
- lvalue.computed === false && lvalue.object.name === name && lvalue.property.name === "$inject");
1697
+ lvalue.computed === false && ctx.srcForRange(lvalue.object.range) === name && lvalue.property.name === "$inject");
1691
1698
 
1692
1699
  if (ctx.mode === "rebuild" && hasInjectArray) {
1693
1700
  ctx.fragments.push({
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ngannotate-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6.2
4
+ version: 0.9.7
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-18 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: execjs
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Use ngannotate in the Rails asset pipeline.
@@ -96,18 +96,18 @@ require_paths:
96
96
  - lib
97
97
  required_ruby_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - '>='
99
+ - - ! '>='
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - '>='
104
+ - - ! '>='
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.0.3
109
+ rubygems_version: 2.2.2
110
110
  signing_key:
111
111
  specification_version: 4
112
- summary: 'Summary: Use ngannotate in the Rails asset pipeline.'
112
+ summary: ! 'Summary: Use ngannotate in the Rails asset pipeline.'
113
113
  test_files: []