onebusaway-sdk 1.1.1 → 1.1.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 +4 -4
- data/CHANGELOG.md +24 -0
- data/README.md +1 -1
- data/lib/onebusaway_sdk/file_part.rb +10 -7
- data/lib/onebusaway_sdk/internal/transport/pooled_net_requester.rb +7 -10
- data/lib/onebusaway_sdk/internal/type/file_input.rb +7 -4
- data/lib/onebusaway_sdk/internal/util.rb +4 -4
- data/lib/onebusaway_sdk/version.rb +1 -1
- data/rbi/onebusaway_sdk/file_part.rbi +1 -1
- data/sig/onebusaway_sdk/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: 30b38f66df90b2ae90875570c2c44acc0cc60014ecd26cd1b65f30144d467229
|
|
4
|
+
data.tar.gz: 449d160c4f8bb3e8c0ee14c7654c79c49689e30c7e120f2e3c0efddb166cb967
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ab9bc128008fd8089c86c98fabde8d08e54de7a24980d0a684b86775499e70b68448595cb82767f125b342b5e8a62e8d5b311908199c2d8aa277d4a864fafc6
|
|
7
|
+
data.tar.gz: '084cbd7d39a98d293342444ca5516b9186914b4380372795a11a34fb15987b09b2a347c35c05c8a4c3decdc4a9b0d0104b3ba2a36563b487c572beb393f39611'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.2 (2025-10-15)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.1.1...v1.1.2](https://github.com/OneBusAway/ruby-sdk/compare/v1.1.1...v1.1.2)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* always send `filename=...` for multipart requests where a file is expected ([ae0a463](https://github.com/OneBusAway/ruby-sdk/commit/ae0a4631df4a0ba4ebb386e4bcd228977b8554c3))
|
|
10
|
+
* coroutine leaks from connection pool ([5c3a6f1](https://github.com/OneBusAway/ruby-sdk/commit/5c3a6f121a63c3046f39ce62fba651a5e4e57ba8))
|
|
11
|
+
* shorten multipart boundary sep to less than RFC specificed max length ([eee0939](https://github.com/OneBusAway/ruby-sdk/commit/eee0939d23255dbd6b3de367bbba02ea0a346425))
|
|
12
|
+
* should not reuse buffers for `IO.copy_stream` interop ([29dd5d7](https://github.com/OneBusAway/ruby-sdk/commit/29dd5d7e0bcfbaf3027fca84a6338c37131843e6))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Performance Improvements
|
|
16
|
+
|
|
17
|
+
* faster code formatting ([95c9921](https://github.com/OneBusAway/ruby-sdk/commit/95c99210f84f729076f9c6494a98729946bcb7d9))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
|
|
22
|
+
* allow fast-format to use bsd sed as well ([ac285dc](https://github.com/OneBusAway/ruby-sdk/commit/ac285dcaff516a5d8755da3534f83dfa588bcb6d))
|
|
23
|
+
* ignore linter error for tests having large collections ([88b7a09](https://github.com/OneBusAway/ruby-sdk/commit/88b7a092d8bab6f77ee3fdc351e0b7d0fe41713a))
|
|
24
|
+
* improve example values ([c2ea3c6](https://github.com/OneBusAway/ruby-sdk/commit/c2ea3c65ba37c82b323cffafad37b17b10d04c3b))
|
|
25
|
+
* **internal:** codegen related update ([2a3af55](https://github.com/OneBusAway/ruby-sdk/commit/2a3af55696978980ca69da2e42caecf15c72ba2d))
|
|
26
|
+
|
|
3
27
|
## 1.1.1 (2025-09-20)
|
|
4
28
|
|
|
5
29
|
Full Changelog: [v1.1.0...v1.1.1](https://github.com/OneBusAway/ruby-sdk/compare/v1.1.0...v1.1.1)
|
data/README.md
CHANGED
|
@@ -38,18 +38,21 @@ module OnebusawaySDK
|
|
|
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 OnebusawaySDK
|
|
|
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 OnebusawaySDK
|
|
|
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 OnebusawaySDK
|
|
|
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 OnebusawaySDK::Errors::APITimeoutError.new(url: url, request: req)
|
|
@@ -168,16 +170,11 @@ module OnebusawaySDK
|
|
|
168
170
|
end
|
|
169
171
|
# rubocop:enable Metrics/BlockLength
|
|
170
172
|
|
|
171
|
-
|
|
173
|
+
_, response = enum.next
|
|
172
174
|
body = OnebusawaySDK::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 OnebusawaySDK
|
|
|
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
|
+
OnebusawaySDK::FilePart.new(value, filename: "upload")
|
|
87
90
|
in IO
|
|
88
91
|
state[:can_retry] = false
|
|
92
|
+
value.to_path.nil? ? OnebusawaySDK::FilePart.new(value, filename: "upload") : value
|
|
89
93
|
in OnebusawaySDK::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
|
|
@@ -473,10 +473,9 @@ module OnebusawaySDK
|
|
|
473
473
|
# @return [Enumerable<String>]
|
|
474
474
|
def writable_enum(&blk)
|
|
475
475
|
Enumerator.new do |y|
|
|
476
|
-
buf = String.new
|
|
477
476
|
y.define_singleton_method(:write) do
|
|
478
|
-
self <<
|
|
479
|
-
|
|
477
|
+
self << _1.dup
|
|
478
|
+
_1.bytesize
|
|
480
479
|
end
|
|
481
480
|
|
|
482
481
|
blk.call(y)
|
|
@@ -566,7 +565,8 @@ module OnebusawaySDK
|
|
|
566
565
|
#
|
|
567
566
|
# @return [Array(String, Enumerable<String>)]
|
|
568
567
|
private def encode_multipart_streaming(body)
|
|
569
|
-
|
|
568
|
+
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
|
569
|
+
boundary = SecureRandom.urlsafe_base64(46)
|
|
570
570
|
|
|
571
571
|
closing = []
|
|
572
572
|
strio = writable_enum do |y|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: onebusaway-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Onebusaway SDK
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|