Sha256: 2c85da348b5b84d1e4caf8e50045df4d04d595fd3997ee489d466faed0f3d178

Contents?: true

Size: 541 Bytes

Versions: 5

Compression:

Stored size: 541 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
vernacular-0.1.2 lib/vernacular/configuration_hash.rb
vernacular-0.1.1 lib/vernacular/configuration_hash.rb
vernacular-0.1.0 lib/vernacular/configuration_hash.rb
vernacular-0.0.2 lib/vernacular/configuration_hash.rb
vernacular-0.0.1 lib/vernacular/configuration_hash.rb