Skip to content

Instantly share code, notes, and snippets.

@xenda
Forked from adzap/development.rb
Created November 19, 2009 14:26
Show Gist options
  • Save xenda/238796 to your computer and use it in GitHub Desktop.
Save xenda/238796 to your computer and use it in GitHub Desktop.
Restart Task and Debug with ruby-debug
# ... bottom of your development.rb
if File.exists?(File.join(RAILS_ROOT,'tmp', 'debug.txt'))
require 'ruby-debug'
Debugger.wait_connection = true
Debugger.start_remote
File.delete(File.join(RAILS_ROOT,'tmp', 'debug.txt'))
end
# add this rake file to your lib/tasks folder
task :restart do
system("touch tmp/restart.txt")
system("touch tmp/debug.txt") if ENV["DEBUG"] == 'true'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment