[ANN] Textmate Backtracer 1.0


#1

Originally posted at http://blog.inquirylabs.com/2006/02/11/textmate-
backtracer-10/

== Announcing Version 1.0 ==
The backtracer has been around for a while now, and seems to have
done its job well enough to deserve a 1.0 mark.

== What Is It? ==
Whenever a Rails exception occurs, it spits out a backtrace full of
filenames and line numbers. Iâ??ve often thought, â??Wouldnâ??t it be nice
if I could just click on one of those and it would take me to the
problem?� The textmate_backtracer plugin will make each of the
backtrace lines clickable in your browser.

== One Improvement ==
This release includes a small improvement from Geoff Grosenbach that
limits the loading of this plugin to development mode only. Geoff
notes that this “simplifies the backtrace when running tests”. Thanks
Geoff.

== Download Version 1.0 ==
http://inquirylabs.com/downloads/textmate_backtracer-1.0.tgz

== Installation ==
Download the tgz file to [your rails app]/vendor/plugins

$ cd [your rails app]/vendor/plugins
$ tar -xzvf textmate_backtracer-1.0.tgz

Enjoy!

Duane J.
(canadaduane)
http://blog.inquirylabs.com/


#2

I imagine more people will be reading the list than the blog, so
here’s my comment/question:

I just installed it and it’s not working for me, there aren’t any
links. I tried the old version just to see if it works, same problem.

I don’t have anything overriding how I handle Exceptions. Any clue as
to what the problem might be?

Oh, also I’m getting “Rendering
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/templates/rescues/layout.rhtml
(500 Internal Error)”. Could that be the problem? I get that error
during an exception even without the plugin installed though.

Pat


#3

*#&@ that’s cool.

Makes me want a Mac even more :wink:

-nb

 Nathaniel S. H. Brown                           http://nshb.net

#4

On Feb 11, 2006, at 2:34 PM, Pat M. wrote:

I just installed it and it’s not working for me, there aren’t any
links. I tried the old version just to see if it works, same problem.

I don’t have anything overriding how I handle Exceptions. Any clue as
to what the problem might be?

Did you restart everything after installing?


– Tom M.


#5

Howto setup “Textmate Backtracer” on Windows+Emacs :slight_smile:

  1. Place info you .emacs file:

    (require 'gnuserv)
    (setq gnuserv-frame (selected-frame))
    (gnuserv-start)

    1. Create into you emacs bin directory txmt.js and place into it:

    var wsh = WScript.CreateObject(“WScript.Shell”);
    url = WScript.Arguments(0);
    if (url) {
    var req = /file://([^&]+).*&line=([0-9]+)/;
    var file = req.exec(url);
    if (file[1] && file[2]) {
    wsh.Run("<path_to_emacs_bin_directory>/gnuclientw.exe +" +
    file[2] + " " + file[1]);
    }
    }

    1. Create registry key structure
      HKEY_CLASSES_ROOT
      txmt
      ---- (Default) = “URL:TXMT Protocol”
      ---- URL Protocol = “”
      ---- shell
      ------ open
      -------- command
      ---------- (Default) = “cscript /H:WScript /nologo
      <path_to_emacs_bin_direcory>\txmt.js %1”

#6

== One Improvement ==
This release includes a small improvement from Geoff Grosenbach that
limits the loading of this plugin to development mode only. Geoff notes
that this “simplifies the backtrace when running tests”. Thanks Geoff.

What do you think of this further restriction in init.rb:

enable only on Macs in development mode

begin
if (ENV[‘RAILS_ENV’] == ‘development’) && (uname.chomp == “Darwin”)
require ‘textmate_backtracer’
end
end

Jonathan


#7

On 12-feb-2006, at 3:59, dima exe wrote:

  1. Create registry key structure
    HKEY_CLASSES_ROOT
    txmt
    ---- (Default) = “URL:TXMT Protocol”
    ---- URL Protocol = “”
    ---- shell
    ------ open
    -------- command
    ---------- (Default) = “cscript /H:WScript /nologo
    <path_to_emacs_bin_direcory>\txmt.js %1”

That kind of stuff makes me hold my breath, really.


Julian ‘Julik’ Tarkhanov
me at julik.nl


#8

On Feb 11, 2006, at 3:34 PM, Pat M. wrote:

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/
action_controller/templates/rescues/layout.rhtml
(500 Internal Error)". Could that be the problem? I get that error
during an exception even without the plugin installed though.

Pat

Sorry, Pat. I’m really not sure what’s going on there. I wish I
could help more.

Duane J.
(canadaduane)
http://blog.inquirylabs.com/


#9

On Feb 16, 2006, at 11:31 AM, Jonathan W. wrote:

begin
if (ENV[‘RAILS_ENV’] == ‘development’) && (uname.chomp ==
“Darwin”)
require ‘textmate_backtracer’
end
end

Jonathan

Cool idea, Jonathan. Up until your suggestion, I’ve had to add the
backtracer manually to each of my team projects, being careful not to
add it to subversion lest other (non-mac, non-textmate) users should
suffer unduely. This would be a “smart” way to sneak it in to
version control… :slight_smile:

If no one has any objections, I’ll add that in.

I wonder if there’s any way to check for TextMate on Rails boot-up?

Duane J.
(canadaduane)
http://blog.inquirylabs.com/


#10

Sheesh, I hadn’t even considered that. Yes, please do add it in.