Skip to content

Commit af968ac

Browse files
authored
Merge pull request #19 from Hexlet/release-please--branches--main--changes--next
release: 0.7.4
2 parents 25fd621 + d9604ee commit af968ac

205 files changed

Lines changed: 1686 additions & 315 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,58 @@
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/**'
1315
- 'stl-preview-base/**'
1416

1517
jobs:
18+
build:
19+
timeout-minutes: 10
20+
name: build
21+
permissions:
22+
contents: read
23+
id-token: write
24+
runs-on: ${{ github.repository == 'stainless-sdks/docker-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
25+
if: |-
26+
github.repository == 'stainless-sdks/docker-ruby' &&
27+
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
28+
steps:
29+
- uses: actions/checkout@v6
30+
- name: Set up Ruby
31+
uses: ruby/setup-ruby@v1
32+
with:
33+
bundler-cache: false
34+
- run: |-
35+
bundle install
36+
37+
- name: Get GitHub OIDC Token
38+
if: |-
39+
github.repository == 'stainless-sdks/docker-ruby' &&
40+
!startsWith(github.ref, 'refs/heads/stl/')
41+
id: github-oidc
42+
uses: actions/github-script@v8
43+
with:
44+
script: core.setOutput('github_token', await core.getIDToken());
45+
46+
- name: Build and upload gem artifacts
47+
if: |-
48+
github.repository == 'stainless-sdks/docker-ruby' &&
49+
!startsWith(github.ref, 'refs/heads/stl/')
50+
env:
51+
URL: https://pkg.stainless.com/s
52+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
53+
SHA: ${{ github.sha }}
54+
PACKAGE_NAME: docker_engine_ruby
55+
run: ./scripts/utils/upload-artifact.sh
1656
lint:
1757
timeout-minutes: 10
1858
name: lint

.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.7.3"
2+
".": "0.7.4"
33
}

CHANGELOG.md

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

3+
## 0.7.4 (2026-04-23)
4+
5+
Full Changelog: [v0.7.3...v0.7.4](https://github.com/Hexlet/docker-ruby/compare/v0.7.3...v0.7.4)
6+
7+
### Bug Fixes
8+
9+
* align path encoding with RFC 3986 section 3.3 ([590bc94](https://github.com/Hexlet/docker-ruby/commit/590bc94c26ce9d630f0f6b4c9458d837876a9a98))
10+
* **internal:** correct multipart form field name encoding ([d2df78a](https://github.com/Hexlet/docker-ruby/commit/d2df78ae65e43660b24958459e1f1f165ca9483f))
11+
* multipart encoding for file arrays ([b186016](https://github.com/Hexlet/docker-ruby/commit/b186016397a9419d3f4622e1bd5fc6ad8a02bc82))
12+
* properly mock time in ruby ci tests ([f291b96](https://github.com/Hexlet/docker-ruby/commit/f291b9605760add258fc3e596a664800663d9e7f))
13+
* variable name typo ([b827fa8](https://github.com/Hexlet/docker-ruby/commit/b827fa8ca02b7b0ca4d27ee6cf45cb520069c959))
14+
15+
16+
### Chores
17+
18+
* **ci:** add build step ([f5b8022](https://github.com/Hexlet/docker-ruby/commit/f5b8022932e298a82aa303e923a6e5bf69279cdc))
19+
* **ci:** skip lint on metadata-only changes ([24f48e2](https://github.com/Hexlet/docker-ruby/commit/24f48e2052ca6fd27a2e19a49f9436891a522902))
20+
* **ci:** skip uploading artifacts on stainless-internal branches ([1b1aa08](https://github.com/Hexlet/docker-ruby/commit/1b1aa0891ea556e0c8ffa46ea20ff0a4d5f3e700))
21+
* **ci:** support opting out of skipping builds on metadata-only commits ([a9b2155](https://github.com/Hexlet/docker-ruby/commit/a9b2155d508034db5317b6e7122183b167f7ae92))
22+
* **internal:** codegen related update ([c0b2afb](https://github.com/Hexlet/docker-ruby/commit/c0b2afb257b2a173db9721e248ecbbcb230c54c1))
23+
* **internal:** codegen related update ([ab55081](https://github.com/Hexlet/docker-ruby/commit/ab550815719723e748965fb23c2547aee2b1de91))
24+
* **internal:** more robust bootstrap script ([d23ffee](https://github.com/Hexlet/docker-ruby/commit/d23ffee2238d18545a5b1bb69a515e22b427fea8))
25+
* **internal:** tweak CI branches ([7889dd4](https://github.com/Hexlet/docker-ruby/commit/7889dd429e6f5facaad352660290bee0a81bd446))
26+
* **internal:** update gitignore ([33e96c7](https://github.com/Hexlet/docker-ruby/commit/33e96c75c33be17c746f95320942a9e2d362cad1))
27+
* update placeholder string ([a3b8bba](https://github.com/Hexlet/docker-ruby/commit/a3b8bbab2dfb07a0a882c843f4d7c28da690772c))
28+
329
## 0.7.3 (2026-02-24)
430

531
Full Changelog: [v0.7.2...v0.7.3](https://github.com/Hexlet/docker-ruby/compare/v0.7.2...v0.7.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-
docker-engine-ruby (0.7.3)
14+
docker-engine-ruby (0.7.4)
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 "docker-engine-ruby", "~> 0.7.3"
20+
gem "docker-engine-ruby", "~> 0.7.4"
2121
```
2222

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

lib/docker_engine_ruby/internal/util.rb

Lines changed: 53 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 #{DockerEngineRuby::Internal::Type::BaseModel}, got #{data.inspect}"
160+
message = "Expected a #{Hash} or #{DockerEngineRuby::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(DockerEngineRuby::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
@@ -490,6 +504,37 @@ def writable_enum(&blk)
490504
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
491505

492506
class << self
507+
# @api private
508+
#
509+
# @param query [Hash{Symbol=>Object}]
510+
#
511+
# @return [Hash{Symbol=>Object}]
512+
def encode_query_params(query)
513+
out = {}
514+
query.each { write_query_param_element!(out, _1, _2) }
515+
out
516+
end
517+
518+
# @api private
519+
#
520+
# @param collection [Hash{Symbol=>Object}]
521+
# @param key [String]
522+
# @param element [Object]
523+
#
524+
# @return [nil]
525+
private def write_query_param_element!(collection, key, element)
526+
case element
527+
in Hash
528+
element.each do |name, value|
529+
write_query_param_element!(collection, "#{key}[#{name}]", value)
530+
end
531+
in Array
532+
collection[key] = element.map(&:to_s).join(",")
533+
else
534+
collection[key] = element.to_s
535+
end
536+
end
537+
493538
# @api private
494539
#
495540
# @param y [Enumerator::Yielder]
@@ -540,16 +585,15 @@ class << self
540585
y << "Content-Disposition: form-data"
541586

542587
unless key.nil?
543-
name = ERB::Util.url_encode(key.to_s)
544-
y << "; name=\"#{name}\""
588+
y << "; name=\"#{key}\""
545589
end
546590

547591
case val
548592
in DockerEngineRuby::FilePart unless val.filename.nil?
549-
filename = ERB::Util.url_encode(val.filename)
593+
filename = encode_path(val.filename)
550594
y << "; filename=\"#{filename}\""
551595
in Pathname | IO
552-
filename = ERB::Util.url_encode(::File.basename(val.to_path))
596+
filename = encode_path(::File.basename(val.to_path))
553597
y << "; filename=\"#{filename}\""
554598
else
555599
end
@@ -566,6 +610,7 @@ class << self
566610
#
567611
# @return [Array(String, Enumerable<String>)]
568612
private def encode_multipart_streaming(body)
613+
# rubocop:disable Style/CaseEquality
569614
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
570615
boundary = SecureRandom.urlsafe_base64(46)
571616

@@ -575,7 +620,7 @@ class << self
575620
in Hash
576621
body.each do |key, val|
577622
case val
578-
in Array if val.all? { primitive?(_1) }
623+
in Array if val.all? { primitive?(_1) || DockerEngineRuby::Internal::Type::FileInput === _1 }
579624
val.each do |v|
580625
write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
581626
end
@@ -591,6 +636,7 @@ class << self
591636

592637
fused_io = fused_enum(strio) { closing.each(&:call) }
593638
[boundary, fused_io]
639+
# rubocop:enable Style/CaseEquality
594640
end
595641

596642
# @api private

lib/docker_engine_ruby/models/config_delete_params.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ class ConfigDeleteParams < DockerEngineRuby::Internal::Type::BaseModel
77
extend DockerEngineRuby::Internal::Type::RequestParameters::Converter
88
include DockerEngineRuby::Internal::Type::RequestParameters
99

10-
# @!method initialize(request_options: {})
10+
# @!attribute id
11+
#
12+
# @return [String]
13+
required :id, String
14+
15+
# @!method initialize(id:, request_options: {})
16+
# @param id [String]
1117
# @param request_options [DockerEngineRuby::RequestOptions, Hash{Symbol=>Object}]
1218
end
1319
end

lib/docker_engine_ruby/models/config_inspect_params.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ class ConfigInspectParams < DockerEngineRuby::Internal::Type::BaseModel
77
extend DockerEngineRuby::Internal::Type::RequestParameters::Converter
88
include DockerEngineRuby::Internal::Type::RequestParameters
99

10-
# @!method initialize(request_options: {})
10+
# @!attribute id
11+
#
12+
# @return [String]
13+
required :id, String
14+
15+
# @!method initialize(id:, request_options: {})
16+
# @param id [String]
1117
# @param request_options [DockerEngineRuby::RequestOptions, Hash{Symbol=>Object}]
1218
end
1319
end

lib/docker_engine_ruby/models/config_update_params.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@ class ConfigUpdateParams < DockerEngineRuby::Internal::Type::BaseModel
77
extend DockerEngineRuby::Internal::Type::RequestParameters::Converter
88
include DockerEngineRuby::Internal::Type::RequestParameters
99

10+
# @!attribute id
11+
#
12+
# @return [String]
13+
required :id, String
14+
1015
# @!attribute version
1116
#
1217
# @return [Integer]
1318
required :version, Integer
1419

15-
# @!method initialize(version:, request_options: {})
20+
# @!method initialize(id:, version:, request_options: {})
21+
# @param id [String]
1622
# @param version [Integer]
1723
# @param request_options [DockerEngineRuby::RequestOptions, Hash{Symbol=>Object}]
1824
end

0 commit comments

Comments
 (0)