Created
October 15, 2011 21:42
-
-
Save yellow5/1290190 to your computer and use it in GitHub Desktop.
ruby debugger examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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