Sha256: b4f0a561548505f13ba81061f69f1d3cab5c28835d848bfb9f60cc3a6cd5433a

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

# 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

    def auto_correct!
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neeto-compliance-1.0.58 lib/neeto_compliance/verifiers/webpacker_config_verifier.rb