Yeah, doesn't seem to be a better way.  Otherwise it just blocks and hangs, which isn't helpful UX.  It does have to copy it into a string, which will take a little memory, but should be relatively small and short-lived.


http://stackoverflow.com/questions/9611648/what-is-a-portable-way-in-ruby-to-check-where-stdin-will-block-if-you-attempt-to