class Sprockets::CachedEnvironment
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/sprockets/cached_environment.rbs class Sprockets::CachedEnvironment < Sprockets::Base def cached: () -> Sprockets::CachedEnvironment def entries: (String path) -> Array[String] def initialize: (Sprockets::Environment environment) -> void def load: (String uri) -> Sprockets::Asset def processor_cache_key: ((Sprockets::DirectiveProcessor | Sprockets::Preprocessors::DefaultSourceMap | Class) processor, (Class | Sprockets::Preprocessors::DefaultSourceMap | Sprockets::DirectiveProcessor) str) -> nil type Sprockets__CachedEnvironment_resolve_dependency_return_value = nil | String | Array[] | Array[String] | Array[NilClass] def resolve_dependency: (String str) -> Sprockets__CachedEnvironment_resolve_dependency_return_value def stat: (String path) -> File::Stat? end
‘Environment#cached`.
`CachedEnvironment` should not be initialized directly. Instead use
is immutable.
behavior is ideal in production environments where the file system
for the instances lifetime. This makes `CachedEnvironment` much faster. This
The exception is that all of its file system methods are cached
`CachedEnvironment` is a special cached version of `Environment`.
def cached
Experimental RBS support (using type sampling data from the type_fusion
project).
def cached: () -> Sprockets::CachedEnvironment
This signature was generated using 1 sample from 1 application.
def cached self end
def config=(config)
Cache is immutable, any methods that try to change the runtime config
def config=(config) raise RuntimeError, "can't modify immutable cached environment" end
def entries(path)
Experimental RBS support (using type sampling data from the type_fusion
project).
def entries: (String path) -> (String | String | )
This signature was generated using 38 samples from 3 applications.
def entries(path) @entries.fetch_or_store(path) { super(path) } end
def initialize(environment)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (Sprockets::Environment environment) -> void
This signature was generated using 4 samples from 3 applications.
def initialize(environment) initialize_configuration(environment) @cache = environment.cache @stats = Concurrent::Map.new @entries = Concurrent::Map.new @uris = Concurrent::Map.new @processor_cache_keys = Concurrent::Map.new @resolved_dependencies = Concurrent::Map.new end
def load(uri)
Experimental RBS support (using type sampling data from the type_fusion
project).
def load: (String uri) -> Sprockets::Asset
This signature was generated using 48 samples from 5 applications.
def load(uri) @uris.fetch_or_store(uri) { super(uri) } end
def processor_cache_key(str)
Experimental RBS support (using type sampling data from the type_fusion
project).
def processor_cache_key: ((Sprockets::DirectiveProcessor | Sprockets::Preprocessors::DefaultSourceMap | Class) processor, (Class | Sprockets::Preprocessors::DefaultSourceMap | Sprockets::DirectiveProcessor) str) -> nil
This signature was generated using 17 samples from 4 applications.
def processor_cache_key(str) @processor_cache_keys.fetch_or_store(str) { super(str) } end
def resolve_dependency(str)
Experimental RBS support (using type sampling data from the type_fusion
project).
type Sprockets__CachedEnvironment_resolve_dependency_return_value = nil | String | Array[] | Array[String] | Array[NilClass] type Sprockets__CachedEnvironment_resolve_dependency_return_value = nil | String | | String | String | String | String | String | String | String | String | String | String | String | String | NilClass | NilClass | NilClass def resolve_dependency: (String str) -> Sprockets__CachedEnvironment_resolve_dependency_return_value
This signature was generated using 99 samples from 6 applications.
def resolve_dependency(str) @resolved_dependencies.fetch_or_store(str) { super(str) } end
def stat(path)
Experimental RBS support (using type sampling data from the type_fusion
project).
def stat: (String path) -> File::Stat?
This signature was generated using 187 samples from 6 applications.
def stat(path) @stats.fetch_or_store(path) { super(path) } end