New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable IO and UpdateTest types #15104
Changes from all commits
15582dd
a4091b4
80091b8
a20d28f
4f5fc77
f9e512b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
# typed: false | ||
# typed: true | ||
# frozen_string_literal: true | ||
|
||
class IO | ||
def readline_nonblock(sep = $INPUT_RECORD_SEPARATOR) | ||
line = +"" | ||
buffer = +"" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs to be outside the |
||
loop do | ||
break if buffer == sep | ||
begin | ||
loop do | ||
break if buffer == sep | ||
|
||
read_nonblock(1, buffer) | ||
line.concat(buffer) | ||
end | ||
read_nonblock(1, buffer) | ||
line.concat(buffer) | ||
end | ||
|
||
line.freeze | ||
rescue IO::WaitReadable, EOFError => e | ||
raise e if line.empty? | ||
line.freeze | ||
rescue IO::WaitReadable, EOFError | ||
raise if line.empty? | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
line.freeze | ||
line.freeze | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? I tested it locally and it didn't seem to care.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, are some of these changes only needed for
typed: strict
@dduugg?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, this is a vestige of attempting to type the
Utils.popen*
methods. Would you like me to remove it in the next typing PR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dduugg No, all good!