Class: RuboCop::Cop::SketchupSuggestions::Sleep

Inherits:
SketchUp::Cop show all
Defined in:
lib/rubocop/sketchup/cop/suggestions/sleep.rb

Overview

Avoid kernel ‘sleep` as it freezes up SketchUp. Prefer `UI.start_timer` or a callback from the resource you are waiting for.

Constant Summary collapse

MSG =
'`sleep` freezes up SketchUp. Prefer `UI.start_timer` or a ' \
'callback for the resource you are waiting for.'

Constants inherited from SketchUp::Cop

SketchUp::Cop::SKETCHUP_DEPARTMENT_SEVERITY

Constants included from SketchUp::Config

SketchUp::Config::DEFAULT_CONFIGURATION

Instance Method Summary collapse

Methods inherited from SketchUp::Cop

inherited, #relevant_file?

Instance Method Details

#on_send(node) ⇒ Object



17
18
19
20
21
# File 'lib/rubocop/sketchup/cop/suggestions/sleep.rb', line 17

def on_send(node)
  return unless sleep?(node)

  add_offense(node, message: MSG)
end