onebusaway-sdk 1.6.0 → 1.6.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: 3b4feb8d9fe415a19d53880d1c020bb7d807ea18a179b262c0a9e17e2e83f0b3
4
- data.tar.gz: 4ceb200bf82045e53670a3f18c9e1f57b9cf63d5209c13b7ef53a70b44677763
3
+ metadata.gz: e33b7e7c4d1ac2fb76e417f1c1bf669e2291007539eb7ca7e207417bbd5f48db
4
+ data.tar.gz: 4e8dc1f9ae54f02654e81bb9b413cf05fee03a0729e07364d1f0d75aee2ab88b
5
5
  SHA512:
6
- metadata.gz: cb6f9c4946eb2566c56bf5a4c3bda80ee77ec324e3a989aadf41d63a35659c6d7c6cbda22cc437b957738202e2d13e2ced38015d11f489bfb7564825556d23ab
7
- data.tar.gz: '0698ef82f3526cf21bbcefe9ffaa29df5f8276b02a1f039fee664302377583ec67adef93caf4a6bcae3225a318605df54ccee2090a76c803308294cefceab844'
6
+ metadata.gz: 1aec653dfc700dd0a3bb9e9a2ecc637b9b374a62c0cfe4dcfab726815b9ddd4b27ef7e2651ea814c12ab01234332f04868bb36f1f5b0c76ddc073a9d5d8f30cf
7
+ data.tar.gz: 2052a834b4a5f24a06e8dfe6de2c9cfc863301f20f36fcf2d281051bbde1cc2187b2d9c1c5d73ca0e9239bb82019655424c972b8d2767cbb598e7a364e11a973
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.6.1 (2026-04-01)
4
+
5
+ Full Changelog: [v1.6.0...v1.6.1](https://github.com/OneBusAway/ruby-sdk/compare/v1.6.0...v1.6.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * align path encoding with RFC 3986 section 3.3 ([73f0f2d](https://github.com/OneBusAway/ruby-sdk/commit/73f0f2dde7c4d13aab4cf681aa68ecc022dca33b))
10
+ * variable name typo ([0bb2581](https://github.com/OneBusAway/ruby-sdk/commit/0bb2581f24d20b6ffff39e630aea058bebb6e668))
11
+
12
+
13
+ ### Chores
14
+
15
+ * **tests:** bump steady to v0.20.1 ([c40fb01](https://github.com/OneBusAway/ruby-sdk/commit/c40fb01c82c735d6ed0a97ea9e9521a83e820199))
16
+ * **tests:** bump steady to v0.20.2 ([5e538f6](https://github.com/OneBusAway/ruby-sdk/commit/5e538f6d606d5d01f11e3c1cdec4402b81b02034))
17
+
3
18
  ## 1.6.0 (2026-03-29)
4
19
 
5
20
  Full Changelog: [v1.5.6...v1.6.0](https://github.com/OneBusAway/ruby-sdk/compare/v1.5.6...v1.6.0)
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.6.0"
20
+ gem "onebusaway-sdk", "~> 1.6.1"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -157,7 +157,7 @@ module OnebusawaySDK
157
157
  in Hash | nil => coerced
158
158
  coerced
159
159
  else
160
- message = "Expected a #{Hash} or #{OnebusawaySDK::Internal::Type::BaseModel}, got #{data.inspect}"
160
+ message = "Expected a #{Hash} or #{OnebusawaySDK::Internal::Type::BaseModel}, got #{input.inspect}"
161
161
  raise ArgumentError.new(message)
162
162
  end
163
163
  end
@@ -237,6 +237,11 @@ module OnebusawaySDK
237
237
  end
238
238
  end
239
239
 
240
+ # @type [Regexp]
241
+ #
242
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
243
+ RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
244
+
240
245
  class << self
241
246
  # @api private
242
247
  #
@@ -247,6 +252,15 @@ module OnebusawaySDK
247
252
  "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248
253
  end
249
254
 
255
+ # @api private
256
+ #
257
+ # @param path [String, Integer]
258
+ #
259
+ # @return [String]
260
+ def encode_path(path)
261
+ path.to_s.gsub(OnebusawaySDK::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
262
+ end
263
+
250
264
  # @api private
251
265
  #
252
266
  # @param path [String, Array<String>]
@@ -259,7 +273,7 @@ module OnebusawaySDK
259
273
  in []
260
274
  ""
261
275
  in [String => p, *interpolations]
262
- encoded = interpolations.map { ERB::Util.url_encode(_1) }
276
+ encoded = interpolations.map { encode_path(_1) }
263
277
  format(p, *encoded)
264
278
  end
265
279
  end
@@ -576,10 +590,10 @@ module OnebusawaySDK
576
590
 
577
591
  case val
578
592
  in OnebusawaySDK::FilePart unless val.filename.nil?
579
- filename = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
580
594
  y << "; filename=\"#{filename}\""
581
595
  in Pathname | IO
582
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
583
597
  y << "; filename=\"#{filename}\""
584
598
  else
585
599
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OnebusawaySDK
4
- VERSION = "1.6.0"
4
+ VERSION = "1.6.1"
5
5
  end
@@ -148,12 +148,20 @@ module OnebusawaySDK
148
148
  end
149
149
  end
150
150
 
151
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
152
+ RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp)
153
+
151
154
  class << self
152
155
  # @api private
153
156
  sig { params(uri: URI::Generic).returns(String) }
154
157
  def uri_origin(uri)
155
158
  end
156
159
 
160
+ # @api private
161
+ sig { params(path: T.any(String, Integer)).returns(String) }
162
+ def encode_path(path)
163
+ end
164
+
157
165
  # @api private
158
166
  sig { params(path: T.any(String, T::Array[String])).returns(String) }
159
167
  def interpolate_path(path)
@@ -45,8 +45,12 @@ module OnebusawaySDK
45
45
  -> top?
46
46
  } -> top?
47
47
 
48
+ RFC_3986_NOT_PCHARS: Regexp
49
+
48
50
  def self?.uri_origin: (URI::Generic uri) -> String
49
51
 
52
+ def self?.encode_path: (String | Integer path) -> String
53
+
50
54
  def self?.interpolate_path: (String | ::Array[String] path) -> String
51
55
 
52
56
  def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]
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.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onebusaway SDK
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-29 00:00:00.000000000 Z
11
+ date: 2026-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi