0

SciTE version is 2.25.

I have some ruby code to test it.

def foo
  puts "hello"
  sleep 5
  puts "world"
end

puts foo

SciTE's output pane will show this:

>ruby scite.rb

And 5 seconds later print:

hello
world

>Exit code: 0

It's not correct and I remember the previous version SciTE is right. Why?

Jakub Hampl
  • 39,863
  • 10
  • 77
  • 106
Saito
  • 168
  • 6

1 Answers1

3

Try putting STDOUT.sync = true at the beginning of your program. I'm neither a Windows nor SciTE user, but I know that some of our students at Rubylearning had similar problems and apparently that was the fix (or manual calls to flush after outputting something).

Michael Kohl
  • 66,324
  • 14
  • 138
  • 158
  • Thx! it works. why it runs correct in 'irb'? and have anyother beautiful method to solve this? (putting 'that' at the beginning of a program is not cool – Saito Mar 24 '11 at 14:09
  • Sorry, as I said I'm not a Windows user, I only happened to know this one because some of our students had the same problem. – Michael Kohl Mar 24 '11 at 15:38