onebusaway-sdk 1.0.3 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 774a62ce95d40bc273371794f6ad2bd15ee81408c68cfe8982090b197c57fe1a
4
- data.tar.gz: c1f16accdf042a20ad534cf27a5a99ca49a1ee1d014f21f655d704cbee586cac
3
+ metadata.gz: 6cf135b50178c6dcdd74833c60496889b65e49c2c85242cc2f8803f4f735a513
4
+ data.tar.gz: 8e7d6c0fbaa6b86a27ab66933621c070d8f6dc58838ec21652010ab0821c2636
5
5
  SHA512:
6
- metadata.gz: 6c3a21bb95898bc7e909497f4768be5e7bc641982e19427656433d3e08df0aa7250cd3491eba7d12b8812ac8ecc3b5972e6a278a7309b8dbfce58ca6b9c1d4e3
7
- data.tar.gz: 40c5c2ee398039cb03e138d9c73dc7fe08a487e0273e915047805a5cd666eca1b5eee97c3bef8a1d32e03839d88143067963d1dfd0008676d0248f1b5d37de28
6
+ metadata.gz: c86aede15f8c1ca8ec3eb1b411967503aeb4e5f52ffa2ed641a1bc0bd8437f562ecec5a569eddc9ce51ca90ce67c83c64619bbc8ce67003cccb7b6e14f04249a
7
+ data.tar.gz: 543291bb6114e21771bd03d91bdbb4c44a2f68e4a822bedf31bcb5716309921dd442e09577746485ef4289040f0bf21d14dee8857648972433ea1358fe1d7358
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.5 (2025-06-05)
4
+
5
+ Full Changelog: [v1.0.4...v1.0.5](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.4...v1.0.5)
6
+
7
+ ### Chores
8
+
9
+ * **internal:** version bump ([a685981](https://github.com/OneBusAway/ruby-sdk/commit/a685981b14d96d2e9f9d7cdb261746f32c4a193b))
10
+
11
+ ## 1.0.4 (2025-06-05)
12
+
13
+ Full Changelog: [v1.0.3...v1.0.4](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.3...v1.0.4)
14
+
15
+ ### Bug Fixes
16
+
17
+ * `to_sorbet_type` should not return branded types ([62260a5](https://github.com/OneBusAway/ruby-sdk/commit/62260a5beb28f955e636a8d8ae5054e81f0ddd1c))
18
+ * default content-type for text in multi-part formdata uploads should be text/plain ([642d274](https://github.com/OneBusAway/ruby-sdk/commit/642d274c1f710e6ec592ee5aab241f322c8d1d4a))
19
+
20
+
21
+ ### Chores
22
+
23
+ * **internal:** version bump ([993b8ac](https://github.com/OneBusAway/ruby-sdk/commit/993b8ac7c60193de4157b5773da48ad76249564f))
24
+
3
25
  ## 1.0.3 (2025-05-28)
4
26
 
5
27
  Full Changelog: [v1.0.2...v1.0.3](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.2...v1.0.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 "onebusaway-sdk", "~> 1.0.3"
20
+ gem "onebusaway-sdk", "~> 1.0.5"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -91,11 +91,14 @@ module OnebusawaySDK
91
91
  #
92
92
  # @return [Object]
93
93
  def to_sorbet_type
94
- case values
94
+ types = values.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
95
+ case types
95
96
  in []
96
97
  T.noreturn
97
- in [value, *_]
98
- T.all(OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(value), self)
98
+ in [type]
99
+ type
100
+ else
101
+ T.any(*types)
99
102
  end
100
103
  end
101
104
 
@@ -201,11 +201,14 @@ module OnebusawaySDK
201
201
  #
202
202
  # @return [Object]
203
203
  def to_sorbet_type
204
- case (v = variants)
204
+ types = variants.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
205
+ case types
205
206
  in []
206
207
  T.noreturn
208
+ in [type]
209
+ type
207
210
  else
208
- T.any(*v.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) })
211
+ T.any(*types)
209
212
  end
210
213
  end
211
214
 
@@ -497,7 +497,7 @@ module OnebusawaySDK
497
497
  # @param closing [Array<Proc>]
498
498
  # @param content_type [String, nil]
499
499
  private def write_multipart_content(y, val:, closing:, content_type: nil)
500
- content_type ||= "application/octet-stream"
500
+ content_line = "Content-Type: %s\r\n\r\n"
501
501
 
502
502
  case val
503
503
  in OnebusawaySDK::FilePart
@@ -508,24 +508,21 @@ module OnebusawaySDK
508
508
  content_type: val.content_type
509
509
  )
510
510
  in Pathname
511
- y << "Content-Type: #{content_type}\r\n\r\n"
511
+ y << format(content_line, content_type || "application/octet-stream")
512
512
  io = val.open(binmode: true)
513
513
  closing << io.method(:close)
514
514
  IO.copy_stream(io, y)
515
515
  in IO
516
- y << "Content-Type: #{content_type}\r\n\r\n"
516
+ y << format(content_line, content_type || "application/octet-stream")
517
517
  IO.copy_stream(val, y)
518
518
  in StringIO
519
- y << "Content-Type: #{content_type}\r\n\r\n"
519
+ y << format(content_line, content_type || "application/octet-stream")
520
520
  y << val.string
521
- in String
522
- y << "Content-Type: #{content_type}\r\n\r\n"
523
- y << val.to_s
524
521
  in -> { primitive?(_1) }
525
- y << "Content-Type: text/plain\r\n\r\n"
522
+ y << format(content_line, content_type || "text/plain")
526
523
  y << val.to_s
527
524
  else
528
- y << "Content-Type: application/json\r\n\r\n"
525
+ y << format(content_line, content_type || "application/json")
529
526
  y << JSON.generate(val)
530
527
  end
531
528
  y << "\r\n"
@@ -563,6 +560,8 @@ module OnebusawaySDK
563
560
 
564
561
  # @api private
565
562
  #
563
+ # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
564
+ #
566
565
  # @param body [Object]
567
566
  #
568
567
  # @return [Array(String, Enumerable<String>)]
@@ -14,16 +14,16 @@ module OnebusawaySDK
14
14
  mod.constants.each do |name|
15
15
  case mod.const_get(name)
16
16
  in true | false
17
- mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } }
17
+ mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } }
18
18
  mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
19
19
  in Integer
20
- mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } }
20
+ mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } }
21
21
  mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
22
22
  in Float
23
- mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } }
23
+ mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } }
24
24
  mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
25
25
  in Symbol
26
- mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } }
26
+ mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } }
27
27
  mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
28
28
  else
29
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnebusawaySDK
4
- VERSION = "1.0.3"
4
+ VERSION = "1.0.5"
5
5
  end
@@ -332,6 +332,8 @@ module OnebusawaySDK
332
332
  end
333
333
 
334
334
  # @api private
335
+ #
336
+ # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
335
337
  sig do
336
338
  params(body: T.anything).returns([String, T::Enumerable[String]])
337
339
  end
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.0.3
4
+ version: 1.0.5
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-06-01 00:00:00.000000000 Z
11
+ date: 2025-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool