This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 114476 - print statement doesn't display to the IDE's output consistently
Summary: print statement doesn't display to the IDE's output consistently
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Platform (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
: 130714 (view as bug list)
Depends on: 151011
Blocks:
  Show dependency tree
 
Reported: 2007-09-03 09:42 UTC by travis0868
Modified: 2009-02-19 23:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description travis0868 2007-09-03 09:42:38 UTC
I have NetBeans IDE 6.0 M10 build 200706281431.  I have a version of ruby from 8/30/07.  Unfortunately, I don't know the
build number because when I go to the plugin for ruby, all it says is "standard source".

"print" doesn't display to the IDE's output consistently.  If I enter the following line:

print "Hello World"

It will run the first time I do "run file --> run".  But if I do run file again, it won't display.  If I add more print
lines, sometimes those lines will display to output after being added, but sometimes not.  It is inconsistent.  

puts "Hello World" will *always* display to the IDE's output.  If there are print statements before the puts, those
print statements will always display to the output.  But if there are print statements after the puts, those print
statements might display or might not display.

-----------------------------
Also, this xml page doesn't give me daily updates
http://www.netbeans.org/updates/dev_1.18_.xml

Also, when will http://blog.gmane.org/gmane.comp.java.netbeans.modules.ruby.devel be searchable?

As general praise, your debugger is far superior to Eclipse's ruby plugin.  It is the reason I am trying to switch over
to NB.
Comment 1 Torbjorn Norbye 2007-10-15 23:04:09 UTC
I think the problem here is output buffering. It doesn't always seem to get flushed when the child process dies.  If you
were to use "puts" instead of "print" (which includes a newline) the newline will cause the I/O to get flushed and it
will always show up.

The code to suck I/O out of the child process (in OutputForwarder) is really painful. The proper solution here is to use
pty's. The java.lang.Process API doesn't give us enough control over the process launching. There is a workaround right
now with the sync-stdio.rb script (in netbeans/ruby1/) which is run in the target ruby process to encourage the child
process to perform synchronous I/O but I'm guess it's not working on a finer granularity than the line level.
Comment 2 Torbjorn Norbye 2007-10-15 23:06:25 UTC
Regarding your other questions: We're not really using the update center to push regular updates since it requires
dilligence in maintaining module version updates. Once 6.0 goes out we'll push stable release updates that way. For now
the easiest (but not most bandwidth friendly) way to stay up to date is to just grab the Ruby IDE regularly from
http://deadlock.netbeans.org/hudson/job/ruby/ . 

Regarding gmane: Try using Nabble to access the dev list instead - 
http://www.nabble.com/NetBeans-Ruby-f27019.html

It's searchable.
Comment 3 Martin Krauskopf 2008-03-21 09:18:55 UTC
*** Issue 130714 has been marked as a duplicate of this issue. ***
Comment 4 Martin Krauskopf 2008-11-24 17:07:27 UTC
So this should be fixed in trunk, as Erno migrated to the Execution API. Reopen if you are able to reproduce. Thanks.