IO#gets and StringIO#gets both throw exceptions when you pass in a limit in 1.9 
mode
------------------------------------------------------------------------------------

                 Key: JRUBY-5926
                 URL: https://jira.codehaus.org/browse/JRUBY-5926
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Ruby 1.9.2
    Affects Versions: JRuby 1.6.3, JRuby 1.7
         Environment: JRuby 1.6.3 and JRuby HEAD with Java 6 on OS X 10.6.8
            Reporter: Ian Dees
         Attachments: 
0001-Support-byte-limits-in-IO-gets-and-StringIO-gets-in-.patch

(This ticket is related to JRUBY-5910, but is broader in scope.)

Ruby 1.9 allows passing a maximum byte count to IO#gets, either as the sole 
argument or the second argument.  The current implementation throws an 
{{ArgumentError}}, {{TypeError}}, or {{NullPointerException}} when you pass in 
a byte limit, depending on whether the underlying object is a RubyIO or a 
RubyStringIO and on which position you pass the limit argument.

The attached patch has test cases and tweaks to RubyIO/RubyStringIO.  There's 
probably an opportunity to unify the approaches the two classes take towards 
separators and encoding, but the current patch doesn't tackle that opportunity.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to