ngannotate-rails 0.15.4 → 0.15.4.1
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 +4 -4
- data/.gitignore +1 -0
- data/README.md +24 -0
- data/lib/ngannotate/processor3.rb +65 -0
- data/lib/ngannotate/rails/railtie.rb +5 -1
- data/lib/ngannotate/rails/version.rb +1 -1
- data/lib/ngannotate-rails.rb +1 -0
- data/lib/ngannotate.rb +8 -0
- data/ngannotate-rails.gemspec +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 803c3f028160ddb16f237bde0767253166634f9d
|
4
|
+
data.tar.gz: 39f5bff0e5db3f5ee4b28938411c8dba6da5e4b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2eea9455191842a3d04f6653d4711b0972336a00cfa24c1f637d936b560bd44a4b5b71eb257ce57f9feec9e7f29da9de8518a8b67a9c874c65082b5fb7889a
|
7
|
+
data.tar.gz: 350ee5ef46ae826c1158bb469fdff542cf9062b742de27e1ec443c79d9d19ed65d59ef9721b8f1ec5fc17b93164023eb15687dc223cab87fec768f1e2e071e7e
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -80,6 +80,30 @@ The ngannotate-rails version number mirrors the version number for the version o
|
|
80
80
|
For minor patch releases, when ng-annotate version is not changing, 4th digit is used (For example, "0.9.6.1").
|
81
81
|
Every released version is tagged with tag "v[VERSION]".
|
82
82
|
|
83
|
+
Release Process
|
84
|
+
---------------
|
85
|
+
|
86
|
+
For ngannotate update:
|
87
|
+
|
88
|
+
```bash
|
89
|
+
git checkout master
|
90
|
+
git pull
|
91
|
+
rake ngannotate:build
|
92
|
+
git citool
|
93
|
+
# check that result makes sense and if so,
|
94
|
+
# use comment: ngannotate: vX.Y.Z
|
95
|
+
git tag vX.Y.Z
|
96
|
+
git push
|
97
|
+
git push --tags
|
98
|
+
gem build ngannotate-rails.gemspec
|
99
|
+
gem push ngannotate-rails-X.Y.Z.gems
|
100
|
+
```
|
101
|
+
|
102
|
+
For internal fixes:
|
103
|
+
|
104
|
+
Similar except no ngannotate:build and new version is previous plus fourth digit for patch level (see Versioning).
|
105
|
+
|
106
|
+
|
83
107
|
Help
|
84
108
|
----
|
85
109
|
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'execjs'
|
2
|
+
|
3
|
+
module Ngannotate
|
4
|
+
class Processor
|
5
|
+
def self.instance
|
6
|
+
@instance ||= new
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.name
|
10
|
+
'Ngannotate::Processor'
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.call(input)
|
14
|
+
instance.call(input)
|
15
|
+
end
|
16
|
+
|
17
|
+
def call(input)
|
18
|
+
data = input[:data]
|
19
|
+
return data if skip
|
20
|
+
prepare
|
21
|
+
opt = { add: true }.merge!(parse_opt)
|
22
|
+
r = @context.call 'window.annotate', data, opt
|
23
|
+
r['src']
|
24
|
+
end
|
25
|
+
|
26
|
+
def prepare
|
27
|
+
return if skip
|
28
|
+
ngannotate_source = File.open(File.join(File.dirname(__FILE__), '../../vendor/ngannotate.js')).read
|
29
|
+
@context = ExecJS.compile "window = {};" + ngannotate_source
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# To allow testing assets compile in development environment
|
34
|
+
#
|
35
|
+
# To explicitly force assets compile in development environment
|
36
|
+
# NG_FORCE=true RAILS_ENV=development bundle exec rake assets:clean assets:precompile
|
37
|
+
# or add to environments/development.rb
|
38
|
+
# config.ng_annotate.process = true
|
39
|
+
#
|
40
|
+
def force
|
41
|
+
ENV['NG_FORCE'] == 'true'
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Skip processing in environments where it does not make sense.
|
46
|
+
# Override by NG_FORCE=true env variable
|
47
|
+
#
|
48
|
+
def skip
|
49
|
+
!force && !::Rails.configuration.ng_annotate.process
|
50
|
+
end
|
51
|
+
|
52
|
+
def parse_opt
|
53
|
+
opt = {}
|
54
|
+
opt_str = ENV['NG_OPT']
|
55
|
+
if opt_str
|
56
|
+
opt = Hash[opt_str.split(',').map { |e| e.split('=') }]
|
57
|
+
opt.symbolize_keys!
|
58
|
+
end
|
59
|
+
if ENV['NG_REGEXP']
|
60
|
+
opt[:regexp] = ENV['NG_REGEXP']
|
61
|
+
end
|
62
|
+
opt
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative 'ngannotate'
|
data/lib/ngannotate.rb
ADDED
data/ngannotate-rails.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://github.com/kikonen/ngannotate-rails"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/).reject {|f| f
|
16
|
+
spec.files = `git ls-files`.split($/).reject {|f| f =~ /example/ || f =~ /test/}
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
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.15.4
|
4
|
+
version: 0.15.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kari Ikonen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -80,7 +80,10 @@ files:
|
|
80
80
|
- LICENSE.txt
|
81
81
|
- README.md
|
82
82
|
- Rakefile
|
83
|
+
- lib/ngannotate-rails.rb
|
84
|
+
- lib/ngannotate.rb
|
83
85
|
- lib/ngannotate/processor.rb
|
86
|
+
- lib/ngannotate/processor3.rb
|
84
87
|
- lib/ngannotate/rails.rb
|
85
88
|
- lib/ngannotate/rails/railtie.rb
|
86
89
|
- lib/ngannotate/rails/version.rb
|
@@ -111,4 +114,3 @@ signing_key:
|
|
111
114
|
specification_version: 4
|
112
115
|
summary: 'Summary: Use ngannotate in the Rails asset pipeline.'
|
113
116
|
test_files: []
|
114
|
-
has_rdoc:
|