envvy 1.0.8 → 1.0.9
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/README.md +22 -0
- data/lib/envvy/engine.rb +6 -4
- data/lib/envvy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db1cf253945a87997c530a576bc710b6d6b5e249
|
|
4
|
+
data.tar.gz: 856e0b75dc4ad126aa0b0bf726386c0e3f11d43d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d037347460b5d19d1894d127169ca82a7356e5c1948dc53f94435ee207afc58e0387791f8bc28c841a7210974ecf7c49cfa86be09d47a392acd5746bfb43ae6
|
|
7
|
+
data.tar.gz: ab4e4865e4dc7a54ca6255eb58407d231ff185936b734e2dc4b756b7d1b36cc0dec63697035e78261583ce5a2740f7c52f85b09bea39837e45fac7142fa21f21
|
data/README.md
CHANGED
|
@@ -34,6 +34,28 @@ js_config:
|
|
|
34
34
|
* Keys under config will be available in ENV, with capitalized names.
|
|
35
35
|
* Keys under js_config will be available in the window.js_env variable defined in the js_env.js file in your assets.
|
|
36
36
|
|
|
37
|
+
### Environnement specific variables
|
|
38
|
+
|
|
39
|
+
It's possible to define environnement specific values
|
|
40
|
+
|
|
41
|
+
``` yaml
|
|
42
|
+
config:
|
|
43
|
+
some_key: default_value
|
|
44
|
+
js_config:
|
|
45
|
+
some_other_key: other_default_value
|
|
46
|
+
|
|
47
|
+
development:
|
|
48
|
+
config:
|
|
49
|
+
some_key: development_value
|
|
50
|
+
js_config:
|
|
51
|
+
some_other_key: other_development_value
|
|
52
|
+
|
|
53
|
+
test:
|
|
54
|
+
config:
|
|
55
|
+
some_key: test_value
|
|
56
|
+
js_config:
|
|
57
|
+
some_other_key: other_test_value
|
|
58
|
+
```
|
|
37
59
|
## Contributing
|
|
38
60
|
|
|
39
61
|
1. Fork it ( https://github.com/[my-github-username]/envvy/fork )
|
data/lib/envvy/engine.rb
CHANGED
|
@@ -17,11 +17,13 @@ module Envvy
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
initializer "envvy.register_preprocessor", :after => "sprockets.environment" do
|
|
20
|
-
Rails.application.assets
|
|
21
|
-
|
|
22
|
-
context.
|
|
20
|
+
if Rails.application.assets
|
|
21
|
+
Rails.application.assets.register_preprocessor "application/javascript", :"js_env" do |context, source|
|
|
22
|
+
if context.logical_path == "js_env" && File.exist?(self.class.config_path)
|
|
23
|
+
context.depend_on(File.expand_path(self.class.config_path))
|
|
24
|
+
end
|
|
25
|
+
source
|
|
23
26
|
end
|
|
24
|
-
source
|
|
25
27
|
end
|
|
26
28
|
end
|
|
27
29
|
|
data/lib/envvy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: envvy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Guillaume Balaine
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-
|
|
12
|
+
date: 2015-12-28 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|