lib/packwerk/node_processor.rb in packwerk-2.2.0 vs lib/packwerk/node_processor.rb in packwerk-2.2.1

- old
+ new

@@ -7,25 +7,26 @@ extend T::Sig sig do params( reference_extractor: ReferenceExtractor, - absolute_file: String, + relative_file: String, ).void end - def initialize(reference_extractor:, absolute_file:) + def initialize(reference_extractor:, relative_file:) @reference_extractor = reference_extractor - @absolute_file = absolute_file + @relative_file = relative_file end sig do params( node: Parser::AST::Node, ancestors: T::Array[Parser::AST::Node] ).returns(T.nilable(UnresolvedReference)) end def call(node, ancestors) - return unless Node.method_call?(node) || Node.constant?(node) - @reference_extractor.reference_from_node(node, ancestors: ancestors, absolute_file: @absolute_file) + return unless NodeHelpers.method_call?(node) || NodeHelpers.constant?(node) + + @reference_extractor.reference_from_node(node, ancestors: ancestors, relative_file: @relative_file) end end end