Skip to content

File/IO readlines supporting new params limit, and open mode#650

Merged
enebo merged 2 commits intojruby:masterfrom
josedonizetti:io_readlines
Apr 24, 2013
Merged

File/IO readlines supporting new params limit, and open mode#650
enebo merged 2 commits intojruby:masterfrom
josedonizetti:io_readlines

Conversation

@josedonizetti
Copy link
Member

It fixes 12 failures, and 9 errors of the rubyspec test core/io/readlines_spec.rb
Let me know if I need to change anything.

@enebo
Copy link
Member

enebo commented Apr 23, 2013

@josedonizetti This patch looks good but there is one problem with it. The @JRubyMethod annotations for both of those method bindings will work in both 1.8 and 1.9 mode. The new argument support you are adding should only work for 1.9 mode.

Could you refactor this to support both modes (You can see an example of this splitting in RubyIO.sysopen()/RubyIO.sysopen19())? Mostly this just means having 4 Java methods 2 for 1.8 and 2 for 1.9 with usually a common method which can perform the work. Be aware due to backwards compat that the original Java method names for these need to keep their names and the same method signature. The 1.9 versions can be labelled readlines19().

@josedonizetti
Copy link
Member Author

@enebo With this last commit, the support is exclusive for 1.9 not affecting 1.8 at all. Also I've fixed all the specs related to IO.readlines but two. One because of enconding, when reading the files at the time of comparing the characters are all corrupted and the other because JRuby don't yet support IO.popen("-") we get this error on the 1.8 as well. Let me know if anything. Thanks!

enebo added a commit that referenced this pull request Apr 24, 2013
File/IO readlines supporting new params limit, and open mode (thanks jose!)
@enebo enebo merged commit a09d139 into jruby:master Apr 24, 2013
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 this pull request may close these issues.

2 participants