Skip to content
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

Add chomp to IO#readline and IO#readlines #2059

Merged
merged 2 commits into from
Oct 15, 2024

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
18 checks passed
@sue445 sue445 deleted the io_readlines_chomp branch October 15, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants