eleven_rb 1.2.0 → 1.2.1

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: 34de9ec2892de8dec87b1bfe6337516288f37db698f1ad4f5919a0c3ff8d5bb9
4
- data.tar.gz: 829ad63126553c0828253b41e58f25b1141751a617ed57ee6fcb2e48c47e662f
3
+ metadata.gz: d5e02bd62aade6d992ab4c2850ae91e2c98ef12c82a4593be610cc735f10ad05
4
+ data.tar.gz: 32622a5ff39aaddcc279a902a0709ddb918a16bd9fa282e159241066771a8919
5
5
  SHA512:
6
- metadata.gz: 980e55ff51d0c558deffa4c543f3da5db31a9e46cd339af314d481807d105cf5469bc3510e5fde9b3d63ff27a7b049078adfde6984830ebf53484115e8956bf2
7
- data.tar.gz: 0a4638a7215d5cda2a539be65e863db94a8713e0d761c40067e1304305388158e781c63c633a24ab4f072011b558bfe5cd101a4c646927f003ccd8c57fde978d
6
+ metadata.gz: eb77cea08287a11b8cfd690edda005f1615bf6df66508946601a7d810be84259c1ee91c1fd3e390b0d75b48aebc3e3e489ee3715563322c292d9eb49f9989585
7
+ data.tar.gz: 0e9ef2d1c404c64ec2113e72091de65ea312afd3596adf93beae955d50e7bccdc3c4a17a0df5d8ae6d56a3c8f64b4c71a7c0723615bc0af6e862dce78b3ac80c
data/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.1] - 2026-12-04
11
+
12
+ - Scoped multipart upload file handles to the request. Files opened from paths close on success and failure. Caller-provided streams stay open.
13
+ - Updated the client spec to verify that an HTTP request invokes the configured callback.
14
+
10
15
  ## [1.2.0] - 2026-12-02
11
16
 
12
17
  - Fixed streaming chunk delivery, error propagation and response callbacks. Speech and dialogue support `stream_with_timestamps`.
@@ -104,20 +104,16 @@ module ElevenRb
104
104
  http_client.post_multipart(path, params, response_type: response_type)
105
105
  end
106
106
 
107
- def with_uploads(inputs)
108
- opened = []
109
- files = inputs.map do |input|
110
- next input if input.respond_to?(:read)
107
+ # Nest the file blocks so each path stays open until the multipart request returns.
108
+ def with_uploads(inputs, files = [], &block)
109
+ return yield(files) if files.size == inputs.size
111
110
 
112
- raise Errors::ValidationError, "File not found: #{input}" unless File.file?(input)
111
+ input = inputs.fetch(files.size)
112
+ return with_uploads(inputs, files + [input], &block) if input.respond_to?(:read)
113
113
 
114
- file = File.open(input, 'rb')
115
- opened << file
116
- file
117
- end
118
- yield files
119
- ensure
120
- opened.each(&:close)
114
+ raise Errors::ValidationError, "File not found: #{input}" unless File.file?(input)
115
+
116
+ File.open(input, 'rb') { |file| with_uploads(inputs, files + [file], &block) }
121
117
  end
122
118
 
123
119
  def notify_media_usage(audio, text, model_id, seconds, headers)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ElevenRb
4
- VERSION = '1.2.0'
4
+ VERSION = '1.2.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eleven_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Web Ventures Ltd