Class: RuboCop::Cop::Ezcater::RubyTimeout
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Ezcater::RubyTimeout
- Defined in:
- lib/rubocop/cop/ezcater/ruby_timeout.rb
Overview
Don’t use Timeout.timeout because it can cause transient errors
Constant Summary collapse
- MSG =
"`Timeout.timeout` is unsafe. Find an alternative to achieve the same goal.\n Ex. Use the timeout capabilities of a networking library.\n Ex. Iterate and check runtime after each iteration.\n".split("\n").join(" ")
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
31 32 33 34 35 |
# File 'lib/rubocop/cop/ezcater/ruby_timeout.rb', line 31 def on_send(node) timeout(node) do add_offense(node.loc.expression, message: MSG) end end |