rhino_project_core 0.25.0.beta.11 → 0.25.0.beta.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9a4d38d3164d95a06aff3255dc4e7884b2666e02e29d27f426f15287554c149
4
- data.tar.gz: d51dbdeeb3ad9bd4da6dc23e99e25faa8a0e654bc5af0f43659f10c2f0b40f2d
3
+ metadata.gz: 14f49f694181ff2fd73332ee40968a218d703b049fc73706d9773bc0e4b0aec3
4
+ data.tar.gz: 5c3e68e884fda4a485de60f57e3501081c863d4f8500cedace8bd1404895e4ba
5
5
  SHA512:
6
- metadata.gz: 5cbc9c1e468d68c617f320e563dab87b78f7926aa5b6d8326544f5ff8d9175f9e92ad0e6922985af426644d25f0f2bd614244be6678c9936195fca2783282a08
7
- data.tar.gz: c1018bcd93ff4a3c1f00043d761290e646dcf2cf5758c95e269ebf736416a8dd9a60868d79b7b798b8d443a7eb207d3fb6474a215b018e60412b0531dab955d7
6
+ metadata.gz: 0aad76fc6e817b244d0e1d9723489a47104aab2a1e12a3612a03b80cac5c1722598e4108c06be000f021e57dc6cb41654b21cc441200319b4e228a288f4ab9bd
7
+ data.tar.gz: 50a16350ba3cc62c159115ee2387682e90e08c4347ed82e13e7afa5b6221c7398df81d5fd0e3e2c494c7833c78a9f399054e8f69aaada49ff6c8b7c26507dcab
@@ -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
@@ -10,7 +10,7 @@ module Rhino
10
10
  MAJOR = 0
11
11
  MINOR = 25
12
12
  TINY = 0
13
- PRE = "beta.11"
13
+ PRE = "beta.13"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
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.11
4
+ version: 0.25.0.beta.13
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