I write this:
puts “foo”
some_var = gets
I expect the foo to show up before the gets occurs but it does not. Any
ideas?
I write this:
puts “foo”
some_var = gets
I expect the foo to show up before the gets occurs but it does not. Any
ideas?
On 29 Oct 2007, at 11:01, Lloyd L. wrote:
I write this:
puts “foo”
some_var = getsI expect the foo to show up before the gets occurs but it does
not. Any
ideas?
The puts maybe buffered. Does this work as you expect:
$stdout.sync = true
puts “foo”
some_var = gets
Alex G.
Bioinformatics Center
Kyoto University
Lloyd L. wrote:
I write this:
puts “foo”
some_var = getsI expect the foo to show up before the gets occurs but it does not. Any
ideas?
Or you could manually flush the buffer:
puts “foo”
STDOUT.flush
some_var = gets
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs