
Now we only include the cachable registry when running tests. We basically just load it first and add a bunch of methods to it before loading the rest of the formula files when we require global.rb. I added a check to make sure this require order is preserved. I also made a bunch of methods private, stop excluding classes that inherit from casks since it's unnecessary and add more docs.
15 lines
257 B
Ruby
15 lines
257 B
Ruby
# typed: strict
|
|
# frozen_string_literal: true
|
|
|
|
module Cachable
|
|
sig { returns(T::Hash[T.untyped, T.untyped]) }
|
|
def cache
|
|
@cache ||= T.let({}, T.nilable(T::Hash[T.untyped, T.untyped]))
|
|
end
|
|
|
|
sig { void }
|
|
def clear_cache
|
|
cache.clear
|
|
end
|
|
end
|