rhino_project_core 0.25.0.beta.10 → 0.25.0.beta.12
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/app/helpers/rhino/env_helper.rb +32 -0
- data/lib/rhino/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc6f1dbeedce51a13a53e5acacfa342ac6169a33ecdd0f029176f57078752d2b
|
4
|
+
data.tar.gz: 111889cd46f47a1a5b90586697a95bf3802b993bc6462d86751ae3d7fa481bb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f91cec8c7f87fef052163744408c3594e458ae5c668738f390c15577f5e79cdc74503f7ac6bc93b50bbda7848a8da9106783ad891b2add2d7cad5f8f6c81ac5
|
7
|
+
data.tar.gz: b1538daafb3c48b289db2a7d02a9eaea5af8596dde3c2289fa2e16c654ece0da6eda68f1d0c3558e90ada050e96bbff7f7ffe7f5941c4049ef6a95a8e6e9dc27
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rhino
|
4
|
+
module EnvHelper
|
5
|
+
module_function
|
6
|
+
|
7
|
+
def rhino_env_tag
|
8
|
+
# Filter environment variables to get only those starting with "RHINO_PUBLIC"
|
9
|
+
rhino_public_env = ENV.select { |key, _| key.start_with?("RHINO_PUBLIC") }
|
10
|
+
|
11
|
+
# Create a JavaScript object with the environment variables
|
12
|
+
js_env = rhino_public_env.transform_keys { |key| key.sub("RHINO_PUBLIC_", "") }
|
13
|
+
|
14
|
+
# Create a JavaScript snippet that initializes window.rhino.env
|
15
|
+
js_code = <<~JS
|
16
|
+
(function() {
|
17
|
+
window.rhino = window.rhino || {};
|
18
|
+
window.rhino.env = window.rhino.env || {};
|
19
|
+
var env = #{js_env.to_json};
|
20
|
+
for (var key in env) {
|
21
|
+
if (Object.prototype.hasOwnProperty.call(env, key)) {
|
22
|
+
window.rhino.env[key] = env[key];
|
23
|
+
}
|
24
|
+
}
|
25
|
+
})();
|
26
|
+
JS
|
27
|
+
|
28
|
+
# Return as a script tag
|
29
|
+
javascript_tag(js_code)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/rhino/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhino_project_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.25.0.beta.
|
4
|
+
version: 0.25.0.beta.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Rosevear
|
@@ -387,6 +387,7 @@ files:
|
|
387
387
|
- app/controllers/rhino/crud_controller.rb
|
388
388
|
- app/controllers/rhino/simple_controller.rb
|
389
389
|
- app/controllers/rhino/simple_stream_controller.rb
|
390
|
+
- app/helpers/rhino/env_helper.rb
|
390
391
|
- app/helpers/rhino/omniauth_helper.rb
|
391
392
|
- app/helpers/rhino/policy_helper.rb
|
392
393
|
- app/helpers/rhino/segment_helper.rb
|