Skip to content

Commit 6207686

Browse files
chore: migrate away from deprecated JSON#fast_generate
1 parent 9229774 commit 6207686

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ multitask(:test) do
3131
.map { "require_relative(#{_1.dump});" }
3232
.join
3333

34-
ruby(*%w[-e], rb, verbose: false) { fail unless _1 }
34+
ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 }
3535
end
3636

3737
rubo_find = %w[find ./lib ./test ./rbi -type f -and ( -name *.rb -or -name *.rbi ) -print0]

lib/orb/internal/util.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ class << self
493493
y << val.to_s
494494
else
495495
y << "Content-Type: application/json\r\n\r\n"
496-
y << JSON.fast_generate(val)
496+
y << JSON.generate(val)
497497
end
498498
y << "\r\n"
499499
end
@@ -570,9 +570,9 @@ def encode_content(headers, body)
570570
content_type = headers["content-type"]
571571
case [content_type, body]
572572
in [Orb::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }]
573-
[headers, JSON.fast_generate(body)]
573+
[headers, JSON.generate(body)]
574574
in [Orb::Internal::Util::JSONL_CONTENT, Enumerable] unless body.is_a?(Orb::Internal::Type::FileInput)
575-
[headers, body.lazy.map { JSON.fast_generate(_1) }]
575+
[headers, body.lazy.map { JSON.generate(_1) }]
576576
in [%r{^multipart/form-data}, Hash | Orb::Internal::Type::FileInput]
577577
boundary, strio = encode_multipart_streaming(body)
578578
headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"}

0 commit comments

Comments
 (0)