lib/cookstyle.rb in cookstyle-6.16.10 vs lib/cookstyle.rb in cookstyle-6.17.5
- old
+ new
@@ -17,11 +17,11 @@
module RuboCop
class ConfigLoader
RUBOCOP_HOME.gsub!(
/^.*$/,
- File.realpath(File.join(File.dirname(__FILE__), '..'))
+ File.realpath(File.join(__dir__, '..'))
)
DEFAULT_FILE.gsub!(
/^.*$/,
File.join(RUBOCOP_HOME, 'config', 'default.yml')
@@ -44,10 +44,10 @@
require_relative 'rubocop/chef/platform_helpers'
require_relative 'rubocop/chef/cookbook_only'
require_relative 'rubocop/cop/target_chef_version'
# Chef Infra specific cops
-Dir.glob(File.dirname(__FILE__) + '/rubocop/cop/chef/**/*.rb') do |file|
+Dir.glob(__dir__ + '/rubocop/cop/chef/**/*.rb') do |file|
next if File.directory?(file)
require_relative file # not actually relative but require_relative is faster
end