class RuboCop::Cop::SketchupSuggestions::SketchupFindSupportFile
Avoid `Sketchup.find_support_file` to find your extension's files.
Users might install your extension to locations other than the default Plugins directory. If you use `Sketchup.find_support_file` to build a path for files in your extension it will fail in these scenarios.
Instead prefer to use `__FILE__` or `__dir__` to build paths relative to your source files. This have the added benefit of allowing you to load your extensions directly from external directories under version control.
Constants
- MSG
Public Instance Methods
on_send(node)
click to toggle source
# File lib/rubocop/sketchup/cop/suggestions/sketchup_find_support_file.rb, line 30 def on_send(node) return unless sketchup_find_support_file?(node) add_offense(node, location: :expression) end