Skip to content

Commit c123571

Browse files
authored
Merge pull request #15 from Hexlet/release-please--branches--main--changes--next
release: 0.5.4
2 parents a9f3386 + 1259e51 commit c123571

10 files changed

Lines changed: 67 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: CI
22
on:
33
push:
4-
branches-ignore:
5-
- 'generated'
6-
- 'codegen/**'
7-
- 'integrated/**'
8-
- 'stl-preview-head/**'
9-
- 'stl-preview-base/**'
4+
branches:
5+
- '**'
6+
- '!integrated/**'
7+
- '!stl-preview-head/**'
8+
- '!stl-preview-base/**'
9+
- '!generated'
10+
- '!codegen/**'
11+
- 'codegen/stl/**'
1012
pull_request:
1113
branches-ignore:
1214
- 'stl-preview-head/**'
@@ -22,7 +24,7 @@ jobs:
2224
runs-on: ${{ github.repository == 'stainless-sdks/amocrm-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
2325
if: |-
2426
github.repository == 'stainless-sdks/amocrm-ruby' &&
25-
(github.event_name == 'push' || github.event.pull_request.head.repo.fork)
27+
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
2628
steps:
2729
- uses: actions/checkout@v6
2830
- name: Set up Ruby

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.idea/
33
.ignore
44
.prism.log
5+
.stdy.log
56
.ruby-lsp/
67
.yardoc/
78
bin/tapioca

.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.5.3"
2+
".": "0.5.4"
33
}

CHANGELOG.md

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

3+
## 0.5.4 (2026-04-09)
4+
5+
Full Changelog: [v0.5.3...v0.5.4](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.3...v0.5.4)
6+
7+
### Bug Fixes
8+
9+
* align path encoding with RFC 3986 section 3.3 ([e553b8e](https://github.com/Hexlet/amocrm-ruby/commit/e553b8e0b21dfb819d67c93a63a71009b0f728a8))
10+
* **internal:** correct multipart form field name encoding ([4975893](https://github.com/Hexlet/amocrm-ruby/commit/4975893b8eb2d4f427e7d40c07a3b7c1413168fb))
11+
* multipart encoding for file arrays ([6e86c5d](https://github.com/Hexlet/amocrm-ruby/commit/6e86c5d69289bc86c02b5a8f0d441fa5c7bb2ffc))
12+
* variable name typo ([e8f5466](https://github.com/Hexlet/amocrm-ruby/commit/e8f546639d827bb38a89df2e42465f9c6d019ea4))
13+
14+
15+
### Chores
16+
17+
* **ci:** skip lint on metadata-only changes ([dad96e5](https://github.com/Hexlet/amocrm-ruby/commit/dad96e5408642a9781334f2bb4dbc32cd73872d9))
18+
* **ci:** support opting out of skipping builds on metadata-only commits ([34c8c04](https://github.com/Hexlet/amocrm-ruby/commit/34c8c04b937d0249fe49073193997e9311228d8f))
19+
* **internal:** tweak CI branches ([9a3e737](https://github.com/Hexlet/amocrm-ruby/commit/9a3e7375b6cca91433c8732e6fa060ecea85519c))
20+
* **internal:** update gitignore ([9fb96c7](https://github.com/Hexlet/amocrm-ruby/commit/9fb96c78308d30c29ead727cc05a101cdd1b97d1))
21+
322
## 0.5.3 (2026-03-08)
423

524
Full Changelog: [v0.5.2...v0.5.3](https://github.com/Hexlet/amocrm-ruby/compare/v0.5.2...v0.5.3)

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-
amocrm (0.5.3)
14+
amocrm (0.5.4)
1515
cgi
1616
connection_pool
1717

README.md

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

1717
```ruby
18-
gem "amocrm", "~> 0.5.3"
18+
gem "amocrm", "~> 0.5.4"
1919
```
2020

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

lib/amocrm/internal/util.rb

Lines changed: 22 additions & 7 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 #{Amocrm::Internal::Type::BaseModel}, got #{data.inspect}"
160+
message = "Expected a #{Hash} or #{Amocrm::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(Amocrm::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
@@ -573,16 +587,15 @@ def encode_query_params(query)
573587
y << "Content-Disposition: form-data"
574588

575589
unless key.nil?
576-
name = ERB::Util.url_encode(key.to_s)
577-
y << "; name=\"#{name}\""
590+
y << "; name=\"#{key}\""
578591
end
579592

580593
case val
581594
in Amocrm::FilePart unless val.filename.nil?
582-
filename = ERB::Util.url_encode(val.filename)
595+
filename = encode_path(val.filename)
583596
y << "; filename=\"#{filename}\""
584597
in Pathname | IO
585-
filename = ERB::Util.url_encode(::File.basename(val.to_path))
598+
filename = encode_path(::File.basename(val.to_path))
586599
y << "; filename=\"#{filename}\""
587600
else
588601
end
@@ -599,6 +612,7 @@ def encode_query_params(query)
599612
#
600613
# @return [Array(String, Enumerable<String>)]
601614
private def encode_multipart_streaming(body)
615+
# rubocop:disable Style/CaseEquality
602616
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
603617
boundary = SecureRandom.urlsafe_base64(46)
604618

@@ -608,7 +622,7 @@ def encode_query_params(query)
608622
in Hash
609623
body.each do |key, val|
610624
case val
611-
in Array if val.all? { primitive?(_1) }
625+
in Array if val.all? { primitive?(_1) || Amocrm::Internal::Type::FileInput === _1 }
612626
val.each do |v|
613627
write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
614628
end
@@ -624,6 +638,7 @@ def encode_query_params(query)
624638

625639
fused_io = fused_enum(strio) { closing.each(&:call) }
626640
[boundary, fused_io]
641+
# rubocop:enable Style/CaseEquality
627642
end
628643

629644
# @api private

lib/amocrm/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 Amocrm
4-
VERSION = "0.5.3"
4+
VERSION = "0.5.4"
55
end

rbi/amocrm/internal/util.rbi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,20 @@ module Amocrm
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/amocrm/internal/util.rbs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ module Amocrm
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)