Commit d63ab460ccf0187b7100d5a61a3f8ac74ab59305

fixed breakages from the cleanup attempt of some pretty-hideous code.

Commit diff

Commands/Debug Experiment RSpec.tmCommand

 
66 <string>nop</string>
77 <key>command</key>
88 <string>#!/usr/bin/env ruby
9require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/spec_debugger"
9require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/rdebug_helpers.rb"
1010
1111debug_rspec(:file)</string>
1212 <key>fallbackInput</key>
toggle raw diff

Commands/RSpec - run and breakpoint at current line (current examples).tmCommand

 
66 <string>nop</string>
77 <key>command</key>
88 <string>#!/usr/bin/env ruby
9require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/spec_debugger"
9require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/rdebug_helpers.rb"
1010
1111debug_rspec(:focussed)</string>
1212 <key>fallbackInput</key>
toggle raw diff

Commands/Run server in debug mode.tmCommand

 
2121 init_debug_run_file("load '#{merb_path}'")
2222end
2323
24launch_dbg_controller(0.25)
2425launch_dbg_instance
2526
26launch_dbg_controller(0.25)
27
2728</string>
2829 <key>input</key>
2930 <string>selection</string>
toggle raw diff

Support/lib/rdebug_helpers.rb

 
2222 end
2323end
2424
25def launch_dbg_controller(seconds_to_wait)
25def launch_dbg_controller(seconds_to_wait = 0.01)
2626 Thread.new {
2727 sleep seconds_to_wait;
2828
3333 }
3434end
3535
36def 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
42end
43
3644def debug_rspec(focussed_or_file = :file)
3745 raise "Invalid argument" unless %w[focussed file].include?(focussed_or_file.to_s)
3846
5858 load 'rdebug'
5959end
6060
61
6261def cleanup_dbg
6362 FileUtils.rm_f(RUN_FILE)
6463end
toggle raw diff

Support/lib/spec_debugger.rb

 
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
6require 'rubygems'
7gem 'ruby-debug'
toggle raw diff