# frozen_string_literal: true module NeetoCompliance class WebpackerConfigVerifier < Base def local_copy "config/webpacker.yml" end def commons_copy NeetoCompliance::NeetoCommons.path.join "common_files/webpacker.yml" end def compare_files @file_difference = `diff #{commons_copy} #{local_copy} | grep '<'` end def valid? compare_files @file_difference.empty? end def autofix_suggestion warning = "Following configuration lines are missing in webpacker config (config/webpacker.yml). Please refer #{commons_copy}" .yellow missing_lines = @file_difference.delete("<").red "#{warning}\n\n#{missing_lines}" end end end