[SVN] run_script.rb: Changes for Ruby 1.9

Charles Turner vze26m98 at optonline.net
Thu Aug 28 18:29:45 UTC 2008

This diff file shows the patches I made to get the Ruby bundle support 
run_script.rb to work with ruby 1.9.0 (2007-12-25 revision 14709) 

My apologies that this presentation is so crude. The previous diff were 
"backwards" from the point of readability, and now I've compounded the 
issue by switching the "left and right handedness" of the files. Sorry!

This code might work on any version of Ruby courtesy of James Gray...
Zip of the diff attached below.


--- /Users/cturner/Desktop/run_script.rb
+++ run_script.rb
@@ -62,7 +62,7 @@
       htmlize(str).gsub(/[EF]+/, "<span style=\"color: 
red\">\\&</span>") +
             "<br style=\"display: none\"/>"
     elsif is_test_script
-      out = str.map do |line|
+      out = str.send(str.respond_to?(:lines) ? :lines : :to_s).map do 
         if line =~ /^(\s+)(\S.*?):(\d+)(?::in\s*`(.*?)')?/
           indent, file, line, method = $1, $2, $3, $4
           url, display_name = '', 'untitled document';
-------------- next part --------------
A non-text attachment was scrubbed...
Name: run_script.diff
Type: application/octet-stream
Size: 505 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20080828/0d872703/attachment.diff>

More information about the textmate-dev mailing list