lib/packwerk/package.rb in packwerk-2.2.0 vs lib/packwerk/package.rb in packwerk-2.2.1
- old
+ new
@@ -11,10 +11,11 @@
ROOT_PACKAGE_NAME = "."
sig { returns(String) }
attr_reader :name
+
sig { returns(T::Array[String]) }
attr_reader :dependencies
sig { params(name: String, config: T.nilable(T.any(T::Hash[T.untyped, T.untyped], FalseClass))).void }
def initialize(name:, config:)
@@ -40,10 +41,11 @@
end
sig { params(path: String).returns(T::Boolean) }
def package_path?(path)
return true if root?
+
path.start_with?(@name)
end
sig { returns(String) }
def public_path
@@ -72,9 +74,10 @@
end
sig { params(other: T.untyped).returns(T.nilable(Integer)) }
def <=>(other)
return nil unless other.is_a?(self.class)
+
name <=> other.name
end
sig { params(other: T.untyped).returns(T::Boolean) }
def eql?(other)