[SVN] Sync output from TextMate::Process.run ?

Stray dailystraying at googlemail.com
Fri Nov 13 11:41:45 UTC 2009


I'm developing a bundle for RobotLegs AS3 projects, mostly using Ruby.

I have a command, 'Create New RobotLegs Project', which sets up  
directories and files, pulling the required code libraries from github.

When the script clones the git repository, the output is sync if I run  
a .rb script (using the Ruby Bundle's Run command in TextMate), but  
when I paste that script direct into the tmCommand, the git output is  
suppressed until the end of the clone, when it all comes through in  
one go. It all works as a command, but I don't get the feedback in  
real time.

Relevant part of the code is:

	args = ["clone", "-v", "git://github.com/robotlegs/robotlegs-framework.git 
", "robotlegs/"]
	TextMate::Process.run("git", args, :interactive_input => false) do | 
str|
		STDOUT.puts str
	end

I have STDOUT.sync = true higher up in the script.

I have also tried
	
	STDOUT << str

and

	puts str

They both work, but are also stalled until the end of the clone process.

---

To be clear - when running the script normally, the 'STDOUT.puts str'  
line executes in real time, but when running the command all the  
output comes through in one block at the end.  The code in the command  
is identical to the code in the .rb script.  I am including the  
html_header and using <pre/> around this output.

I'm aware that I could try TextMate::Executor.run as well, but I'd  
much rather keep the actual ruby code in the command itself where it's  
easier for the Bundle's users to tweak it to suit them.

Does anyone have any ideas? I'm really out of them...




More information about the textmate-dev mailing list