From: Aaron Patterson Date: 2011-10-26T02:05:55+09:00 Subject: [ruby-core:40363] Re: [ruby-trunk - Feature #5479] import StringIO into core, add String#to_io --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 25, 2011 at 10:14:54PM +0900, Charles Nutter wrote: >=20 > Issue #5479 has been updated by Charles Nutter. >=20 >=20 > I assume the IO produced from a StringIO would not have a real file descr= iptor, since...it doesn't have a real file descriptor. >=20 > Could be done in JRuby using a ByteArrayInputStream. I'm not sure what it= would mean to have read *and* write support though. Is that what's request= ed here? A pseudo-IO that reads from and writes to an area of memory? Yes, that's exactly what it is. JRuby already implements StringIO from stdlib. I think Konstantin is just asking for: 1. You don't need to require stringio for it to be available 2. An implementation of `to_io` on String like this: class String def to_io; StringIO.new self; end end --=20 Aaron Patterson http://tenderlovemaking.com/ --opJtzjQTFsWo+cga Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJOpus2AAoJEJUxcLy0/6/G3+wH/2KF+vhe30o4qqXcZxq46z6J HtystlPOwJNV0jZUqxJA0sQF6/npK/DWR/RwDFZ2gjFIfcgqhUUtjMj/5juw+Lke /bujjxmzfdZk71VupsjvLiZ8Pdz0ks0PEBtrtKOjUW10S/9yNsvuG+m1dwxPj/IZ 3y9RIaGwZhkTdmDzjHziZiu3l8tfKOdjjn+Gqlo1kJFIoyGa7l6YLvDo7dxMK9t4 rflvYS4znJMXkv+/KkkIbCKedYTg4jB78oq9S/aC3xv/u2JE4s4RvYKGej5NZ/J0 LEPFDsPmIz/2d3FKq3vZsUTCuqBEa5ukt05prP9DX5hc2nWYlyL825FNxowyAmg= =840t -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga--