[SVN] Re: executor.rb: Changes for Ruby 1.9

Charles Turner vze26m98 at optonline.net
Thu Aug 28 20:34:40 UTC 2008

On Thu, 28 Aug 2008 14:48:37 -0500, James Gray wrote:
> This patch loads jcode, but doesn't call any jcode methods.  We should  
> be able to remove that line.

> $KCODE = "U" is also the old 1.9 strategy.  I believe the 1.9  
> equivalent would be:
> # coding: UTF-8

Sorry again! I had to remove these to get executor.rb to work in 1.9

> I'm uncomfortable with how this removes the block check in the if  
> statement as well.

If I understand you, I ADDED the block check to get this to work in 1.9:

   callback = proc do |str, type|
     str.gsub!(ENV["TM_FILEPATH"], "untitled") if 
     filtered_str = block.call(str,type) if block.nil? == false && 
[:err, :out].include?(type)
     if [:err, :out].include?(type) and not filtered_str.nil?
		io << filtered_str
		str = htmlize(str).gsub(/\<br\>/, "<br>\n")
		str = "<span style='color: red'>#{str}</span>" if type == :err
		str = "<span style='font-style: italic'>#{str}</span>" if type == 
		io << str

But as I saud, I'm no Ruby genius, and am not sure that this is what's 
really wrong with the code.

Best, Charles

More information about the textmate-dev mailing list