Releases: ya-luotao/e2b-ruby
Releases · ya-luotao/e2b-ruby
v0.3.2 — Hardening pass
A focused hardening release covering correctness, safety, and protocol-layer test coverage. No breaking changes.
Fixed
parse_exit_codesilently mapping non-zero statuses to 0 —EnvdHttpClient#parse_exit_codepreviously returned0for any unparseable status string containing the digit"0"(e.g."code: 100","status: 20"), causing failed commands to look successful and skip raisingCommandExitError. Fallback now always returns1.- Streaming RPC retries replaying side-effecting requests —
EnvdHttpClient#handle_streaming_rpcno longer retries throughwith_retryonce any event has been delivered to the caller. Previously, a mid-stream connection drop onprocess.Process/Startcould spawn a second process and replay output to the user'son_stdoutcallback. Sandbox#process_sandbox_dataclobbering attributes — partial API responses that omitalias,clientID,cpuCount,memoryMB,metadata,startedAt, orendAtno longer overwrite previously-known values withnil.parse_timecrashing on non-string timestamps —Sandbox#parse_timeand the helpers inModels::SandboxInfo,Models::TemplateLogEntry, andModels::EntryInfonow also rescueTypeError, surviving malformed numeric or hash values.Filesystem#exists?swallowing allE2BErrorsubclasses — onlyNotFoundErroris treated as "does not exist"; auth/network errors propagate.examples/claude_code_runner.rb— replaced calls to non-existentsandbox.filesystemaccessor withsandbox.files, andentry[:name]hash access with theEntryInfo#nameaccessor. The shipped example is now actually runnable.
Changed
Sandbox#connect(instance method) is deprecated — emits a deprecation warning pointing to#resume. The class methodSandbox.connect(id, ...)is unchanged. The instance method only resumed the current sandbox, but its name collided with the class method's "connect to a sandbox by ID" semantics.Sandbox.listYARD return type corrected fromArray<Hash>toSandboxPaginator.Sandbox.killandSandbox#killidempotency is now documented in YARD; behavior is unchanged (returnstruewhether the sandbox was running or already gone).
Internal
- Replaced per-RPC
OpenStructallocation with aStruct(EnvdHttpClient::RpcResponse). Drops theostructgemspec dependency and reduces allocation cost on the hot path. - New
spec/e2b/services/envd_http_client_spec.rbadds 13 unit tests coveringparse_exit_code(regression),decode_base64,create_connect_envelope(UTF-8 multibyte + large bodies — protects the recent Encoding fix), andparse_connect_stream(binary envelope + NDJSON fallback). The wire-protocol layer previously had zero direct test coverage.
Full Changelog: v0.3.1...v0.3.2
v0.3.1
v0.3.0 — Full SDK Parity
Full parity with the official E2B Python/JS SDKs.
Highlights
- Template builder — programmatic API for building custom sandbox templates with Dockerfile parsing, file hashing, and build log streaming
- Access token auth — bearer token authentication alongside API keys
- Live streaming — real-time stdout/stderr callbacks for background commands and PTY sessions
- Snapshot management — create, list, and delete sandbox snapshots
- Sandbox lifecycle — auto-pause/resume, network restrictions, MCP gateway support
- File URL signing — HMAC-style signatures for secured sandbox file operations
- Pagination — cursor-based pagination for sandbox and snapshot listing
Breaking Changes
- Default sandbox timeout changed from 1 hour to 5 minutes
Sandbox.listreturns aSandboxPaginatorinstead of a raw arrayFilesystem#writereturnsWriteInfoinstead of boolean
Security Fix
- Fixed shell injection vulnerability in MCP gateway config serialization
See CHANGELOG.md for the full list of changes.
v0.2.0 - First Public Release
E2B Ruby SDK v0.2.0
First public release on RubyGems. Aligned with the official E2B Python/JS SDKs.
Install
gem 'e2b'Highlights
- Sandbox class methods —
Sandbox.create,.connect,.list,.killmatching official SDK pattern - Filesystem rewrite — proper envd RPC (
Stat,ListDir,MakeDir,Move,Remove) and REST multipart upload, replacing shell command hacks - CommandHandle — background process management with
wait,kill,send_stdin - PTY service — interactive terminal sessions (
create,connect,resize,send_stdin) - Git service — 19 methods including
clone,push,pull,status,branches,commit,add,reset,restore,configure_user - Directory watching —
WatchHandlewith polling-based event retrieval - New models —
EntryInfo,FilesystemEvent,CommandResult,GitStatus,GitBranches - Error hierarchy —
CommandExitError,GitAuthError,GitUpstreamError,InvalidArgumentError
See CHANGELOG.md for full details.