Commit d63ab460ccf0187b7100d5a61a3f8ac74ab59305
- Date: Sat Mar 29 23:59:33 +0000 2008
- Committer: Tim Harper (timcharper@gmail.com)
- Author: Tim Harper (timcharper@gmail.com)
- Commit SHA1: d63ab460ccf0187b7100d5a61a3f8ac74ab59305
- Tree SHA1: 0d9a00b01f51366d2b6cf961a32771f0b8ebece1
fixed breakages from the cleanup attempt of some pretty-hideous code.
Commit diff
| |   |
| 6 | 6 | <string>nop</string> |
| 7 | 7 | <key>command</key> |
| 8 | 8 | <string>#!/usr/bin/env ruby |
| 9 | | require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/spec_debugger" |
| 9 | require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/rdebug_helpers.rb" |
| 10 | 10 | |
| 11 | 11 | debug_rspec(:file)</string> |
| 12 | 12 | <key>fallbackInput</key> |
| toggle raw diff |
--- a/Commands/Debug Experiment RSpec.tmCommand
+++ b/Commands/Debug Experiment RSpec.tmCommand
@@ -6,7 +6,7 @@
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
-require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/spec_debugger"
+require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/rdebug_helpers.rb"
debug_rspec(:file)</string>
<key>fallbackInput</key> |
| |   |
| 6 | 6 | <string>nop</string> |
| 7 | 7 | <key>command</key> |
| 8 | 8 | <string>#!/usr/bin/env ruby |
| 9 | | require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/spec_debugger" |
| 9 | require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/rdebug_helpers.rb" |
| 10 | 10 | |
| 11 | 11 | debug_rspec(:focussed)</string> |
| 12 | 12 | <key>fallbackInput</key> |
| toggle raw diff |
--- a/Commands/RSpec - run and breakpoint at current line (current examples).tmCommand
+++ b/Commands/RSpec - run and breakpoint at current line (current examples).tmCommand
@@ -6,7 +6,7 @@
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
-require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/spec_debugger"
+require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/rdebug_helpers.rb"
debug_rspec(:focussed)</string>
<key>fallbackInput</key> |
| |   |
| 21 | 21 | init_debug_run_file("load '#{merb_path}'") |
| 22 | 22 | end |
| 23 | 23 | |
| 24 | launch_dbg_controller(0.25) |
| 24 | 25 | launch_dbg_instance |
| 25 | 26 | |
| 26 | | launch_dbg_controller(0.25) |
| 27 | |
| 27 | 28 | </string> |
| 28 | 29 | <key>input</key> |
| 29 | 30 | <string>selection</string> |
| toggle raw diff |
--- a/Commands/Run server in debug mode.tmCommand
+++ b/Commands/Run server in debug mode.tmCommand
@@ -21,9 +21,10 @@ else
init_debug_run_file("load '#{merb_path}'")
end
+launch_dbg_controller(0.25)
launch_dbg_instance
-launch_dbg_controller(0.25)
+
</string>
<key>input</key>
<string>selection</string> |
| |   |
| 22 | 22 | end |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | | def launch_dbg_controller(seconds_to_wait) |
| 25 | def launch_dbg_controller(seconds_to_wait = 0.01) |
| 26 | 26 | Thread.new { |
| 27 | 27 | sleep seconds_to_wait; |
| 28 | 28 | |
| … | … | |
| 33 | 33 | } |
| 34 | 34 | end |
| 35 | 35 | |
| 36 | def launch_dbg_instance |
| 37 | term = Appscript::app("Terminal") |
| 38 | term.activate |
| 39 | term.do_script "cd #{ENV['TM_PROJECT_DIRECTORY'].to_s.inspect} && rdebug -s #{RUN_FILE}; exit" |
| 40 | |
| 41 | sleep 0.25 |
| 42 | end |
| 43 | |
| 36 | 44 | def debug_rspec(focussed_or_file = :file) |
| 37 | 45 | raise "Invalid argument" unless %w[focussed file].include?(focussed_or_file.to_s) |
| 38 | 46 | |
| … | … | |
| 58 | 58 | load 'rdebug' |
| 59 | 59 | end |
| 60 | 60 | |
| 61 | | |
| 62 | 61 | def cleanup_dbg |
| 63 | 62 | FileUtils.rm_f(RUN_FILE) |
| 64 | 63 | end |
| toggle raw diff |
--- a/Support/lib/rdebug_helpers.rb
+++ b/Support/lib/rdebug_helpers.rb
@@ -22,7 +22,7 @@ while Debugger.handler.interface.nil?; sleep 0.10; end
end
end
-def launch_dbg_controller(seconds_to_wait)
+def launch_dbg_controller(seconds_to_wait = 0.01)
Thread.new {
sleep seconds_to_wait;
@@ -33,6 +33,14 @@ def launch_dbg_controller(seconds_to_wait)
}
end
+def launch_dbg_instance
+ term = Appscript::app("Terminal")
+ term.activate
+ term.do_script "cd #{ENV['TM_PROJECT_DIRECTORY'].to_s.inspect} && rdebug -s #{RUN_FILE}; exit"
+
+ sleep 0.25
+end
+
def debug_rspec(focussed_or_file = :file)
raise "Invalid argument" unless %w[focussed file].include?(focussed_or_file.to_s)
@@ -50,7 +58,6 @@ EOF
load 'rdebug'
end
-
def cleanup_dbg
FileUtils.rm_f(RUN_FILE)
end
\ No newline at end of file |
| |   |
| 0 | | # TextMate helpers |
| 1 | | # Adapted from rspec-bundle (multiple contributors, see http://rspec.info/community/) |
| 2 | | # |
| 3 | | # Ruby-debug support added by Tim Harper with Lead Media Partners. |
| 4 | | # http://code.google.com/p/productivity-bundle/ |
| 5 | | |
| 6 | | require 'rubygems' |
| 7 | | gem 'ruby-debug' |
| toggle raw diff |
--- a/Support/lib/spec_debugger.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# TextMate helpers
-# Adapted from rspec-bundle (multiple contributors, see http://rspec.info/community/)
-#
-# Ruby-debug support added by Tim Harper with Lead Media Partners.
-# http://code.google.com/p/productivity-bundle/
-
-require 'rubygems'
-gem 'ruby-debug' |