lib/chefstyle.rb in chefstyle-1.3.2 vs lib/chefstyle.rb in chefstyle-1.4.0

- old
+ new

@@ -3,15 +3,18 @@ # ensure the desired target version of RuboCop is gem activated gem "rubocop", "= #{Chefstyle::RUBOCOP_VERSION}" require "rubocop" +# @TODO remove this monkeypatch after we upgrade from 0.91.0 +require_relative "rubocop/monkey_patches/rescue_ensure_alignment" + 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") @@ -29,10 +32,10 @@ end require_relative "rubocop/chef" # Chef custom 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