dataleon 0.1.0.pre.alpha.3 → 0.1.0.pre.alpha.5
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 +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +1 -1
- data/lib/dataleon/file_part.rb +10 -7
- data/lib/dataleon/internal/transport/pooled_net_requester.rb +7 -10
- data/lib/dataleon/internal/type/file_input.rb +7 -4
- data/lib/dataleon/version.rb +1 -1
- data/rbi/dataleon/file_part.rbi +1 -1
- data/sig/dataleon/file_part.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de13ecbea519680c7d4d3f0fd8dc4a6e0943a065ddd949e9cdc13ff060c836bd
|
|
4
|
+
data.tar.gz: 3dfa3e73e66e431559deed38992d55c125f8390b8b6abfbd41a5c5f035cdabcf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f154a44a5e90088a1f0eafc9effb7296b587d5919ba2ded07b50064897fc9e74ef4e3061514c13d480224335590ad1b698dded4a6e1b0c3cf6afb39def268809
|
|
7
|
+
data.tar.gz: bc2d54b89e786c0525fbb6447f34992df71bfc5d0bd6d3ab7653f0734251a3d01c3badae87120827dda5b10a6aaf75c3fd50012a10a56651981e26a3b568519e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.5 (2025-10-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/dataleonlabs/dataleon-ruby/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* coroutine leaks from connection pool ([06da7fc](https://github.com/dataleonlabs/dataleon-ruby/commit/06da7fcb30b16624046a39e01933adf66305830e))
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.4 (2025-09-30)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/dataleonlabs/dataleon-ruby/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* always send `filename=...` for multipart requests where a file is expected ([31a5af0](https://github.com/dataleonlabs/dataleon-ruby/commit/31a5af0186e3d03adbfae5d66485923171db9029))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* allow fast-format to use bsd sed as well ([be7168e](https://github.com/dataleonlabs/dataleon-ruby/commit/be7168e38a0b8f4acb0833bda45cf98083824890))
|
|
23
|
+
|
|
3
24
|
## 0.1.0-alpha.3 (2025-09-27)
|
|
4
25
|
|
|
5
26
|
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/dataleonlabs/dataleon-ruby/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
|
data/README.md
CHANGED
|
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
17
|
<!-- x-release-please-start-version -->
|
|
18
18
|
|
|
19
19
|
```ruby
|
|
20
|
-
gem "dataleon", "~> 0.1.0.pre.alpha.
|
|
20
|
+
gem "dataleon", "~> 0.1.0.pre.alpha.5"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
<!-- x-release-please-end -->
|
data/lib/dataleon/file_part.rb
CHANGED
|
@@ -38,18 +38,21 @@ module Dataleon
|
|
|
38
38
|
def to_yaml(*a) = read.to_yaml(*a)
|
|
39
39
|
|
|
40
40
|
# @param content [Pathname, StringIO, IO, String]
|
|
41
|
-
# @param filename [String, nil]
|
|
41
|
+
# @param filename [Pathname, String, nil]
|
|
42
42
|
# @param content_type [String, nil]
|
|
43
43
|
def initialize(content, filename: nil, content_type: nil)
|
|
44
|
-
@
|
|
44
|
+
@content_type = content_type
|
|
45
45
|
@filename =
|
|
46
|
-
case content
|
|
47
|
-
in Pathname
|
|
48
|
-
|
|
46
|
+
case [filename, (@content = content)]
|
|
47
|
+
in [String | Pathname, _]
|
|
48
|
+
::File.basename(filename)
|
|
49
|
+
in [nil, Pathname]
|
|
50
|
+
content.basename.to_path
|
|
51
|
+
in [nil, IO]
|
|
52
|
+
content.to_path
|
|
49
53
|
else
|
|
50
|
-
filename
|
|
54
|
+
filename
|
|
51
55
|
end
|
|
52
|
-
@content_type = content_type
|
|
53
56
|
end
|
|
54
57
|
end
|
|
55
58
|
end
|
|
@@ -134,9 +134,9 @@ module Dataleon
|
|
|
134
134
|
|
|
135
135
|
# rubocop:disable Metrics/BlockLength
|
|
136
136
|
enum = Enumerator.new do |y|
|
|
137
|
-
|
|
138
|
-
next if finished
|
|
137
|
+
next if finished
|
|
139
138
|
|
|
139
|
+
with_pool(url, deadline: deadline) do |conn|
|
|
140
140
|
req, closing = self.class.build_request(request) do
|
|
141
141
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
142
142
|
end
|
|
@@ -149,7 +149,7 @@ module Dataleon
|
|
|
149
149
|
|
|
150
150
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
151
151
|
conn.request(req) do |rsp|
|
|
152
|
-
y << [
|
|
152
|
+
y << [req, rsp]
|
|
153
153
|
break if finished
|
|
154
154
|
|
|
155
155
|
rsp.read_body do |bytes|
|
|
@@ -160,6 +160,8 @@ module Dataleon
|
|
|
160
160
|
end
|
|
161
161
|
eof = true
|
|
162
162
|
end
|
|
163
|
+
ensure
|
|
164
|
+
conn.finish if !eof && conn&.started?
|
|
163
165
|
end
|
|
164
166
|
rescue Timeout::Error
|
|
165
167
|
raise Dataleon::Errors::APITimeoutError.new(url: url, request: req)
|
|
@@ -168,16 +170,11 @@ module Dataleon
|
|
|
168
170
|
end
|
|
169
171
|
# rubocop:enable Metrics/BlockLength
|
|
170
172
|
|
|
171
|
-
|
|
173
|
+
_, response = enum.next
|
|
172
174
|
body = Dataleon::Internal::Util.fused_enum(enum, external: true) do
|
|
173
175
|
finished = true
|
|
174
|
-
|
|
175
|
-
enum.next
|
|
176
|
-
rescue StopIteration
|
|
177
|
-
nil
|
|
178
|
-
end
|
|
176
|
+
loop { enum.next }
|
|
179
177
|
ensure
|
|
180
|
-
conn.finish if !eof && conn&.started?
|
|
181
178
|
closing&.call
|
|
182
179
|
end
|
|
183
180
|
[Integer(response.code), response, body]
|
|
@@ -82,17 +82,20 @@ module Dataleon
|
|
|
82
82
|
#
|
|
83
83
|
# @return [Pathname, StringIO, IO, String, Object]
|
|
84
84
|
def dump(value, state:)
|
|
85
|
-
# rubocop:disable Lint/DuplicateBranch
|
|
86
85
|
case value
|
|
86
|
+
in StringIO | String
|
|
87
|
+
# https://datatracker.ietf.org/doc/html/rfc7578#section-4.2
|
|
88
|
+
# while not required, a filename is recommended, and in practice many servers do expect this
|
|
89
|
+
Dataleon::FilePart.new(value, filename: "upload")
|
|
87
90
|
in IO
|
|
88
91
|
state[:can_retry] = false
|
|
92
|
+
value.to_path.nil? ? Dataleon::FilePart.new(value, filename: "upload") : value
|
|
89
93
|
in Dataleon::FilePart if value.content.is_a?(IO)
|
|
90
94
|
state[:can_retry] = false
|
|
95
|
+
value
|
|
91
96
|
else
|
|
97
|
+
value
|
|
92
98
|
end
|
|
93
|
-
# rubocop:enable Lint/DuplicateBranch
|
|
94
|
-
|
|
95
|
-
value
|
|
96
99
|
end
|
|
97
100
|
|
|
98
101
|
# @api private
|
data/lib/dataleon/version.rb
CHANGED
data/rbi/dataleon/file_part.rbi
CHANGED
data/sig/dataleon/file_part.rbs
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dataleon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.0.pre.alpha.
|
|
4
|
+
version: 0.1.0.pre.alpha.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dataleon
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-10-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|