diff options
Diffstat (limited to 'stdlib/source/program')
-rw-r--r-- | stdlib/source/program/aedifex/artifact/snapshot/version/value.lux | 42 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/artifact/value.lux | 47 |
2 files changed, 42 insertions, 47 deletions
diff --git a/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux new file mode 100644 index 000000000..7356d897c --- /dev/null +++ b/stdlib/source/program/aedifex/artifact/snapshot/version/value.lux @@ -0,0 +1,42 @@ +(.module: + [lux #* + [abstract + [equivalence (#+ Equivalence)]] + [data + ["." product] + ["." text + ["%" format]]]] + ["." /// (#+ Snapshot) + ["#." time] + ["#." stamp]]) + +(type: #export Value + {#version Text + #snapshot Snapshot}) + +(def: #export equivalence + (Equivalence Value) + ($_ product.equivalence + text.equivalence + ///.equivalence + )) + +(def: separator + "-") + +(def: #export snapshot + "SNAPSHOT") + +(def: #export (format (^slots [#version #snapshot])) + (%.Format Value) + (case snapshot + #///.Local + version + + (#///.Remote stamp) + (let [(^slots [#///stamp.time #///stamp.build]) stamp] + (%.format (text.replace_all ..snapshot + (///time.format time) + version) + ..separator + (%.nat build))))) diff --git a/stdlib/source/program/aedifex/artifact/value.lux b/stdlib/source/program/aedifex/artifact/value.lux deleted file mode 100644 index 3e92dbf16..000000000 --- a/stdlib/source/program/aedifex/artifact/value.lux +++ /dev/null @@ -1,47 +0,0 @@ -(.module: - [lux #* - [abstract - [equivalence (#+ Equivalence)]] - [data - ["." product] - ["." text - ["%" format]] - [collection - ["." list ("#\." functor)]]] - [math - [number - ["." nat]]] - [time - ["." instant]]] - [// (#+ Version) - ["." time_stamp (#+ Time_Stamp)]]) - -(type: #export Build - Nat) - -(type: #export Value - {#version Version - #time_stamp Time_Stamp - #build Build}) - -(def: #export equivalence - (Equivalence Value) - ($_ product.equivalence - text.equivalence - instant.equivalence - nat.equivalence - )) - -(def: separator - "-") - -(def: snapshot - "SNAPSHOT") - -(def: #export (format (^slots [#version #time_stamp #build])) - (%.Format Value) - (%.format (text.replace_all ..snapshot - (time_stamp.format time_stamp) - version) - ..separator - (%.nat build))) |