e2b 0.4.0 → 0.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de314846f6be2ed8ccdf8580b37039dddd366c55eaa2e1034a998008386d1ca5
4
- data.tar.gz: 723097c4475eaae0782b5a18b6728fe0ca97abf12db42a452de5479f9da315a6
3
+ metadata.gz: 5cfad8c8f1dff3e30b1f164b5f4b06ac55e4b94cc45efb5fcda8380cd037be65
4
+ data.tar.gz: e93cfb6d0b1ecbd593686044956f1fb9d1b538967eba2fe20b19707c7563829f
5
5
  SHA512:
6
- metadata.gz: 2bd3e91e6045b60a328f01a8c4ff3463eb9fec6595c75d02f5b20f062aae9d41a83e3427195f43618420efcb588eb012b2ae4d86c22241572a3fae6d110cfeaf
7
- data.tar.gz: 03201a52726872f3db485fa601d14a31b43f5ac85599a06c8403ddfd653e7d63a7ba080aef4cd0df3ca2efecfca6b46ffedd433105764e8023ab49d99bbe4293
6
+ metadata.gz: c67047093c58e5aafccd862fed6c1d7b1b13fd8edd20398d07d79b8adb8864e4255bc10d84c904d757a32321e2a9d2e6702a21f0a02cc05da6239534797be208
7
+ data.tar.gz: 24c9e871949c1bb05e1a2f8344efc090ca7d73186deee172c2ea886b12efdf8187004e893c0bfbbde73b444910a578386bfece94027845f2c8b9989e1d036865
@@ -42,7 +42,9 @@ module E2B
42
42
  # @param data [Hash] Connect RPC response data
43
43
  # @return [ProcessResult]
44
44
  def self.from_connect_response(data)
45
- return from_hash(data) unless data.is_a?(Hash)
45
+ # Defensive: any non-Hash input (nil, String, Array) cannot be a Connect
46
+ # response, so return an empty result rather than crashing in from_hash.
47
+ return new unless data.is_a?(Hash)
46
48
 
47
49
  stdout = data[:stdout] || data["stdout"] || ""
48
50
  stderr = data[:stderr] || data["stderr"] || ""
data/lib/e2b/template.rb CHANGED
@@ -273,7 +273,15 @@ module E2B
273
273
  def upload_file(template, file_name:, url:, resolve_symlinks:, source_location: nil)
274
274
  tarball = build_tar_archive(template, file_name, resolve_symlinks: resolve_symlinks)
275
275
  response = Faraday.put(url) do |req|
276
- req.headers["Content-Type"] = "application/octet-stream"
276
+ # E2B returns a GCS V2 signed URL whose StringToSign carries
277
+ # an *empty* Content-Type. The signed value must match the
278
+ # value we send, so we set it explicitly to "" — neither
279
+ # "application/octet-stream" (signature mismatch on the
280
+ # signed Content-Type line) nor omitting the header (Faraday
281
+ # then defaults to "application/x-www-form-urlencoded",
282
+ # same mismatch). GCS returns 403 SignatureDoesNotMatch in
283
+ # both other cases.
284
+ req.headers["Content-Type"] = ""
277
285
  req.body = tarball
278
286
  end
279
287
 
data/lib/e2b/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module E2B
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e2b
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tao Luo
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-05-10 00:00:00.000000000 Z
10
+ date: 2026-06-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64
@@ -113,6 +113,20 @@ dependencies:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
115
  version: '3.0'
116
+ - !ruby/object:Gem::Dependency
117
+ name: simplecov
118
+ requirement: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '0.22'
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '0.22'
116
130
  - !ruby/object:Gem::Dependency
117
131
  name: webmock
118
132
  requirement: !ruby/object:Gem::Requirement