Sha256: 5373f79132764bcc1eea253e89f62dd7494a8ca4ad7b4e898596bf0a93488228

Contents?: true

Size: 1.25 KB

Versions: 53

Compression:

Stored size: 1.25 KB

Contents

STDOUT.sync = true
STDERR.sync = true

require 'pathname'

at_exit do
  if (e = $!) && !e.instance_of?(SystemExit)
    require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
    require "cgi"
    io = IO.for_fd(ENV['TM_ERROR_FD'].to_i)

    io.write "<div id='exception_report' class='framed'>\n"
    io.write "<p id='exception'><strong>#{e.class.name}:</strong> #{CGI.escapeHTML e.message.sub(/`(\w+)'/, '‘\1’').sub(/ -- /, ' — ')}</p>\n"

    io.write "<blockquote><table border='0' cellspacing='0' cellpadding='0'>\n"

    e.backtrace.each do |b|
      if b =~ /(.*?):(\d+)(?::in\s*`(.*?)')?/ then
        file, line, method = $1, $2, $3

        url, display_name = '', 'untitled document';
        if file != '-' && File.exists?(file) then
          file = Pathname.new(file).realpath.to_s
          url = '&url=file://' + e_url(file)
          display_name = File.basename(file)
        end
          
        io << "<tr><td><a class='near' href='txmt://open?line=#{line + url}'>"
        io << (method ? "method #{CGI::escapeHTML method}" : '<em>at top level</em>')
        io << "</a></td>\n<td>in <strong>#{CGI::escapeHTML display_name}</strong> at line #{line}</td></tr>\n"
      end
    end
    
    io.write "</table></blockquote></div>"
    io.flush

    exit!
  end
end

Version data entries

53 entries across 28 versions & 1 rubygems

Version Path
zena-1.0.0.rc2 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.rc2 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.rc1 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.rc1 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.9 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.9 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.beta3 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.beta3 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.8 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.8 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.beta2 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.beta2 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.beta1 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-1.0.0.beta1 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.7 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.7 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.6 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.6 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.5 vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb
zena-0.16.5 vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb