orbitcast 0.3.2 → 0.3.3
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/lib/orbitcast/launcher.rb +22 -0
- data/lib/orbitcast/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 02443a1065f1853c880979e0b62b658d28328b1e3557156ca40dd4583ee8a865
|
|
4
|
+
data.tar.gz: 0cc0740e5249005c0a3e6eb7a0d405ac8938c0f3440b0b22846e2159773b8937
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a11a8fd5650c58741a8d1988c6692af17cc9b1bbe410da5d1aa0ec046ffc53f993fe0e349ff3a5598cf5d5ef656f45c61d89d300f5a5b437120fd59f24693028
|
|
7
|
+
data.tar.gz: 9498c9cab7afbb2d10e64161e8600ddd473fd72256fd9a22846e5afabfbae5982d4aab2ae682df1ed1c1722373f2bf874dec04450552d0c133d9be66a9ec3d02
|
data/lib/orbitcast/launcher.rb
CHANGED
|
@@ -30,6 +30,10 @@ module Orbitcast
|
|
|
30
30
|
# treats it.
|
|
31
31
|
DEFAULT_COMMAND = "serve"
|
|
32
32
|
|
|
33
|
+
# Set by Mothership for a vessel it supervises; the relay docks when it
|
|
34
|
+
# sees them (src/config.rs).
|
|
35
|
+
DOCKING_KEYS = %w[MS_PID MS_SHIP].freeze
|
|
36
|
+
|
|
33
37
|
# Non-secret process environment forwarded to the child in *both* modes.
|
|
34
38
|
# Anything not listed here, in EXPORTED_KEYS, or (direct mode only) an
|
|
35
39
|
# `ORBITCAST_*` key of the parent is dropped (`unsetenv_others: true`).
|
|
@@ -104,6 +108,7 @@ module Orbitcast
|
|
|
104
108
|
|
|
105
109
|
def run
|
|
106
110
|
return exec_direct(verify: false) if passthrough?
|
|
111
|
+
return exec_docked if docked?
|
|
107
112
|
return exec_serve if command == DEFAULT_COMMAND && rails_application?
|
|
108
113
|
|
|
109
114
|
# Direct invocation: TOML/environment configured, no Rails boot.
|
|
@@ -144,6 +149,19 @@ module Orbitcast
|
|
|
144
149
|
strip_forbidden(child)
|
|
145
150
|
end
|
|
146
151
|
|
|
152
|
+
# Under Mothership the manifest configures the bay (its env and the
|
|
153
|
+
# docking handshake), so Rails is not booted and the supervisor's MS_*
|
|
154
|
+
# environment reaches the relay.
|
|
155
|
+
def docked?
|
|
156
|
+
DOCKING_KEYS.all? { |key| env[key] && !env[key].empty? }
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def docked_env
|
|
160
|
+
child = direct_env
|
|
161
|
+
env.each_pair { |key, value| child[key] = value if key.to_s.start_with?("MS_") }
|
|
162
|
+
child
|
|
163
|
+
end
|
|
164
|
+
|
|
147
165
|
# The positional command, ignoring flags and the values they consume.
|
|
148
166
|
# `nil` never: a bare invocation is `serve`.
|
|
149
167
|
def command
|
|
@@ -285,6 +303,10 @@ module Orbitcast
|
|
|
285
303
|
exec_process(direct_env, *argv, verify: verify)
|
|
286
304
|
end
|
|
287
305
|
|
|
306
|
+
def exec_docked
|
|
307
|
+
exec_process(docked_env, *argv)
|
|
308
|
+
end
|
|
309
|
+
|
|
288
310
|
def strip_forbidden(child)
|
|
289
311
|
FORBIDDEN_KEYS.each { |key| child.delete(key) }
|
|
290
312
|
child
|
data/lib/orbitcast/version.rb
CHANGED
|
@@ -6,5 +6,5 @@ module Orbitcast
|
|
|
6
6
|
# `Cargo.toml` is the release authority; release-please keeps this constant in
|
|
7
7
|
# lockstep through its extra-file updater. The trailing annotation below is the
|
|
8
8
|
# updater marker -- do not reformat the line or the bump will silently no-op.
|
|
9
|
-
VERSION = "0.3.
|
|
9
|
+
VERSION = "0.3.3" # x-release-please-version
|
|
10
10
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: orbitcast
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abdelkader Boudih
|
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
123
|
version: '0'
|
|
124
124
|
requirements: []
|
|
125
|
-
rubygems_version: 4.0.
|
|
125
|
+
rubygems_version: 4.0.20
|
|
126
126
|
specification_version: 4
|
|
127
127
|
summary: 'Rails real-time stack: ActionCable-compatible WebSocket relay in Rust'
|
|
128
128
|
test_files: []
|