ngannotate-rails 0.14.0 → 0.14.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/ngannotate/processor.rb +3 -1
- data/lib/ngannotate/rails/railtie.rb +7 -0
- data/lib/ngannotate/rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76f18064b3f05f1095ce98f771f09bfe9f84681f
|
4
|
+
data.tar.gz: 6ff5ced0258a5811c01e4e224083a30181bf4b25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb4d157bd943ec7c58900849d35be2a8c83bc96aaef4911412907d84305ca7c3a7d457fd049a1504a7bac4b8d08736d3b1c92b0d8b1860694e0df59feab0088f
|
7
|
+
data.tar.gz: 17ef84bb1a3b0c91d63f46c0e71fb7a0caf9aea137ed047c5ec624ee89e530a5230bc2448fa4c86ec383fa01e0cd7c71b2d1b410173169ac18a3199fa8df4e5c
|
data/README.md
CHANGED
@@ -30,6 +30,15 @@ Options available as environment variables:
|
|
30
30
|
see ng-annotate documentation
|
31
31
|
NG_FORCE=true - force ng-annoate processing in development/test environment
|
32
32
|
|
33
|
+
You can also define when ng-annotate should process with the `process` option to the environment configuration
|
34
|
+
|
35
|
+
config/environments/development.rb
|
36
|
+
|
37
|
+
Rails.application.configure do
|
38
|
+
...
|
39
|
+
config.ng_annotate.process = true
|
40
|
+
...
|
41
|
+
end
|
33
42
|
|
34
43
|
Examples,
|
35
44
|
|
data/lib/ngannotate/processor.rb
CHANGED
@@ -18,6 +18,8 @@ module Ngannotate
|
|
18
18
|
#
|
19
19
|
# To explicitly force assets compile in development environment
|
20
20
|
# NG_FORCE=true RAILS_ENV=development bundle exec rake assets:clean assets:precompile
|
21
|
+
# or add to environments/development.rb
|
22
|
+
# config.ng_annotate.process = true
|
21
23
|
#
|
22
24
|
def force
|
23
25
|
ENV['NG_FORCE'] == 'true'
|
@@ -28,7 +30,7 @@ module Ngannotate
|
|
28
30
|
# Override by NG_FORCE=true env variable
|
29
31
|
#
|
30
32
|
def skip
|
31
|
-
!force &&
|
33
|
+
!force && !::Rails.configuration.ng_annotate.process
|
32
34
|
end
|
33
35
|
|
34
36
|
def evaluate(context, locals)
|
@@ -1,8 +1,15 @@
|
|
1
|
+
require 'active_support/core_ext/class/attribute'
|
1
2
|
require 'ngannotate/processor'
|
2
3
|
|
3
4
|
module Ngannotate
|
4
5
|
module Rails
|
5
6
|
class Railtie < ::Rails::Railtie
|
7
|
+
config.ng_annotate = ActiveSupport::OrderedOptions.new
|
8
|
+
|
9
|
+
# Establish static configuration defaults
|
10
|
+
# Disabled by default in development and test environments
|
11
|
+
config.ng_annotate.process = !::Rails.env.development? && !::Rails.env.test?
|
12
|
+
|
6
13
|
initializer "ngannotate-rails.add_ngannotate_postprocessor", :group => :all do |app|
|
7
14
|
app.assets.register_postprocessor 'application/javascript', Ngannotate::Processor
|
8
15
|
end
|
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.14.0
|
4
|
+
version: 0.14.0.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: 2014-
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -111,3 +111,4 @@ signing_key:
|
|
111
111
|
specification_version: 4
|
112
112
|
summary: 'Summary: Use ngannotate in the Rails asset pipeline.'
|
113
113
|
test_files: []
|
114
|
+
has_rdoc:
|