diff options
author | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
commit | 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 (patch) | |
tree | 115fab5bd8a5f53dc0d13ce5453095324a83496f /stdlib/source/program/aedifex/metadata | |
parent | f92c806ee8da63f04bbefbf558f6249bacdb47ea (diff) |
De-sigil-ification: suffix : [Part 13]
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/metadata.lux | 12 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/metadata/artifact.lux | 36 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/metadata/snapshot.lux | 18 |
3 files changed, 33 insertions, 33 deletions
diff --git a/stdlib/source/program/aedifex/metadata.lux b/stdlib/source/program/aedifex/metadata.lux index 36e287325..3ba470501 100644 --- a/stdlib/source/program/aedifex/metadata.lux +++ b/stdlib/source/program/aedifex/metadata.lux @@ -11,11 +11,11 @@ ["[0]" // ["[1][0]" artifact (.only Artifact)]]) -(def: remote_file +(def remote_file Path "maven-metadata.xml") -(def: .public (remote_artifact_uri artifact) +(def .public (remote_artifact_uri artifact) (-> Artifact URI) (let [/ uri.separator] (format (//artifact.directory / (the //artifact.#group artifact)) @@ -23,21 +23,21 @@ / (the //artifact.#version artifact) / ..remote_file))) -(def: .public (remote_project_uri artifact) +(def .public (remote_project_uri artifact) (-> Artifact URI) (let [/ uri.separator] (format (//artifact.directory / (the //artifact.#group artifact)) / (the //artifact.#name artifact) / ..remote_file))) -(def: local_file +(def local_file Path "maven-metadata-local.xml") -(def: .public (local_uri remote_uri) +(def .public (local_uri remote_uri) (-> URI URI) (text.replaced_once ..remote_file ..local_file remote_uri)) -(def: .public (remote_uri local_uri) +(def .public (remote_uri local_uri) (-> URI URI) (text.replaced_once ..local_file ..remote_file local_uri)) diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index 0057ce119..01271437e 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -45,32 +45,32 @@ #versions (List Version) #last_updated Instant])) -(def: (pad value) +(def (pad value) (-> Nat Text) (if (n.< 10 value) (%.format "0" (%.nat value)) (%.nat value))) -(def: (date_format value) +(def (date_format value) (%.Format Date) (%.format (|> value date.year year.value .nat %.nat) (|> value date.month month.number ..pad) (|> value date.day_of_month ..pad))) -(def: (time_format value) +(def (time_format value) (%.Format Time) (let [(open "[0]") (time.clock value)] (%.format (..pad #hour) (..pad #minute) (..pad #second)))) -(def: (instant_format value) +(def (instant_format value) (%.Format Instant) (%.format (..date_format (instant.date value)) (..time_format (instant.time value)))) (with_template [<definition> <tag>] - [(def: <definition> xml.Tag ["" <tag>])] + [(def <definition> xml.Tag ["" <tag>])] [<group> "groupId"] [<name> "artifactId"] @@ -82,7 +82,7 @@ ) (with_template [<name> <type> <tag> <pre>] - [(def: <name> + [(def <name> (-> <type> XML) (|>> <pre> {xml.#Text} list {xml.#Node <tag> xml.attributes}))] @@ -92,11 +92,11 @@ [last_updated_format Instant ..<last_updated> ..instant_format] ) -(def: versions_format +(def versions_format (-> (List Version) XML) (|>> (list#each ..version_format) {xml.#Node ..<versions> xml.attributes})) -(def: .public (format value) +(def .public (format value) (-> Metadata XML) {xml.#Node ..<metadata> xml.attributes @@ -107,12 +107,12 @@ (list (..versions_format (the #versions value)) (..last_updated_format (the #last_updated value)))})}) -(def: (text tag) +(def (text tag) (-> xml.Tag (Parser Text)) (<| (<xml>.node tag) <xml>.text)) -(def: date_parser +(def date_parser (<text>.Parser Date) (do <>.monad [year (<>.codec n.decimal (<text>.exactly 4 <text>.decimal)) @@ -122,7 +122,7 @@ day_of_month (<>.codec n.decimal (<text>.exactly 2 <text>.decimal))] (<>.lifted (date.date year month day_of_month)))) -(def: time_parser +(def time_parser (<text>.Parser Time) (do <>.monad [hour (<>.codec n.decimal (<text>.exactly 2 <text>.decimal)) @@ -134,7 +134,7 @@ time.#second second time.#milli_second 0])))) -(def: last_updated_parser +(def last_updated_parser (Parser Instant) (<text>.then (do <>.monad [date ..date_parser @@ -142,7 +142,7 @@ (in (instant.of_date_time date time))) (..text ..<last_updated>))) -(def: .public parser +(def .public parser (Parser Metadata) (<| (<xml>.node ..<metadata>) (all <>.and @@ -158,7 +158,7 @@ (<xml>.somewhere ..last_updated_parser) ))))) -(def: .public equivalence +(def .public equivalence (Equivalence Metadata) (all product.equivalence text.equivalence @@ -167,15 +167,15 @@ instant.equivalence )) -(def: .public uri +(def .public uri (-> Artifact URI) //.remote_project_uri) -(def: epoch +(def epoch Instant (instant.of_millis +0)) -(def: .public (read repository artifact) +(def .public (read repository artifact) (-> (Repository Async) Artifact (Async (Try Metadata))) (do async.monad [project (at repository download (..uri artifact))] @@ -195,7 +195,7 @@ ..#versions (list) ..#last_updated ..epoch])})))) -(def: .public (write repository artifact metadata) +(def .public (write repository artifact metadata) (-> (Repository Async) Artifact Metadata (Async (Try Any))) (|> metadata ..format diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index 7645b556b..4479fe244 100644 --- a/stdlib/source/program/aedifex/metadata/snapshot.lux +++ b/stdlib/source/program/aedifex/metadata/snapshot.lux @@ -51,7 +51,7 @@ #versioning Versioning])) (with_template [<definition> <tag>] - [(def: <definition> xml.Tag ["" <tag>])] + [(def <definition> xml.Tag ["" <tag>])] [<group> "groupId"] [<name> "artifactId"] @@ -60,7 +60,7 @@ ) (with_template [<name> <type> <tag> <pre>] - [(def: <name> + [(def <name> (-> <type> XML) (|>> <pre> {xml.#Text} list {xml.#Node <tag> xml.attributes}))] @@ -69,7 +69,7 @@ [version_format Version ..<version> (|>)] ) -(def: .public (format (open "/[0]")) +(def .public (format (open "/[0]")) (-> Metadata XML) (let [(open "//[0]") /#artifact] {xml.#Node ..<metadata> @@ -79,12 +79,12 @@ (..version_format //#version) (///artifact/versioning.format /#versioning))})) -(def: (text tag) +(def (text tag) (-> xml.Tag (Parser Text)) (<| (<xml>.node tag) <xml>.text)) -(def: .public parser +(def .public parser (Parser Metadata) (<| (<xml>.node ..<metadata>) (do [! <>.monad] @@ -113,18 +113,18 @@ ///artifact.#version version] #versioning versioning])))) -(def: .public equivalence +(def .public equivalence (Equivalence Metadata) (all product.equivalence ///artifact.equivalence ///artifact/versioning.equivalence )) -(def: .public uri +(def .public uri (-> Artifact URI) //.remote_artifact_uri) -(def: .public (read repository artifact) +(def .public (read repository artifact) (-> (Repository Async) Artifact (Async (Try Metadata))) (do async.monad [project (at repository download (..uri artifact))] @@ -141,7 +141,7 @@ [#artifact artifact #versioning ///artifact/versioning.init]})))) -(def: .public (write repository artifact metadata) +(def .public (write repository artifact metadata) (-> (Repository Async) Artifact Metadata (Async (Try Any))) (|> metadata ..format |