Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ jobs:
test:
name: rake (Ruby ${{ matrix.ruby }})
runs-on: ubuntu-latest
# `head` tracks Ruby's main branch (currently 4.0 development) and is
# allowed to fail without blocking — it's an early-warning smoke test.
continue-on-error: ${{ matrix.ruby == 'head' }}
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3", "3.4", "3.5", "head"]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1
NewCops: enable
SuggestExtensions: false
Exclude:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to the E2B Ruby SDK will be documented in this file.

## [Unreleased]

### Changed

- **Minimum Ruby version raised to 3.1** (was 3.0). Ruby 3.0 reached end-of-life in March 2024 and is no longer covered by upstream security patches. The CI matrix now spans 3.1, 3.2, 3.3, 3.4, 3.5, plus Ruby `head` (4.0 development branch, allowed to fail) as an early-warning smoke test.

### Internal

- Adopted Ruby 3.1 anonymous block forwarding (`&` instead of `&block`) in `Services::CommandHandle` after the `TargetRubyVersion` bump unlocked the relevant cops.

## [0.3.5] - 2026-05-10

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion e2b.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
DESC
spec.homepage = "https://github.com/ya-luotao/e2b-ruby"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.0.0"
spec.required_ruby_version = ">= 3.1.0"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/ya-luotao/e2b-ruby"
Expand Down
14 changes: 7 additions & 7 deletions lib/e2b/services/command_handle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ def disconnect
# @yieldparam stderr [String, nil] Stderr data, or nil
# @yieldparam pty [String, nil] PTY data, or nil
# @return [void]
def each(&block)
def each(&)
return enum_for(:each) unless block_given?

if @result
# Iterate over pre-materialized events
iterate_materialized_events(&block)
iterate_materialized_events(&)
elsif @events_proc
# Iterate over streaming events
iterate_streaming_events(&block)
iterate_streaming_events(&)
end
end

Expand Down Expand Up @@ -298,15 +298,15 @@ def build_result
#
# @yield [stdout, stderr, pty]
# @return [void]
def iterate_materialized_events(&block)
def iterate_materialized_events(&)
events = result_value(:events) || []
while @materialized_event_index < events.length
break if @disconnected

event_hash = events[@materialized_event_index]
@materialized_event_index += 1

process_message(event_hash, &block)
process_message(event_hash, &)
end
end

Expand Down Expand Up @@ -341,11 +341,11 @@ def iterate_streaming_events(&block)
# @param message [Hash] A raw stream message
# @yield [stdout, stderr, pty]
# @return [void]
def process_message(message, &block)
def process_message(message, &)
return unless message.is_a?(Hash)

event = message["event"]
process_event(event, &block) if event.is_a?(Hash)
process_event(event, &) if event.is_a?(Hash)

if event.nil?
stdout_chunk = EnvdBase64.decode_process_output(message["stdout"])
Expand Down
Loading