module Sprockets::Dependencies

def add_dependency(uri)

Returns nothing.

uri - String dependency URI

Public: Add environmental dependency inheirted by all assets.
def add_dependency(uri)
  self.config = hash_reassoc(config, :dependencies) do |set|
    set + Set.new([uri])
  end
end

def dependencies

Returns Set of String URIs.

Public: Default set of dependency URIs for assets.
def dependencies
  config[:dependencies]
end

def dependency_resolvers

Returns Hash.

value - Proc.call(Environment, String)
key - String scheme

Public: Mapping dependency schemes to resolver functions.
def dependency_resolvers
  config[:dependency_resolvers]
end

def register_dependency_resolver(scheme, &block)

Returns nothing.

uri - String dependency URI
environment - Environment
block -
scheme - String scheme

Public: Register new dependency URI resolver.
def register_dependency_resolver(scheme, &block)
  self.config = hash_reassoc(config, :dependency_resolvers) do |hash|
    hash.merge(scheme => block)
  end
end

def resolve_dependencies(uris)

Returns Array of resolved Objects.

Internal: Resolve set of dependency URIs.
def resolve_dependencies(uris)
  uris.map { |uri| resolve_dependency(uri) }
end

def resolve_dependency(str)

Returns resolved Object.

Internal: Resolve dependency URIs.
def resolve_dependency(str)
  scheme = str[/([^:]+)/, 1]
  if resolver = dependency_resolvers[scheme]
    resolver.call(self, str)
  else
    raise TypeError, "unknown cache scheme: #{scheme}"
  end
end