Skip to content

Releases: ya-luotao/e2b-ruby

v0.3.2 — Hardening pass

29 Apr 17:24

Choose a tag to compare

A focused hardening release covering correctness, safety, and protocol-layer test coverage. No breaking changes.

Fixed

  • parse_exit_code silently mapping non-zero statuses to 0EnvdHttpClient#parse_exit_code previously returned 0 for any unparseable status string containing the digit "0" (e.g. "code: 100", "status: 20"), causing failed commands to look successful and skip raising CommandExitError. Fallback now always returns 1.
  • Streaming RPC retries replaying side-effecting requestsEnvdHttpClient#handle_streaming_rpc no longer retries through with_retry once any event has been delivered to the caller. Previously, a mid-stream connection drop on process.Process/Start could spawn a second process and replay output to the user's on_stdout callback.
  • Sandbox#process_sandbox_data clobbering attributes — partial API responses that omit alias, clientID, cpuCount, memoryMB, metadata, startedAt, or endAt no longer overwrite previously-known values with nil.
  • parse_time crashing on non-string timestampsSandbox#parse_time and the helpers in Models::SandboxInfo, Models::TemplateLogEntry, and Models::EntryInfo now also rescue TypeError, surviving malformed numeric or hash values.
  • Filesystem#exists? swallowing all E2BError subclasses — only NotFoundError is treated as "does not exist"; auth/network errors propagate.
  • examples/claude_code_runner.rb — replaced calls to non-existent sandbox.filesystem accessor with sandbox.files, and entry[:name] hash access with the EntryInfo#name accessor. The shipped example is now actually runnable.

Changed

  • Sandbox#connect (instance method) is deprecated — emits a deprecation warning pointing to #resume. The class method Sandbox.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.list YARD return type corrected from Array<Hash> to SandboxPaginator.
  • Sandbox.kill and Sandbox#kill idempotency is now documented in YARD; behavior is unchanged (returns true whether the sandbox was running or already gone).

Internal

  • Replaced per-RPC OpenStruct allocation with a Struct (EnvdHttpClient::RpcResponse). Drops the ostruct gemspec dependency and reduces allocation cost on the hot path.
  • New spec/e2b/services/envd_http_client_spec.rb adds 13 unit tests covering parse_exit_code (regression), decode_base64, create_connect_envelope (UTF-8 multibyte + large bodies — protects the recent Encoding fix), and parse_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

20 Mar 07:42

Choose a tag to compare

Added

  • Commands#close_stdin(pid) — close stdin on a running process, mirroring the existing Pty#close_stdin. Needed for bidirectional stdin/stdout protocols (e.g., Claude Code's stream-json mode) where the caller must signal end-of-input.

See CHANGELOG for full history.

v0.3.0 — Full SDK Parity

13 Mar 13:07

Choose a tag to compare

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.list returns a SandboxPaginator instead of a raw array
  • Filesystem#write returns WriteInfo instead 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

12 Mar 14:58

Choose a tag to compare

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 methodsSandbox.create, .connect, .list, .kill matching 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 watchingWatchHandle with polling-based event retrieval
  • New modelsEntryInfo, FilesystemEvent, CommandResult, GitStatus, GitBranches
  • Error hierarchyCommandExitError, GitAuthError, GitUpstreamError, InvalidArgumentError

See CHANGELOG.md for full details.