Posts Tagged ‘Ruby’

Quick Ruby Debugging from TextMate

Tuesday, December 22nd, 2009

No, this TextMate plugin I just wrote does not let you debug your Ruby program directly inside TextMate. However, it does open a full-screen Terminal with rdebug when you hit Command-D in your Ruby file.

Check it out. Download and double-click to install.

Here’s the source for the bundle command:

#!/usr/bin/env ruby
# This plugin is governed by the MIT license, available at http://www.opensource.org/licenses/mit-license.php
# Andrew Janssen, http://sardiusgroup.com

dir_name = File.dirname(ENV['TM_FILEPATH'])

system "osascript -e \'tell application \"Terminal\"
do script \"cd '#{dir_name}'; rdebug #{ENV['TM_FILEPATH']};exit;\"
activate

-- If you want to change the style of the new debug window....
-- Change the index to get different styles.
-- set current settings of first window to settings set 1

-- If you want to put the window somewhere specific...
-- set the bounds of the first window to {431, 20, 1502, 1056}

-- ... otherwise this makes it full-screen.
set zoomed of first window to true
end tell\'"