[TxMt] Re: Input from gets in Ruby (Sune Foldager)

William M Shobe shobe at virginia.edu
Fri Sep 30 14:09:51 UTC 2005


I have tried using gets and no input dialog pops up.  Here is my code:

puts "this is a test"
puts gets
puts "end of test"

I use Run Ruby, and here is the output:

this is a test
puts "this is a test"
end of test

Bill

> From: William M Shobe <shobe at virginia.edu>
> Date: September 29, 2005 10:28:59 AM EDT
> To: textmate at lists.macromates.com
> Subject: [TxMt] Input from gets in Ruby
> Reply-To: TextMate users <textmate at lists.macromates.com>
>
>
> Please excuse the simple question, but I am experimenting with  
> TextMate and Ruby.  The output from running a Ruby script goes to a  
> stdout window.  However, I can't figure out how to get input from  
> the gets method.  Is there any way to read from stdin when running  
> a Ruby script from the Run Command>Ruby>Run Ruby menu?
>
> Thanks for any help.
>
> Bill Shobe
>
>
>
>
>
> From: Sune Foldager <cryo at cyanite.org>
> Date: September 29, 2005 12:08:58 PM EDT
> To: TextMate users <textmate at lists.macromates.com>
> Subject: Re: [TxMt] Input from gets in Ruby
> <snip>
> Yes, this happens automatically, but stdin is redirected to read  
> input from a dialog which should pop up whenever your script does a  
> gets or similar.
>
> -- Sune.
>
>
> <snip>
>
> From: Sune Foldager <cryo at cyanite.org>
> Date: September 29, 2005 1:58:10 PM EDT
> To: Kumar McMillan <kumar.mcmillan at gmail.com>, TextMate users  
> <textmate at lists.macromates.com>
> Subject: Re: [TxMt] Input from gets in Ruby
> Reply-To: TextMate users <textmate at lists.macromates.com>
>
>
> On 29/09/2005, at 19.54, Kumar McMillan wrote:
>
>
>> oh, hehe, it is just the Run Ruby command.  Sorry, I thought you  
>> meant
>> this was built into TextMate!
>>
>
> Nope :-p, but it's built into the Run Python command also :-).
>
> -- Sune.
>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20050930/368d0c1d/attachment.html>


More information about the textmate mailing list