Skip to content

Commit 495ad44

Browse files
authored
Merge pull request #4 from Vitable-Inc/release-please--branches--main--changes--next
release: 0.2.2
2 parents 23e5235 + e412446 commit 495ad44

8 files changed

Lines changed: 43 additions & 8 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.1"
2+
".": "0.2.2"
33
}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.2.2 (2026-04-01)
4+
5+
Full Changelog: [v0.2.1...v0.2.2](https://github.com/Vitable-Inc/vitable-connect-ruby/compare/v0.2.1...v0.2.2)
6+
7+
### Bug Fixes
8+
9+
* align path encoding with RFC 3986 section 3.3 ([8dffaa7](https://github.com/Vitable-Inc/vitable-connect-ruby/commit/8dffaa70c9a25f8c03eab999b3bcfb3eb0b151b8))
10+
* variable name typo ([0c72698](https://github.com/Vitable-Inc/vitable-connect-ruby/commit/0c7269861dfb77cc7b901b63229b420122751cbb))
11+
312
## 0.2.1 (2026-03-28)
413

514
Full Changelog: [v0.2.0...v0.2.1](https://github.com/Vitable-Inc/vitable-connect-ruby/compare/v0.2.0...v0.2.1)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
vitable-connect (0.2.1)
14+
vitable-connect (0.2.2)
1515
cgi
1616
connection_pool
1717

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
1717
<!-- x-release-please-start-version -->
1818

1919
```ruby
20-
gem "vitable-connect", "~> 0.2.1"
20+
gem "vitable-connect", "~> 0.2.2"
2121
```
2222

2323
<!-- x-release-please-end -->

lib/vitable_connect/internal/util.rb

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def coerce_hash!(input)
157157
in Hash | nil => coerced
158158
coerced
159159
else
160-
message = "Expected a #{Hash} or #{VitableConnect::Internal::Type::BaseModel}, got #{data.inspect}"
160+
message = "Expected a #{Hash} or #{VitableConnect::Internal::Type::BaseModel}, got #{input.inspect}"
161161
raise ArgumentError.new(message)
162162
end
163163
end
@@ -237,6 +237,11 @@ def dig(data, pick, &blk)
237237
end
238238
end
239239

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+
240245
class << self
241246
# @api private
242247
#
@@ -247,6 +252,15 @@ def uri_origin(uri)
247252
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248253
end
249254

255+
# @api private
256+
#
257+
# @param path [String, Integer]
258+
#
259+
# @return [String]
260+
def encode_path(path)
261+
path.to_s.gsub(VitableConnect::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
262+
end
263+
250264
# @api private
251265
#
252266
# @param path [String, Array<String>]
@@ -259,7 +273,7 @@ def interpolate_path(path)
259273
in []
260274
""
261275
in [String => p, *interpolations]
262-
encoded = interpolations.map { ERB::Util.url_encode(_1) }
276+
encoded = interpolations.map { encode_path(_1) }
263277
format(p, *encoded)
264278
end
265279
end
@@ -576,10 +590,10 @@ def encode_query_params(query)
576590

577591
case val
578592
in VitableConnect::FilePart unless val.filename.nil?
579-
filename = ERB::Util.url_encode(val.filename)
593+
filename = encode_path(val.filename)
580594
y << "; filename=\"#{filename}\""
581595
in Pathname | IO
582-
filename = ERB::Util.url_encode(::File.basename(val.to_path))
596+
filename = encode_path(::File.basename(val.to_path))
583597
y << "; filename=\"#{filename}\""
584598
else
585599
end

lib/vitable_connect/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module VitableConnect
4-
VERSION = "0.2.1"
4+
VERSION = "0.2.2"
55
end

rbi/vitable_connect/internal/util.rbi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,20 @@ module VitableConnect
148148
end
149149
end
150150

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+
151154
class << self
152155
# @api private
153156
sig { params(uri: URI::Generic).returns(String) }
154157
def uri_origin(uri)
155158
end
156159

160+
# @api private
161+
sig { params(path: T.any(String, Integer)).returns(String) }
162+
def encode_path(path)
163+
end
164+
157165
# @api private
158166
sig { params(path: T.any(String, T::Array[String])).returns(String) }
159167
def interpolate_path(path)

sig/vitable_connect/internal/util.rbs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ module VitableConnect
4545
-> top?
4646
} -> top?
4747

48+
RFC_3986_NOT_PCHARS: Regexp
49+
4850
def self?.uri_origin: (URI::Generic uri) -> String
4951

52+
def self?.encode_path: (String | Integer path) -> String
53+
5054
def self?.interpolate_path: (String | ::Array[String] path) -> String
5155

5256
def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]

0 commit comments

Comments
 (0)