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

File.readlines(path, chomp: true) isn't supported (standard) #453

Closed
cbortz opened this issue Dec 10, 2020 · 1 comment · Fixed by #454
Closed

File.readlines(path, chomp: true) isn't supported (standard) #453

cbortz opened this issue Dec 10, 2020 · 1 comment · Fixed by #454

Comments

@cbortz
Copy link
Contributor

cbortz commented Dec 10, 2020

Given the following code:

File.readlines(path, chomp: true)

When invoked in a fake filesystem, I receive this error:

ArgumentError: wrong number of arguments (given 2, expected 1)

As far as I can tell, Ruby's IO class has supported the :chomp option since v2.5 (although this blog post suggests since v2.4). The general idea is that #chomp will be invoked on each item returned in the array.

Are y'all willing to support this? If so, I'm happy to open a PR for it within a day or so!

@grosser
Copy link
Collaborator

grosser commented Dec 10, 2020

PR welcome as long as it does not get super-funky :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants