Published in: Ruby
#!/usr/bin/env ruby -w require 'win32ole' require 'timeout' require ENV['TM_SUPPORT_PATH'] + "/lib/exit_codes.rb" filename = ENV['TM_FILEPATH'].delete '\\' url = "file:///" + %x[cygpath -m "#{filename}"].chomp.capitalize begin Timeout::timeout(5) { ie = WIN32OLE.new('InternetExplorer.Application') ie.Navigate("#{url}") sleep('.2'.to_f) while ie.ReadyState != 4 ie.Visible = 'true' } rescue Timeout::Error puts "Unable connect to #{url} in a reasonable time" TextMate.exit_show_tool_tip end
You need to login to post a comment.
