Class: RuboCop::Cop::SketchupRequirements::Exit
- Inherits:
-
SketchUp::Cop
- Object
- SketchUp::WorkaroundCop
- SketchUp::Cop
- RuboCop::Cop::SketchupRequirements::Exit
- Includes:
- SketchUp::NoCommentDisable
- Defined in:
- lib/rubocop/sketchup/cop/requirements/exit.rb
Overview
Don’t attempt to kill the Ruby interpreter by calling ‘exit` or `exit!`. SketchUp will trap `exit` and prevent that, with a message in the console. But `exit!` is not trapped and will terminate SketchUp without shutting down cleanly.
Use ‘return`, `next`, `break` or `raise` instead.
Constant Summary collapse
- MSG =
'`exit` attempts to kill the Ruby interpreter. Use `return`, '\ '`next`, `break` or `raise` instead.'
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
Instance Method Details
#on_send(node) ⇒ Object
24 25 26 27 28 |
# File 'lib/rubocop/sketchup/cop/requirements/exit.rb', line 24 def on_send(node) return unless exit?(node) add_offense(node, location: :selector) end |