Use Timeout.timeout instead of Object#timeout#262
Use Timeout.timeout instead of Object#timeout#262mishina2228 wants to merge 1 commit intomojombo:masterfrom
Conversation
This change suppresses the following warning: ``` warning: Object#timeout is deprecated, use Timeout.timeout instead. ```
|
|
|
% docker run --rm -ti ruby:3.0.2
irb(main):001:0> RUBY_VERSION
=> "3.0.2"
irb(main):002:0> timeout(1) {}
(irb):2: warning: Object#timeout is deprecated, use Timeout.timeout instead.
=> nil
irb(main):003:0> But if timeout gem is updated to 0.2.0 or later % docker run --rm -ti ruby:3.0.2 /bin/bash
root@f74035cc99bc:/# gem install timeout
Fetching timeout-0.3.0.gem
Successfully installed timeout-0.3.0
1 gem installed
root@f74035cc99bc:/# irb
irb(main):001:0> RUBY_VERSION
=> "3.0.2"
irb(main):002:0> timeout(1) {}
(irb):2:in `<main>': undefined method `timeout' for main:Object (NoMethodError)
from /usr/local/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
from /usr/local/bin/irb:23:in `load'
from /usr/local/bin/irb:23:in `<main>'
irb(main):003:0> @mishina2228 Did you update timeout gem? Anyway, to run god with ruby 3.1+, this PR is necessary. |
|
@minimum2scp Ah, you're right! I was using Thanks for pointing out and explaining in detail! |
|
+1 on needing this |
|
+1 as its a need now |
|
+1 as it's needed now |
|
A forked version of this gem has been released, resurrected_god, with homepage https://github.com/mishina2228/resurrected_god. It's a drop-in replacement for god which includes this fix and supports ruby 3.1. |

Fix #263.
This change suppresses the following warning on Ruby 2.7: