I'm having a bit of trouble with SciTE. I'm new to Ruby and I've been
working with SciTE for only a couple of days. For some reason whenever I
write a "puts" statement followed by a "gets" statement, the "puts"
statement doesn't show up in the output until I input a value for the
"gets" statement.
It only began occurring recently so I'm not sure if I accidentally
changed a setting when I was messing with the background color.
Or make sure the puts statement comes after the gets statement
Does SciTE work with Ruby 2.0 series ?
···
Date: Tue, 13 Aug 2013 02:39:16 +0200
From: lists@ruby-forum.com
To: ruby-talk@ruby-lang.org
Subject: SciTE Issue, "puts" doesn't show up until user input for "gets"
I'm having a bit of trouble with SciTE. I'm new to Ruby and I've been
working with SciTE for only a couple of days. For some reason whenever I
write a "puts" statement followed by a "gets" statement, the "puts"
statement doesn't show up in the output until I input a value for the
"gets" statement.
It only began occurring recently so I'm not sure if I accidentally
changed a setting when I was messing with the background color.
I use an STDOUT.flush statement to flush the buffer and be sure
everything waiting to print gets pushed out.....
seems to work well...I sprinkle liberally...
cj:)
ruby on...
···
From: alexandermcmillan@hotmail.com
To: ruby-talk@ruby-lang.org
Subject: RE: SciTE Issue, "puts" doesn't show up until user input for "gets"
Date: Wed, 14 Aug 2013 12:32:46 +0100
Try this:
x = puts = "Puts statement "
b = gets.chomp
x << b
puts x
Or make sure the puts statement comes after the gets statement
Does SciTE work with Ruby 2.0 series ?
Date: Tue, 13 Aug 2013 02:39:16 +0200
From: lists@ruby-forum.com
To: ruby-talk@ruby-lang.org
Subject: SciTE Issue, "puts" doesn't show up until user input for "gets"
I'm having a bit of trouble with SciTE. I'm new to Ruby and I've been
working with SciTE for only a couple of days. For some reason whenever I
write a "puts" statement followed by a "gets" statement, the "puts"
statement doesn't show up in the output until I input a value for the
"gets" statement.
It only began occurring recently so I'm not sure if I accidentally
changed a setting when I was messing with the background color.
> I'd rather try
>
> $stdout.sync = true
>
> Reasoning: SciTE likely opens a pipe for IO with the process and it may
> be
> that the IO object is in non sync mode. This can be checked with
>
> puts $stdout.sync
Thanks robert! That fixed the problem. I appreciate it.
You're welcome.
Do you have any idea as to how it entered non sync mode?
If I am not mistaken Ruby decides this initially based on the type of
stream the file descriptor points at. For pipes buffering is usually more
efficient since that increases throughput in the common use case of a
processing pipeline (as with grep, sed etc.). Usage from an editor is a
rare case - and often these open pseudo terminals I guess. In those cases
it's probably going unbuffered for immediate feedback.
Kind regards
robert
···
On Thu, Aug 15, 2013 at 4:32 PM, Devin Dwyer <lists@ruby-forum.com> wrote: