Class: RuboCop::Cop::Chef::Correctness::ScopedFileExist
- Extended by:
- AutoCorrector
- Defined in:
- lib/rubocop/cop/chef/correctness/scoped_file_exist.rb
Overview
Scope file exist to access the correct ‘File` class by using `::File.exist?` not `File.exist?`.
Constant Summary collapse
- MSG =
'Scope file exist to access the correct File class by using ::File.exist? not File.exist?.'
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_block(node) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/rubocop/cop/chef/correctness/scoped_file_exist.rb', line 41 def on_block(node) unscoped_file_exist?(node) do |m| add_offense(m, severity: :refactor) do |corrector| corrector.replace(m, '::File') end end end |