Sha256: 01c223adb7c68b8ce2faf74f7d39dfd8a2783bac0ee53c1dcff625b05b4971f2

Contents?: true

Size: 572 Bytes

Versions: 1

Compression:

Stored size: 572 Bytes

Contents

# frozen_string_literal: true

module Vernacular
  # Builds a hash out of the given modifiers that represents that current state
  # of configuration. This ensures that if the configuration of `Vernacular`
  # changes between runs it doesn't pick up the old compiled files.
  class ConfigurationHash
    attr_reader :modifiers

    def initialize(modifiers = [])
      @modifiers = modifiers
    end

    def hash
      digest = Digest::MD5.new
      modifiers.each do |modifier|
        digest << modifier.components.inspect
      end
      digest.to_s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vernacular-1.0.0 lib/vernacular/configuration_hash.rb