lib/packwerk/package.rb in packwerk-2.0.0 vs lib/packwerk/package.rb in packwerk-2.1.0
- old
+ new
@@ -19,10 +19,11 @@
sig { params(name: String, config: T.nilable(T.any(T::Hash[T.untyped, T.untyped], FalseClass))).void }
def initialize(name:, config:)
@name = name
@config = T.let(config || {}, T::Hash[T.untyped, T.untyped])
@dependencies = T.let(Array(@config["dependencies"]).freeze, T::Array[String])
+ @public_path = T.let(nil, T.nilable(String))
end
sig { returns(T.nilable(T.any(T::Boolean, T::Array[String]))) }
def enforce_privacy
@config["enforce_privacy"]
@@ -44,10 +45,9 @@
path.start_with?(@name)
end
sig { returns(String) }
def public_path
- @public_path = T.let(@public_path, T.nilable(String))
@public_path ||= begin
unprefixed_public_path = user_defined_public_path || "app/public/"
if root?
unprefixed_public_path