Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby Debug: Skip Rails Code

When stepping through the Ruby Debugger in Rails, how do I only have it stop only at code that I wrote, skipping over all the native Rails code?

(ie skipping all the code that looks like this)

/Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/core_ext/module/remove_method.rb:4
remove_method(method)
(rdb:1) s
[76, 85] in /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/core_ext/class/attribute.rb
   76          def self.#{name}?() !!#{name} end
   77  
   78          def self.#{name}=(val)
   79            singleton_class.class_eval do
   80              remove_possible_method(:#{name})
=> 81              define_method(:#{name}) { val }
   82            end
   83  
   84            if singleton_class?
   85              class_eval do
/Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/core_ext/class/attribute.rb:81
define_method(:#{name}) { val }
(rdb:1) s
[79, 88] in /Users/jon/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.1/lib/active_support/core_ext/class/attribute.rb
   79            singleton_class.class_eval do
   80              remove_possible_method(:#{name})
   81              define_method(:#{name}) { val }
   82            end
   83  
=> 84            if singleton_class?
   85              class_eval do
   86                remove_possible_method(:#{name})
   87                def #{name}
   88                  defined?(@#{name}) ? @#{name} : singleton_class.#{name}

Thanks!

like image 222
Jonathan Leung Avatar asked Nov 04 '22 02:11

Jonathan Leung


1 Answers

I think what your looking for is something like this if I understand your question right. You'll want to step over rather than step into, that way if your using a method for rails you don't go into the rails code. I hope this helps and good luck.

like image 178
Donavan White Avatar answered Nov 09 '22 16:11

Donavan White