Skip to content

Commit 797eafe

Browse files
authored
Merge pull request #2134 from ruby/fix-json
Add `#flush` to `_JsonWrite`
2 parents 514eafa + 729e131 commit 797eafe

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

stdlib/json/0/json.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ end
88

99
interface _JsonWrite
1010
def write: (String json) -> void
11+
12+
def flush: () -> void
1113
end
1214

1315
interface _JsonReadableIO

test/stdlib/test_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def if_ruby31(&block)
5252

5353
module WithStdlibAliases
5454
def with_timeout(seconds: 1, nanoseconds: 0)
55-
unless block_given?
55+
unless block_given?
5656
return RBS::UnitTest::Convertibles::WithAliases::WithEnum.new(
5757
to_enum(__method__, seconds: seconds, nanoseconds: nanoseconds)
5858
)
@@ -105,6 +105,8 @@ def rand(max)
105105
class JsonWrite
106106
def write(_str)
107107
end
108+
109+
def flush = nil
108110
end
109111

110112
class JsonToWritableIO

0 commit comments

Comments
 (0)