class Mona::Package::Indexer include Mona::Mixins Inject = Mona::Deps[ "package.builder", ] include Inject sig do params( packages_lookup_subdir: String, project_root: String, package_dirname: String ) .returns(T::Array[Mona::Package]) end def call(packages_lookup_subdir, project_root, package_dirname) packages_path = File.join( project_root, packages_lookup_subdir, "**", Mona::PACKAGE_FILENAME ) Dir[packages_path].map do |package_file_path| builder.call(package_file_path, project_root, package_dirname) end end end