[TxMt] Strange ruby problem

Juan juanfc at lcc.uma.es
Mon Feb 12 02:42:41 UTC 2007


	Sorry if I am posting an out of topic, but this problems raised to  
me when hooking the save process to hold a saved file history stack:

------------- Command, Cmd-S  (pre: SaveFile)
#!/usr/bin/env ruby

H = "/Users/me/.TM_LastFiles"

files = []
last = ENV["TM_FILEPATH"]
files << last

if FileTest.exist?(H)
   IO.readlines(H).each {|l|
     if l != last
       files << l
     end
   }
end

f = File.new(H, "w")
files.each {|l|
   f.puts l
}
f.close

puts files
--------------------

	Why it always ignores the "if" and adds always the current file to  
the files array??

????








More information about the textmate mailing list