microsandbox-rb 0.18.0 → 0.19.0

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.
data/lib/microsandbox.rb CHANGED
@@ -130,9 +130,8 @@ module Microsandbox
130
130
  if version
131
131
  opts["version"] = version.to_s
132
132
  unless version.to_s.delete_prefix("v") == sdk_runtime_version
133
- warn "[microsandbox] setup(version: #{version.to_s.inspect}): this SDK launches only runtime " \
134
- "#{sdk_runtime_version}; a #{version.to_s.delete_prefix("v")} runtime will be refused " \
135
- "at every local sandbox start"
133
+ warn "[microsandbox] setup(version: #{version.to_s.inspect}): the bundled runtime is " \
134
+ "#{sdk_runtime_version}; other releases must satisfy the launch capability checks"
136
135
  end
137
136
  end
138
137
  opts["force"] = true if force
@@ -163,8 +162,8 @@ module Microsandbox
163
162
  end
164
163
 
165
164
  # Make sure local sandboxes can start: the runtime pair resolves and its
166
- # `msb` is exactly the version this SDK was built for (runtime v0.7 refuses
167
- # every other one at launch). Called automatically by {Sandbox.create},
165
+ # `msb` matches the version this SDK bundles, or an explicit override
166
+ # has been reported for the caller to check. Called automatically by {Sandbox.create},
168
167
  # {Sandbox.start} and the other calls that boot a microVM, so a freshly
169
168
  # installed gem gets a working runtime without a manual {install} step.
170
169
  #
@@ -179,7 +178,7 @@ module Microsandbox
179
178
  # - the runtime home's own `msb` is another version: warn, then
180
179
  # `install(force: true)` replaces the pair;
181
180
  # - another source (`MSB_PATH`, configured paths) is another version:
182
- # never touched — warn that every local start will be refused;
181
+ # never touched — warn about the version mismatch;
183
182
  # - a partial pair: raise with the files to delete or the variable to set.
184
183
  #
185
184
  # The local backend reads its runtime configuration (`MSB_HOME`,
@@ -563,7 +562,7 @@ module Microsandbox
563
562
  false
564
563
  end
565
564
 
566
- # "0.7.14", the runtime version this SDK launches.
565
+ # The runtime version bundled with this SDK.
567
566
  def sdk_runtime_version = RUNTIME_VERSION.delete_prefix("v")
568
567
 
569
568
  # The state of the runtime home itself — the exact two files the resolver
@@ -647,7 +646,7 @@ module Microsandbox
647
646
  # and will not touch.
648
647
  def warn_runtime_mismatch(info)
649
648
  warn "[microsandbox] runtime #{info.version || "no embedded version (pre-0.7 msb or a wrapper script)"} " \
650
- "at #{info.msb_path} ≠ SDK #{sdk_runtime_version}: every local sandbox start will be refused"
649
+ "at #{info.msb_path} ≠ bundled runtime #{sdk_runtime_version}: launch compatibility is not guaranteed"
651
650
  end
652
651
  end
653
652
 
data/sig/microsandbox.rbs CHANGED
@@ -395,6 +395,7 @@ module Microsandbox
395
395
  def restart: (?force: bool, ?timeout: Numeric?, ?detached: bool) -> Sandbox
396
396
  def destroy: (?force: bool, ?timeout: Numeric?) -> nil
397
397
  def status: () -> Symbol
398
+ def local_runtime_version: () -> String?
398
399
  def owns_lifecycle?: () -> bool
399
400
  def detach: () -> nil
400
401
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: microsandbox-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ya-luotao