ruby-on-rails - ruby 调试 : Skip Rails Code

标签 ruby-on-rails ruby debugging skip

在单步执行 Rails 中的 Ruby 调试器时,如何让它只在我编写的代码处停止,而跳过所有 native Rails 代码?

(即跳过所有看起来像这样的代码)

/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}

谢谢!

最佳答案

我想你要找的是类似 this 的东西如果我理解你的问题是对的。 如果您使用 rails 方法而不进入 rails 代码,那么您将想要跳过而不是进入。我希望这对您有所帮助,祝您好运。

关于ruby-on-rails - ruby 调试 : Skip Rails Code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9913010/

相关文章:

ruby-on-rails - Rails & Redcarpet:在 ApplicationHelper 中使用时未初始化的常量 Redcarpet::Render

ruby-on-rails - 如何创建没有密码的用户并稍后使用 Devise 表单进行设置?

ruby-on-rails - Bundler - 无法加载完全相同的 gem 的 2 个不同版本?

ruby-on-rails - 在 Ruby on Rails 中使用 like 查询进行搜索

.net - 获取AppDomain用于另一个.NET框架过程

c++ - 未找到 : You need to find "" to view the source for the current call stack frame

ruby-on-rails - 使用 Heroku 推荐的 Unicorn 配置时出现错误 R12(退出超时)

ruby-on-rails - 在 ubuntu 上以 root 身份运行的延迟作业进程

ruby - 具有类继承的错误未初始化常量

C# 二叉搜索树 - 堆栈溢出 - 调试