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

Stray dailystraying at googlemail.com
Sun Nov 15 08:34:26 UTC 2009


Unfortunately yes... didn't make a difference. In the script only  
version, granularity =>  makes it add a letter at a time, but in the  
command it's just the same - no output from the git pull reaches the  
html pane until the process is complete.

On 14 Nov 2009, at 23:01, Luke Daley wrote:

> Have you tried passing :granularity => 1 to Process.run()?
>
> Check the docs in the file for what it means.
>
> On 13/11/2009, at 9:41 PM, Stray wrote:
>
>> 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...
>>
>> _______________________________________________
>> textmate-dev mailing list
>> textmate-dev at lists.macromates.com
>> http://lists.macromates.com/listinfo/textmate-dev
>
> _______________________________________________
> textmate-dev mailing list
> textmate-dev at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate-dev




More information about the textmate-dev mailing list