-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equality check warning in Ruby 2.2.2 #157
Comments
There seems to be a similar issue here - https://github.com/RubyMoney/money/pull/470/files |
Hello, thanks for reporting these warnings. I have tried with
and require 'rufus-scheduler'
s = Rufus::Scheduler.new
s.every '2s' do
p Time.now.to_f
end
s.join But I get no warning (yes, the lines you pinpointed above are interpreted). When I turn on
Nothing related to Comparable or <=>. If I look at the lines your warnings pinpointed above, they compare an instance of Time (or NilClass) with nil. Could it be that your project tweaks the Time class (or the NilClass)? Are you able to reproduce those warnings with only my test script above and your Ruby 2.2.2 (what patch level and what OS btw)? |
Hi. Thanks for writing back. I ran all of the above on Ubuntu 14.04 inside VMware workstation The script I was trying this on was a simple rails app -- It was akin to a "hello world" program. Just a single controller that displays some text. I didn't include any Time modules etc. . .I first ran this on my terminal using ruby 1.9.3 and got the rufus-scheduler working as expected.... Then I switched over to ruby 2.2.2 on the same machine (using rvm -- by default i use ruby 2; i don't know why exactly my terminal in the first case above was using ruby 1.9.3 -- maybe I set it up for playing around and forgot about it..) Anyways, I google around a bit and found the above mentioned references. The RubyMoney module also has the exact same warning on ruby2. And since this warning was because of code within rufus itself, I thought it would be worth reporting here. I can run your test case on Monday morning since all this is on my work computer and I can't access it right now. I'm a student and I'm new to ruby & rails. If possible I'd like to help contribute to rufus. I appreciate any suggestions you have for me. Thanks! EDIT: I will submit my code snippet on Monday as well. I forgot to include it with the issue above |
OK, waiting for Monday. Have a nice week-end! |
Hello, OK, so closing the issue rufus-scheduler wise. Next step for you is to try a simple Rails application (no extra gem, no rufus-scheduler) on that same Ruby 2.2.2. The issue can probably be reproduced with a simple Time.now == nil You'll probably hit one of those: https://github.com/rails/rails/search?q=Comparable&type=Issues&utf8=%E2%9C%93 Good luck, best regards. |
The text was updated successfully, but these errors were encountered: