We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a41aca3 commit 57e0d6fCopy full SHA for 57e0d6f
1 file changed
lib/react/config.rb.erb
@@ -0,0 +1,38 @@
1
+if RUBY_ENGINE != 'opal'
2
+ module React
3
+ module Config
4
+ extend self
5
+ def environment=(value)
6
+ config[:environment] = value
7
+ end
8
+
9
+ def config
10
+ @config ||= default_config
11
12
13
+ def default_config
14
+ {
15
+ environment: ENV['RACK_ENV'] || 'development'
16
+ }
17
18
19
20
+else
21
22
23
24
25
+ raise "Environment cannot be configured at runtime."
26
27
28
29
+ hash = %x{
30
+ Opal.hash({
31
+ environment: <%= '"' + React::Config.config[:environment] + '"' %>
32
+ })
33
34
+ hash
35
36
37
38
+end
0 commit comments