class Mona::Package::Builder include Mona::Mixins Inject = Mona::Deps[ "package.find_root", "package.factory" ] include Inject sig do params( package_path: String, project_root: String, package_dirname: String ) .returns(Mona::Package) end def call(package_path, project_root, package_dirname) package_root_path = find_root.call(package_path, project_root) package_file_path = "#{package_root_path}/#{Mona::PACKAGE_FILENAME}" package_init_proc = proc { instance_eval(File.read(package_file_path)) } package = factory.call(package_root_path, package_dirname, init_proc: package_init_proc) end end