envvy 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac16142198bf160408763202786ef9c908e904e9
4
- data.tar.gz: 3597049580d66c7a22ed6bb16647f0e7392c5598
3
+ metadata.gz: db1cf253945a87997c530a576bc710b6d6b5e249
4
+ data.tar.gz: 856e0b75dc4ad126aa0b0bf726386c0e3f11d43d
5
5
  SHA512:
6
- metadata.gz: d897e363534cb8bad60c67753042d2a23367a638d4a9ada3180983f686b4438e42287415eca760227092ad1241adab4681b13d4228e4b9f7a5a266a844e201b8
7
- data.tar.gz: ccc37405faec5c0d3aff2ce847997fa2ad9718826348270602e04b9d0afd1450b0fd3d8c1939a099c8ad2216a1a38800b694794752c87871529a896802f7cccc
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.register_preprocessor "application/javascript", :"js_env" do |context, source|
21
- if context.logical_path == "js_env" && File.exist?(self.class.config_path)
22
- context.depend_on(File.expand_path(self.class.config_path))
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
@@ -1,3 +1,3 @@
1
1
  module Envvy
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
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.8
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-05-27 00:00:00.000000000 Z
12
+ date: 2015-12-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails