Skip to content

Instantly share code, notes, and snippets.

@yellow5
Created October 15, 2011 21:42
Show Gist options
  • Save yellow5/1290190 to your computer and use it in GitHub Desktop.
Save yellow5/1290190 to your computer and use it in GitHub Desktop.
ruby debugger examples
class Buggy
# assuming perform_operation and special_options exist...
def buggy_method(param=nil, options={})
puts "\n\n\nDEBUG"
puts "param: #{param}"
puts "options: #{options}"
@instance_var = perform_operation(special_options(param, options))
end
end
class Buggy
# assuming perform_operation and special_options exist...
def buggy_method(param=nil, options={})
require 'ruby-debug'; debugger
@instance_var = perform_operation(special_options(param, options))
end
end
# Using MRI-1.9.2
gem install ruby-debug19
# Using MRI-1.8.7 or Ruby Enterprise Edition
gem install ruby-debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment