From 73a79b30fb11df1867dffca8c2485aed0e06a837 Mon Sep 17 00:00:00 2001 From: Teppei Shintani Date: Sat, 6 Jan 2024 11:24:29 +0900 Subject: [PATCH] Require parser class in advance --- lib/packwerk/file_parser.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/packwerk/file_parser.rb b/lib/packwerk/file_parser.rb index c0b985787..e376b5b5f 100644 --- a/lib/packwerk/file_parser.rb +++ b/lib/packwerk/file_parser.rb @@ -19,6 +19,9 @@ def self.included(base) sig { returns(T::Array[FileParser]) } def self.all + # Require each parser class in advance because it cannot be obtained unless it is required. + Dir[File.join(__dir__, "parsers", "*.rb")].each { |file| require file } + T.unsafe(@parsers).map(&:new) end