Skip to content

Conversation

@sue445
Copy link
Contributor

@sue445 sue445 commented Oct 14, 2024

IO.readlines supports chomp argument and signature exists.

rbs/core/io.rbs

Lines 2764 to 2766 in 745943b

# - IO.readlines(path, sep = $/, **opts) -> array
# - IO.readlines(path, limit, **opts) -> array
# - IO.readlines(path, sep, limit, **opts) -> array

rbs/core/io.rbs

Line 2813 in 745943b

def self.readlines: (String | _ToPath name, ?String sep, ?Integer limit, ?external_encoding: String | Encoding | nil, ?internal_encoding: String | Encoding | nil, ?encoding: String | Encoding | nil, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?mode: String, ?chomp: boolish) -> ::Array[String]

IO#readline and IO#readlines likewise support the chomp argument.

rbs/core/io.rbs

Lines 1632 to 1634 in 745943b

# - readline(sep = $/, chomp: false) -> string
# - readline(limit, chomp: false) -> string
# - readline(sep, limit, chomp: false) -> string

rbs/core/io.rbs

Lines 1645 to 1647 in 745943b

# - readlines(sep = $/, chomp: false) -> array
# - readlines(limit, chomp: false) -> array
# - readlines(sep, limit, chomp: false) -> array

But this didn't exist in io.rbs, so I added.

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👏

@soutaro soutaro added this pull request to the merge queue Oct 15, 2024
@soutaro soutaro added this to the RBS 3.7 milestone Oct 15, 2024
Merged via the queue into ruby:master with commit ce6c754 Oct 15, 2024
@sue445 sue445 deleted the io_readlines_chomp branch October 15, 2024 03:03
@soutaro soutaro added the Released PRs already included in the released version label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Released PRs already included in the released version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants