module Sprockets::Configuration
def digest_class=(klass)
environment.digest_class = Digest::MD5
`Digest::MD5`.
`Digest::` implementation such as `Digest::SHA1` or
Assign a `Digest` implementation class. This maybe any Ruby
def digest_class=(klass) @digest_class = klass end
def initialize_configuration(parent)
def initialize_configuration(parent) @logger = parent.logger @version = parent.version @digest_class = parent.digest_class @context_class = Class.new(parent.context_class) @root = parent.root @paths = parent.paths @mime_types = parent.mime_types @mime_exts = parent.mime_exts @encodings = parent.encodings @engines = parent.engines @engine_mime_types = parent.engine_mime_types @transformers = parent.transformers @preprocessors = parent.preprocessors @postprocessors = parent.postprocessors @bundle_reducers = parent.bundle_reducers @bundle_processors = parent.bundle_processors @compressors = parent.compressors end
def mutate_config(sym)
def mutate_config(sym) obj = yield self.instance_variable_get("@#{sym}").dup self.instance_variable_set("@#{sym}", obj.freeze) end
def mutate_hash_config(sym, key)
def mutate_hash_config(sym, key) mutate_config(sym) do |hash| obj = yield hash[key].dup hash[key] = obj.freeze hash end end
def version=(version)
environment.version = '2.0'
Assign an environment version.
def version=(version) mutate_config(:version) { version.dup } end