ruby-on-rails 调试 redmine
我正在使用以下设置
Windows 7 、 netbeans 7.0.1 、 ruby 1.8.7 、 Rails 2.3.14 、 redmine 1.2.2 、 ruby-debug-ide 0.4.16 、 mongrel 1.1.5
我尝试做一些非常简单的事情我的调试器似乎有问题...
我有一个插件,我想替换 Issue did_ratio getter(我的示例代码对于演示来说非常简单)。
当我第一次运行代码时,我确实得到了正确的值 (50)。
然后我将值更改为其他值,刷新页面 - 并再次获得 50... 使用调试器时,我所做的更改似乎没有影响,并且手表显示与以前相同的值...
Dispatch.to_prepare 在每个请求上运行...
有没有办法让它在不重新启动应用程序的情况下工作?
这是我的代码:
module RedmineDoneRatioFix
module IssuePatch
def self.included(base)
base.class_eval do
def done_ratio
50
end
end
end
end
end
init.rb:
Dispatcher.to_prepare do
require_dependency 'issue'
Issue.send(:include, RedmineDoneRatioFix::IssuePatch)
end
I'm using the following setup
Windows 7 , netbeans 7.0.1 , ruby 1.8.7 , rails 2.3.14 , redmine 1.2.2 , ruby-debug-ide 0.4.16 , mongrel 1.1.5
I try to do something very simple and I seem to have a problem with the debugger...
I have a plugin and I want to replace the the Issue done_ratio getter (my example code is Very simple for the demonstration).
When I first run the code I do get the right value (50).
Then I change the value to something else , refresh the page - and get 50 again...
When using the debugger it seems that the changes I made have no influence and the watches show the same value as before...
The dispatch.to_prepare in run on every request...
Is there no way to make it work without restarting the application?
This is my code:
module RedmineDoneRatioFix
module IssuePatch
def self.included(base)
base.class_eval do
def done_ratio
50
end
end
end
end
end
init.rb:
Dispatcher.to_prepare do
require_dependency 'issue'
Issue.send(:include, RedmineDoneRatioFix::IssuePatch)
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加 unloadable 解决了这个问题:
Adding unloadable solved it: