From bcd68d4691e7b2f6d56e0ab92b591c14d7a26a48 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 24 Oct 2020 05:05:26 -0400 Subject: Re-named "search" to "one" and "search-all" to "all". --- stdlib/source/program/aedifex/artifact.lux | 48 ++++++++++++++++++------------ 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'stdlib/source/program/aedifex/artifact.lux') diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux index 47a9027d0..dc0892eb1 100644 --- a/stdlib/source/program/aedifex/artifact.lux +++ b/stdlib/source/program/aedifex/artifact.lux @@ -5,7 +5,7 @@ ["." hash (#+ Hash)]] [data ["." text - ["%" format (#+ format)]] + ["%" format (#+ Format)]] [collection ["." list ("#@." monoid)]]] [world @@ -42,31 +42,41 @@ text.hash )) -(def: group-separator - ".") +(template [ ] + [(def: + Text + )] -(def: version-separator - "-") + ["." group-separator] + ["-" version-separator] + [":" identity-separator] + ) (def: #export (identity artifact) (-> Artifact Text) - (format (get@ #name artifact) - ..version-separator - (get@ #version artifact))) + (%.format (get@ #name artifact) + ..version-separator + (get@ #version artifact))) + +(def: #export (format value) + (Format Artifact) + (%.format (get@ #group value) + ..identity-separator + (..identity value))) (def: #export (path artifact) (-> Artifact Text) - (let [directory (format (|> artifact - (get@ #group) - (text.split-all-with ..group-separator) - (text.join-with uri.separator)) - uri.separator - (get@ #name artifact) - uri.separator - (get@ #version artifact))] - (format directory - uri.separator - (..identity artifact)))) + (let [directory (%.format (|> artifact + (get@ #group) + (text.split-all-with ..group-separator) + (text.join-with uri.separator)) + uri.separator + (get@ #name artifact) + uri.separator + (get@ #version artifact))] + (%.format directory + uri.separator + (..identity artifact)))) (def: #export (local artifact) (-> Artifact (List Text)) -- cgit v1.2.3