From 1fa8c0972b6a71669e19151ebb3589fd6b53129e Mon Sep 17 00:00:00 2001 From: David Bailey Date: Fri, 14 Apr 2023 10:25:53 +0200 Subject: [PATCH] docs: :memo: Properly document craft_artefact --- lib/comfpile/core.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/comfpile/core.rb b/lib/comfpile/core.rb index f946511..5832d81 100644 --- a/lib/comfpile/core.rb +++ b/lib/comfpile/core.rb @@ -21,6 +21,21 @@ module Comfpile @artefacts.dig(stage, file) end + # Create or find a new artefact. + # + # This will first see if a given artefact matching + # the stage and target descriptions already exists, and + # will return it, if found. Otherwise it will + # consult all given artefact crafting engines to + # see if a new artefact can be created, which will be returned. + # + # If no artefact can be made, nil is returned + # + # @param [Symbol, String] stage State that shall be created (e.g. :parsed, :compiled, etc.) + # @param [String] file File or other target that shall be looked at (e.g. "main.cpp") + # + # @return [Comfpile::Artefact, nil] Found or created artefact, or nil if nothing could be done + # def craft_artefact(stage, file = :none) artefact = find_artefact(stage, file)