From 907b90ec4cd6059dfc3bcc1c75d3814de209ae13 Mon Sep 17 00:00:00 2001 From: aplteam Date: Sat, 11 Feb 2023 19:42:02 +0100 Subject: [PATCH] Superfluous folder deleted --- .../APLTreeUtils2.aplc | 402 -- .../apl-package.json | 1 - .../APLTreeUtils2.aplc | 406 -- .../apl-package.json | 1 - .../CodeCoverage.aplc | 924 ----- .../apl-package.json | 1 - .../aplteam-CommTools-1.0.1/CommTools.aplc | 133 - .../aplteam-CommTools-1.0.1/apl-package.json | 1 - .../aplteam-DotNetZip-2.0.2/DotNetZip.aplc | 377 -- .../apl-dependencies.txt | 2 - .../aplteam-DotNetZip-2.0.2/apl-package.json | 1 - .../aplteam-Execute-3.0.2/Execute.aplc | 445 -- .../apl-dependencies.txt | 1 - .../aplteam-Execute-3.0.2/apl-package.json | 1 - .../FilesAndDirs.aplc | 985 ----- .../apl-dependencies.txt | 2 - .../apl-package.json | 1 - .../FilesAndDirs.aplc | 1019 ----- .../apl-dependencies.txt | 2 - .../apl-package.json | 1 - .../aplteam-IniFiles-5.0.3/IniFiles.aplc | 1212 ------ .../apl-dependencies.txt | 1 - .../aplteam-IniFiles-5.0.3/apl-package.json | 1 - .../APLSource/Inno/API/Run.aplf | 1 - .../APLSource/Inno/Assert.aplf | 1 - .../APLSource/Inno/GetDefFromInno.aplf | 6 - .../APLSource/Inno/History.apla | 4 - .../APLSource/Inno/Init.aplf | 3 - .../APLSource/Inno/Run.aplf | 49 - .../APLSource/Inno/Select.aplf | 47 - .../APLSource/Inno/SelectInno.aplf | 22 - .../APLSource/Inno/UpdateVersionName.aplf | 21 - .../Inno/UpdateVersionNumberInInno_ISS.aplf | 18 - .../APLSource/Inno/Version.aplf | 3 - .../aplteam-Inno-1.0.0/apl-dependencies.txt | 4 - .../aplteam-Inno-1.0.0/apl-package.json | 1 - .../APLSource/ADOC_Doc.apla | 133 - .../APLSource/API/CheckVersionNo.aplf | 1 - .../APLSource/API/ConvertMarkdownToHtml5.aplf | 1 - .../APLSource/API/CopyBetter.aplf | 1 - .../APLSource/API/CopyTo.aplf | 1 - .../APLSource/API/CreateAPI.aplf | 1 - .../API/CreateStandAloneExeParms.aplf | 1 - .../API/CreateTatinPackageFromNamespace.aplf | 1 - .../CreateTatinPackageFromSingleScript.aplf | 1 - .../APLSource/API/CreateZipFile.aplf | 1 - .../APLSource/API/DropBuildNumber.aplf | 1 - .../APLSource/API/GetMyUCMDsFolder.aplf | 1 - .../APLSource/API/GetUserHomeFolder.aplf | 1 - .../APLSource/API/IncreaseBuildID.aplf | 1 - .../API/MakeStandAloneRunTimeExe.aplf | 1 - .../APLSource/API/RecreateFolder.aplf | 1 - .../APLSource/API/RemoveStuffButSetupExe.aplf | 1 - .../APLSource/API/Select.aplf | 1 - .../APLSource/API/Version.aplf | 2 - .../APLSource/API/YesOrNo.aplf | 1 - .../APLSource/AddBuildIDtoVersionNested.aplf | 52 - .../APLSource/AddBuildIDtoVersionSimple.aplf | 52 - .../APLSource/Assert.aplf | 1 - .../APLSource/CheckVersionNo.aplf | 25 - .../APLSource/ConvertMarkdownToHtml5.aplf | 19 - .../APLSource/CopyBetter.aplf | 43 - .../APLSource/CopyTo.aplf | 49 - .../APLSource/CreateAPI.aplf | 114 - .../APLSource/CreateStandAloneExeParms.aplf | 31 - .../CreateTatinPackageFromNamespace.aplf | 69 - .../CreateTatinPackageFromSingleScript.aplf | 75 - .../APLSource/CreateZipFile.aplf | 21 - .../APLSource/DropBuildNumber.aplf | 16 - .../APLSource/EstablishProjectFolder.aplf | 7 - .../APLSource/GetMyUCMDsFolder.aplf | 16 - .../APLSource/GetUserHomeFolder.aplf | 36 - .../APLSource/History.apla | 32 - .../APLSource/IncreaseBuildID.aplf | 43 - .../APLSource/MakeStandAloneRunTimeExe.aplf | 70 - .../APLSource/Public.aplf | 21 - .../APLSource/QuadVars.aplc | 3 - .../APLSource/RecreateFolder.aplf | 28 - .../APLSource/RemoveStuffButSetupExe.aplf | 16 - .../APLSource/Select.aplf | 14 - .../APLSource/Version.aplf | 3 - .../APLSource/YesOrNo.aplf | 11 - .../apl-dependencies.txt | 6 - .../apl-package.json | 1 - .../Files/BlackOnWhite_print.css | 367 -- .../Files/BlackOnWhite_screen.css | 919 ----- .../Files/LeanPubExtensions.html | 319 -- .../aplteam-MarkAPL-11.0.3/Files/MarkAPL.html | 2494 ----------- .../Files/MarkAPL_CheatSheet.html | 644 --- .../Files/MarkAPL_for_Programmers.html | 665 --- .../Files/MarkAPL_print.css | 374 -- .../Files/MarkAPL_screen.css | 897 ---- .../Files/QuickIntro.html | 119 - .../aplteam-MarkAPL-11.0.3/Files/Styles.html | 331 -- .../aplteam-MarkAPL-11.0.3/MarkAPL.aplc | 3631 ----------------- .../apl-dependencies.txt | 2 - .../aplteam-MarkAPL-11.0.3/apl-package.json | 1 - -packages_dev/aplteam-OS-3.0.1/OS.aplc | 328 -- .../aplteam-OS-3.0.1/apl-dependencies.txt | 1 - .../aplteam-OS-3.0.1/apl-package.json | 1 - .../aplteam-Tester2-3.2.7/Tester2.aplc | 1768 -------- .../apl-dependencies.txt | 2 - .../aplteam-Tester2-3.2.7/apl-package.json | 1 - .../aplteam-WinSys-5.0.1/WinSys.aplc | 461 --- .../aplteam-WinSys-5.0.1/apl-package.json | 1 - .../aplteam-ZipArchive-1.0.0/ZipArchive.aplc | 329 -- .../apl-dependencies.txt | 3 - .../aplteam-ZipArchive-1.0.0/apl-package.json | 1 - 108 files changed, 20786 deletions(-) delete mode 100644 -packages_dev/aplteam-APLTreeUtils2-1.1.1/APLTreeUtils2.aplc delete mode 100644 -packages_dev/aplteam-APLTreeUtils2-1.1.1/apl-package.json delete mode 100644 -packages_dev/aplteam-APLTreeUtils2-1.1.3/APLTreeUtils2.aplc delete mode 100644 -packages_dev/aplteam-APLTreeUtils2-1.1.3/apl-package.json delete mode 100644 -packages_dev/aplteam-CodeCoverage-0.9.4/CodeCoverage.aplc delete mode 100644 -packages_dev/aplteam-CodeCoverage-0.9.4/apl-package.json delete mode 100644 -packages_dev/aplteam-CommTools-1.0.1/CommTools.aplc delete mode 100644 -packages_dev/aplteam-CommTools-1.0.1/apl-package.json delete mode 100644 -packages_dev/aplteam-DotNetZip-2.0.2/DotNetZip.aplc delete mode 100644 -packages_dev/aplteam-DotNetZip-2.0.2/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-DotNetZip-2.0.2/apl-package.json delete mode 100644 -packages_dev/aplteam-Execute-3.0.2/Execute.aplc delete mode 100644 -packages_dev/aplteam-Execute-3.0.2/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-Execute-3.0.2/apl-package.json delete mode 100644 -packages_dev/aplteam-FilesAndDirs-5.1.5/FilesAndDirs.aplc delete mode 100644 -packages_dev/aplteam-FilesAndDirs-5.1.5/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-FilesAndDirs-5.1.5/apl-package.json delete mode 100644 -packages_dev/aplteam-FilesAndDirs-5.2.1/FilesAndDirs.aplc delete mode 100644 -packages_dev/aplteam-FilesAndDirs-5.2.1/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-FilesAndDirs-5.2.1/apl-package.json delete mode 100644 -packages_dev/aplteam-IniFiles-5.0.3/IniFiles.aplc delete mode 100644 -packages_dev/aplteam-IniFiles-5.0.3/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-IniFiles-5.0.3/apl-package.json delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/API/Run.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/Assert.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/GetDefFromInno.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/History.apla delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/Init.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/Run.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/Select.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/SelectInno.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/UpdateVersionName.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/UpdateVersionNumberInInno_ISS.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/APLSource/Inno/Version.aplf delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-Inno-1.0.0/apl-package.json delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/ADOC_Doc.apla delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CheckVersionNo.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/ConvertMarkdownToHtml5.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CopyBetter.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CopyTo.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CreateAPI.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CreateStandAloneExeParms.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CreateTatinPackageFromNamespace.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CreateTatinPackageFromSingleScript.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/CreateZipFile.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/DropBuildNumber.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/GetMyUCMDsFolder.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/GetUserHomeFolder.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/IncreaseBuildID.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/MakeStandAloneRunTimeExe.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/RecreateFolder.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/RemoveStuffButSetupExe.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/Select.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/Version.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/API/YesOrNo.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/AddBuildIDtoVersionNested.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/AddBuildIDtoVersionSimple.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/Assert.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CheckVersionNo.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/ConvertMarkdownToHtml5.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CopyBetter.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CopyTo.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CreateAPI.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CreateStandAloneExeParms.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CreateTatinPackageFromNamespace.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CreateTatinPackageFromSingleScript.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/CreateZipFile.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/DropBuildNumber.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/EstablishProjectFolder.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/GetMyUCMDsFolder.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/GetUserHomeFolder.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/History.apla delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/IncreaseBuildID.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/MakeStandAloneRunTimeExe.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/Public.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/QuadVars.aplc delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/RecreateFolder.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/RemoveStuffButSetupExe.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/Select.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/Version.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/APLSource/YesOrNo.aplf delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-MakeHelpers-0.3.0/apl-package.json delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/BlackOnWhite_print.css delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/BlackOnWhite_screen.css delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/LeanPubExtensions.html delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/MarkAPL.html delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/MarkAPL_CheatSheet.html delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/MarkAPL_for_Programmers.html delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/MarkAPL_print.css delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/MarkAPL_screen.css delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/QuickIntro.html delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/Files/Styles.html delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/MarkAPL.aplc delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-MarkAPL-11.0.3/apl-package.json delete mode 100644 -packages_dev/aplteam-OS-3.0.1/OS.aplc delete mode 100644 -packages_dev/aplteam-OS-3.0.1/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-OS-3.0.1/apl-package.json delete mode 100644 -packages_dev/aplteam-Tester2-3.2.7/Tester2.aplc delete mode 100644 -packages_dev/aplteam-Tester2-3.2.7/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-Tester2-3.2.7/apl-package.json delete mode 100644 -packages_dev/aplteam-WinSys-5.0.1/WinSys.aplc delete mode 100644 -packages_dev/aplteam-WinSys-5.0.1/apl-package.json delete mode 100644 -packages_dev/aplteam-ZipArchive-1.0.0/ZipArchive.aplc delete mode 100644 -packages_dev/aplteam-ZipArchive-1.0.0/apl-dependencies.txt delete mode 100644 -packages_dev/aplteam-ZipArchive-1.0.0/apl-package.json diff --git a/-packages_dev/aplteam-APLTreeUtils2-1.1.1/APLTreeUtils2.aplc b/-packages_dev/aplteam-APLTreeUtils2-1.1.1/APLTreeUtils2.aplc deleted file mode 100644 index dcc3cf4..0000000 --- a/-packages_dev/aplteam-APLTreeUtils2-1.1.1/APLTreeUtils2.aplc +++ /dev/null @@ -1,402 +0,0 @@ -:Class APLTreeUtils2 -⍝ This is the predecessor of the namespace `APLTreeUtils`.\\ -⍝ While `APLTreeUtils` was a namespace scipt designed to be included into pretty much every member of the -⍝ APLTree library, `APLTreeUtils2` is a class with shared methods. You are supposed to call those methods. -⍝ This has some major advantageous over the old approach: -⍝ * It's possible to add new functins to `APLTreeUtils`. With the old approach there was always the possibility -⍝ of a name clash, so adding new function was practically impossible. -⍝ * The sequence of fixing does not matter (though with lazy fixing that should not be an issue anymore anyway, -⍝ but at the time of writing it still is). -⍝ * Over the years we have seen rare `⎕IO` and `⎕ML` issues with `:Include`. We just avoid the possibility now.\\ -⍝ For a list with the precise differences between `APLTreeUtils` and `APLTreeUtils2` see the project ReadMe on -⍝ GitHub. Note that there are many. Most importantly, `APLTreeUtils2` requires Dyalog 18.0. -⍝ Kai Jaeger - APL Team Ltd.\\ -⍝ Homepage: - - ⎕ML←⎕IO←1 - - ∇ r←Version - :Access Public Shared - r←'APLTreeUtils2' '1.1.1+50' '2021-03-01' - ∇ - - ∇ History - ⍝ * 1.1.1 from 2021-03-01 - ⍝ * Package config file corrected (new format) - ⍝ * 1.1.0 from 2020-09-26 - ⍝ * Method `IsRunningAsAdmin` added - ⍝ * 1.0.0 from 2020-09-06 - ⍝ * This is the predecessor of `APLTreeUtils` - ∇ - - ∇ r←{x}Lowercase txt - ⍝ `txt` is transformed into lowercase.\\ - ⍝ This function is kept for compatability reasons. - :Access Public Shared - x←{0<⎕NC ⍵:⍎⍵ ⋄ ¯3}'x' - r←x ⎕C txt - ∇ - - ∇ r←Uppercase txt - ⍝ `txt` is transformed into uppercase.\\ - ⍝ This function is kept for compatability reasons. - :Access Public Shared - r←1 ⎕C txt - ∇ - - ∇ r←IsChar y - ⍝ Checks `y` for being text - :Access Public Shared - r←0 2∊⍨10|⎕DR y - ∇ - - ∇ r←ToNum y - ⍝ Transforms `y` into number(s) - :Access Public Shared - r←⊃(//)⎕VFI y - ∇ - - ∇ r←IsScripted y - ⍝ Returns a 1 for classes, interfaces and scripted namespaces and 0 otherwise. - :Access Public Shared - r←{11 16::0 ⋄ 1⊣⎕SRC ⍵}y - ∇ - - ∇ {r}←{msg}Assert y;EN;success - ⍝ Use this to ensure certain conditions. If the condition is not met an error is signalled, otherwise a 1 is returned.\\ - ⍝ The optional left argument would become the message that is signalled.\\ - ⍝ `y` might be a scalar or a vector of length one: that must be a Boolean. 1 means "success".\\ - ⍝ `y` can also be a two-item vector: - ⍝ 1. A Boolean as before - ⍝ 2. An error number to be signalle; defaults to 11. - :Access Public Shared - r←1 - msg←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'msg' - (success EN)←2↑y,11 - :If (,1)≢,success - msg ⎕SIGNAL EN - :EndIf - ∇ - - ∇ r←IsDevelopment - :Access Public Shared - ⍝ Returns 1 in case the function is running under a Dyalog development (EXE or DLL). - r←'Development'≡4⊃'#'⎕WG'APLVersion' - r∨←'DLL'≡4⊃'#'⎕WG'APLVersion' ⍝ May be DLLRT instead! - ∇ - - ∇ r←{sep}SplitPath y;l - ⍝ Separates the path from the filename and returns both.\\ - ⍝ Default for the optional left argument (the separator) are `\/`.\\ - ⍝ `'C:\Buffer\' 'my.txt' ←→ SplitPath 'C:\Buffer\my.txt'` - ⍝ `(,¨'1.2.3.4.') (,'5') ←→ '.' SplitPath '1.2.3.4.5'` - :Access Public Shared - sep←,{0<⎕NC ⍵:⍎⍵ ⋄ '/\'}'sep' - :If 0=≢y - r←2⍴⊂y - :Else - l←1+-⌊/sep⍳⍨⌽y - r←(l↓y)(l↑y) - :EndIf - ∇ - - ∇ r←{sep}Split y;b - :Access Public Shared - ⍝ `'First' 'Second' ←→ Split 'First',(⎕UCS 13 10),'Second'`\\ - ⍝ `(,¨'1' '2' '3' '' '4') ←→ '.' Split '1.2.3..4'`\\ - ⍝ That's _different_ from what `(≠⊆⊢)` is doing:\\ - ⍝ `(,¨'1' '2' '3' '4') ←→ '.' (≠⊆⊢) '1.2.3..4'`\\ - ⍝ Default for the optional left argument (the separator) is CR+LF. - sep←{0<⎕NC ⍵:⍎⍵ ⋄ ⎕UCS 13 10}'sep' - b←(1↑⍨≢sep),sep⍷y ⍝ This is more efficient in terms of memory then doing it one one line - r←(≢sep)↓¨b⊂sep,y - ∇ - - ∇ r←{sep}Last y;where - :Access Public Shared - ⍝ Returns the last part in `y`.\\ - ⍝ Default separator is the dot (`.`), so for a filename it would return the extension:\\ - ⍝ `BAT ←→ Last '/path/to/file.BAT'`\\ - ⍝ You can also use this to get the filename from a path:\\ - ⍝ `file.BAT ←→ '/\' Last '/path/to/file.BAT'`\\ - ⍝ Returns always a vector:\\ - ⍝ `(,¨'3') ←→ Last '1.2.3'` - sep←{0<⎕NC ⍵:⍎⍵ ⋄ '.'}'sep' - :If (≢y)=where←¯1+⌊/sep⍳⍨⌽,y - r←0⍴y - :ElseIf ~0 1∊⍨≡r←(-where)↑y - r←⍬⍴r - :EndIf - ∇ - - ∇ r←{x}DMB y;w - :Access Public Shared - ⍝ Delete leading, trailing and multiple blanks by default. Accepts scalar, vector and matrix as argument. - x←{0<⎕NC ⍵:⍎⍵ ⋄ ' '}'x' - r←x{~0 1∊⍨≡⍵:⍺ ∇¨⍵ - 2=⍴⍴⍵:↑⍺ ∇¨↓⍵ - (,⍺)≡,⍵:'' - w←1↓¯1↓⍺{⍵/⍨~(2⍴⍺)⍷⍵}⍺,⍵,⍺ - (0=⍴⍴⍵)∧1=≢w:⍬⍴⍵ - w - }y - ∇ - - ∇ r←DLB y - :Access Public Shared - ⍝ Delete leading blanks. Accepts scalar, vector and matrix as argument. - :If 2=|≡y - r←DLB¨y - :ElseIf 1=⍴⍴y - r←(+/∧\' '=y)↓y ⍝ Vectors (main application) - :ElseIf 2=⍴⍴y - r←(+/∧\' '=y)⌽y ⍝ Matrix - :ElseIf 0=⍴⍴y - r←(1+' '≡y)⊃y'' ⍝ Scalar - :EndIf - ∇ - - ∇ r←DTB y - :Access Public Shared - ⍝ Delete trailing blanks. Accepts scalar, vector and matrix as argument. - :If 2=|≡y - r←DTB¨y - :ElseIf 1=⍴⍴y - r←⌽{(+/∧\' '=⍵)↓⍵}⌽y ⍝ Vectors (main application) - :ElseIf 2=⍴⍴y - r←(-+/∧⌿∧\' '=⌽y)↓[2]y ⍝ Matrix - :ElseIf 0=⍴⍴y - r←(1+' '≡y)⊃y'' ⍝ Scalar - :EndIf - ∇ - - ∇ {success}←{browser}GoToWebPage Url;wsh;url;html;title;EncodeBlanksForNix;⎕WX - :Access Public Shared - ⍝ Fires up the default browser and displays "Url". Exception is when the current - ⍝ session is connected to Ride: then "Url" is displayed in the Ride browser.\\ - ⍝ Instead of using the default browser you can specify an EXE (Windows) or command - ⍝ as the left argument. That will then be used to show "Url". Note that the left - ⍝ argument is ignored in case the current session is connected to Ride.\\ - ⍝ For displaying a local file rather then a url add "file:///".\\ - ⍝ However, note that "file:///" does not work on some systems / with some browsers.\\ - ⍝ Returns 1 for success and 0 for failure. That can happen for example when the - ⍝ Windows Scripting Host throws a DOMAIN ERROR.\\ - ⍝ Examples: - ⍝ ~~~ - ⍝ GoToWebPage 'file:///c:/my.html' - ⍝ GoToWebPage 'file://localhost/c:/my.html' - ⍝ GoToWebPage 'http://aplwiki.com' - ⍝ GoToWebPage 'https://en.wikipedia.org/wiki/Main_Page' - ⍝ ~~~ - ⎕WX←1 - success←1 - url←Lowercase Url - :If ∨/'file:'{⍺≡(≢⍺)↑⍵}url - :If 'Win'≡GetOperatingSystem ⍬ - Url←'"',('"'~⍨'file://'{⍺,(≢⍺)↓⍵}Url),'"' - :EndIf - :ElseIf ∨/'https:'{⍺≡(≢⍺)↑⍵}url - Url←'https://'{⍺,(≢⍺)↓⍵}Url - :ElseIf ∨/'http:'{⍺≡(≢⍺)↑⍵}url - Url←'http://'{⍺,(≢⍺)↓⍵}Url - :Else - :If ∨/'//:'∊Url ⍝ Any protocol at all?! - ⍝ ? No idea what that protocol is, so we just allow it going through. - :Else - Url←'https://',Url ⍝ That's the default - :EndIf - :EndIf - (('\'=Url)/Url)←'/' - Url←{l←3+1⍳⍨'://'⍷⍵ ⋄ (l↑⍵),{(~'//'⍷⍵)/⍵}l↓Url}Url - :If 3501⌶⍬ ⍝ Connected to Ride? - :If 'file://'{⍺≡(≢⍺)↑⍵}Url - ⍝Url←∊(⊂'\ ')@(⍸' '=Url)⊣Url - Url←(≢'file://')↓Url - html←⊃⎕NGET Url 1 - :If 0=≢title←'' '' - html,←⊂'' - html,←'' '' - success←0=Url(3500⌶)∊html - :EndIf - :Else - browser←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'browser' - browser←{'"',(⍵~'"'),'" '}⍣(0<≢browser)⊢browser - :Select GetOperatingSystem ⍬ - :Case 'Win' - 'wsh'⎕WC'OLEClient' 'WScript.Shell' - :Trap 11 - :If 0=≢browser - {}wsh.Run Url - :Else - {}wsh.Run browser,Url - :EndIf - :Else - success←0 - :EndTrap - :Case 'Lin' - :Trap 11 - :If 0=≢browser - {}⎕SH'xdg-open ',Url,' /dev/null 2>&1 &' - :Else - {}⎕SH browser,' ',Url,' /dev/null 2>&1 &' - :EndIf - :Else - success←0 - :EndTrap - :Case 'Mac' - :Trap 11 - {}⎕SH'open Safari ',Url - :Else - success←0 - :EndTrap - :EndSelect - :EndIf - ∇ - - ∇ r←IsRunningAsAdmin;IsUserAnAdmin - ⍝ Tells whether this process is being "Run as Administrator" (Windows) or has sudo rights (others) - :Access Public Shared - :If 'Win'≡APLTreeUtils2.GetOperatingSystem'' - :Trap r←0 - r←⍎⎕NA'I Shell32|IsUserAnAdmin' - :EndTrap - :Else - r←{∨/' sudo '⍷' ',⍵,' '}⊃⎕SH'groups ',⎕AN - :EndIf - ∇ - - ∇ r←GetOperatingSystem dummy - :Access Public Shared - ⍝ Returns one of: "Win", "Mac", "AIX", "Lin".\\ - ⍝ Note that under Linux you might need more information. - r←3↑⊃'.'⎕WG'APLVersion' - ∇ - - ∇ r←Create_UUID;⎕RL - ⍝ Produces a UUID - :Access Public Shared - ⎕RL←+/⎕TS - r←'-'@(+\9,3⍴5)⊢(⎕D,⎕C ⎕A)[?36⍴16] - ∇ - - ∇ r←{type}Base64 txt;charset - :Access Public Shared - ⍝ Base64 encoding. `txt` must be a simple character vector.\\ - ⍝ `type` defaults to 1 which specifies the default alphabet: `[a-zA-z0-9+/=]`.\\ - ⍝ If you want a file and URL-save alphabet specify `type` as 2. Then `- is used instead of `+`, and `_` instead of `/`.\\ - ⍝ See [RFC 4648](http://www.rfc-editor.org/rfc/rfc4648.txt) for details.\\ - ⍝ Whitespace in `txt` is ignored on decode. - type←{0<⎕NC ⍵:⍎⍵ ⋄ 1}'type' - :If (,1)≡,type - charset←'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' - :ElseIf (,2)≡,type - charset←'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_' - :Else - 'Invalid left argument: "type" must be either 1 or 2'⎕SIGNAL 11 - :EndIf - :If ∧/('='~⍨∪txt)∊charset - r←charset base64 txt - :Else - r←charset base64'UTF-8'⎕UCS txt - :EndIf - ∇ - - ∇ r←{x}AtLeastVersion min - :Access Public Shared - ⍝ Returns 1 if the currently running version is at least `min`.\\ - ⍝ If the current version is 17.1 then:\\ - ⍝ `0 0 1 1 ←→ AtLeastVersion¨16 17 17.1 18`\\ - ⍝ You may specify a version different from the currently running one via `⍺`:\\ - ⍝ `0 1 1 1 ←→ 17 AtLeastVersion¨16 17 17.1 18` - x←{0<⎕NC ⍵:⍎⍵ ⋄ {⊃⊃(//)⎕VFI ⍵/⍨2>+\⍵='.'}2⊃'#'⎕WG'APLVersion'}'x' - 'Right argument must be length 1'⎕SIGNAL 11/⍨1≠≢min - r←⊃min≥x - ∇ - - ∇ r←{length}FormatDateTime ts;ts2;formatstring;bool;buffer - :Access Public Shared - ⍝ Formats the right argument (defaults to `⎕TS` if empty) as a string with 'YYYY-MM-DD hh:mm:ss by default\\ - ⍝ The right argument can be one of: - ⍝ * A single float (like 20120102030405) representing date and time. - ⍝ * A simple vector of length 6 or 7 representing a timestamp (`⎕TS`). - ⍝ * A matrix of either floats or vectors (length 6 or 7) representing a DateTime. - ⍝ Note that you cannot mix floats and time stamps.\\ - ⍝ If the right argument has not 7 but 6 or 3 elements, formatting is done accordingly.\\ - ⍝ Via the left argument the length can be set to - ⍝ ⍬, 3, 6 or 7; default is 6; ⍬ Accepts any length of the right argument which is 3, 6 or 7.\\ - ⍝ If the right argument is a... - ⍝ * simple vector, a string is returned. - ⍝ * matrix, a matrix is returned. - :If 645≡⎕DR ts - :If (⍴⍴ts)∊0 1 - :If 1=≢ts - ts←{0=≢,⍵:⍬ ⋄ ⎕ML←3 ⋄ ⍎¨(4 2 2 2 2 2/⍳6)⊂14 0⍕⍵}ts - :EndIf - :Else - ts←↑,{0=⍵:6⍴0 ⋄ v←14 0⍕⍵ ⋄ ⎕ML←3 ⋄ ⍎¨(4 2 2 2 2 2/⍳6)⊂v}¨ts - :EndIf - :EndIf - :If ⍬≡length←{2=⎕NC ⍵:⍎⍵ ⋄ 6}'length' - length←''⍴¯1↑⍴ts - :EndIf - :If ~0=≢ts - :If 2=⍴⍴ts - buffer←{⍵/⍨0<≢¨⍵~¨⊂' ' 0}↓ts - 'Invalid right argument: must be integer'⎕SIGNAL 11/⍨~326 163∊⍨∪⎕DR¨buffer - 'Invalid right argument: must not be negative'⎕SIGNAL 11/⍨∨/¯1∊¨×¨buffer - 'Invalid right argument: must be simple'⎕SIGNAL 11/⍨1≠∪≡¨buffer - :Else - 'Invalid right argument: must be integer'⎕SIGNAL 11/⍨~326 163∊⍨⎕DR ts - 'Invalid right argument: must not be negative'⎕SIGNAL 11/⍨¯1∊×,ts - 'Invalid right argument: must be simple'⎕SIGNAL 11/⍨1≠≡ts - :EndIf - :EndIf - :If 2=⍴⍴ts - ts2←length↑[2]ts - :Else - ts2←,[0.5]length↑{0=≢⍵:⎕TS ⋄ ts}ts - :EndIf - :Select ⊃length - :Case 3 - formatstring←'ZI4,<->,ZI2,<->,ZI2' - :CaseList 6 7 - formatstring←'ZI4,<->,ZI2,<->,ZI2,< >,ZI2,<:>,ZI2,<:>,ZI2' - :Else - 'Invalid left argument'⎕SIGNAL 11 - :EndSelect - bool←(ts2∨.≠' ')∧ts2∨.≠0 - r←bool⍀formatstring ⎕FMT(6⌊length)↑[2]bool⌿ts2 - :If 7=2⊃⍴ts2 - r←⊃(↓r),¨{0=⍵:'' ⋄ 0=≢⍵~' ':'' ⋄ '.',⍕⍵}¨ts2[;7] - :EndIf - :If 2≠⍴⍴ts - r←,r - :EndIf - ∇ - - base64←{ - ⎕IO←0 - ⍺←'' - chars←⍺ - bits←{,⍉(⍺⍴2)⊤⍵} ⍝ encode each element of ⍵ in ⍺ bits, - ⍝ and catenate them all together - part←{((⍴⍵)⍴⍺↑1)⊂⍵} ⍝ partition ⍵ into chunks of length ⍺ - - 0=2|⎕DR ⍵:'UTF-8'⎕UCS 2∘⊥∘(8∘↑)¨8 part{(-8|≢⍵)↓⍵}6 bits{(⍵≠64)/⍵}chars⍳⍵ - ⍝ decode a string into octets - - four←{ ⍝ use 4 characters to encode either - 8=≢⍵:'=='∇ ⍵,0 0 0 0 ⍝ 1, - 16=≢⍵:'='∇ ⍵,0 0 ⍝ 2 - chars[2∘⊥¨6 part ⍵],⍺ ⍝ or 3 octets of input - } - cats←⊃∘(,/)∘((⊂'')∘,) ⍝ catenate zero or more strings - cats''∘four¨24 part 8 bits ⍵ - } - -:EndClass diff --git a/-packages_dev/aplteam-APLTreeUtils2-1.1.1/apl-package.json b/-packages_dev/aplteam-APLTreeUtils2-1.1.1/apl-package.json deleted file mode 100644 index 73f57be..0000000 --- a/-packages_dev/aplteam-APLTreeUtils2-1.1.1/apl-package.json +++ /dev/null @@ -1 +0,0 @@ -{ api: "APLTreeUtils2", assets: "", date: 20210304.203221, description: "General utilities required by most members of the APLTree library", documentation: "", group: "aplteam", io: 1, lx: "", maintainer: "Kai Jaeger ", minimumAplVersion: "18.0", ml: 1, name: "APLTreeUtils2", os_lin: 1, os_mac: 1, os_win: 1, project_url: "https://github.com/aplteam/APLTreeUtils2", source: "APLTreeUtils2.aplc", tags: "utilities", uri: "https://tatin.dev/", version: "1.1.1+50", } diff --git a/-packages_dev/aplteam-APLTreeUtils2-1.1.3/APLTreeUtils2.aplc b/-packages_dev/aplteam-APLTreeUtils2-1.1.3/APLTreeUtils2.aplc deleted file mode 100644 index b1c6676..0000000 --- a/-packages_dev/aplteam-APLTreeUtils2-1.1.3/APLTreeUtils2.aplc +++ /dev/null @@ -1,406 +0,0 @@ -:Class APLTreeUtils2 -⍝ This is the predecessor of the namespace `APLTreeUtils`.\\ -⍝ While `APLTreeUtils` was a namespace scipt designed to be included into pretty much every member of the -⍝ APLTree library, `APLTreeUtils2` is a class with shared methods. You are supposed to call those methods. -⍝ This has some major advantageous over the old approach: -⍝ * It's possible to add new functins to `APLTreeUtils`. With the old approach there was always the possibility -⍝ of a name clash, so adding new function was practically impossible. -⍝ * The sequence of fixing does not matter (though with lazy fixing that should not be an issue anymore anyway, -⍝ but at the time of writing it still is). -⍝ * Over the years we have seen rare `⎕IO` and `⎕ML` issues with `:Include`. We just avoid the possibility now.\\ -⍝ For a list with the precise differences between `APLTreeUtils` and `APLTreeUtils2` see the project ReadMe on -⍝ GitHub. Note that there are many. Most importantly, `APLTreeUtils2` requires Dyalog 18.0. -⍝ Kai Jaeger - APL Team Ltd.\\ -⍝ Homepage: - - ⎕ML←⎕IO←1 - - ∇ r←Version - :Access Public Shared - r←'APLTreeUtils2' '1.1.3+53' '2021-04-07' - ∇ - - ∇ History - ⍝ * 1.1.3 from 2021-04-07 - ⍝ * `AtLeastVersion` was NOT buggy, its test case was - ⍝ * 1.1.2 from 2021-04-06 - ⍝ * `AtLeastVersion` was buggy - ⍝ * 1.1.1 from 2021-03-01 - ⍝ * Package config file corrected (new format) - ⍝ * 1.1.0 from 2020-09-26 - ⍝ * Method `IsRunningAsAdmin` added - ⍝ * 1.0.0 from 2020-09-06 - ⍝ * This is the predecessor of `APLTreeUtils` - ∇ - - ∇ r←{x}Lowercase txt - ⍝ `txt` is transformed into lowercase.\\ - ⍝ This function is kept for compatability reasons. - :Access Public Shared - x←{0<⎕NC ⍵:⍎⍵ ⋄ ¯3}'x' - r←x ⎕C txt - ∇ - - ∇ r←Uppercase txt - ⍝ `txt` is transformed into uppercase.\\ - ⍝ This function is kept for compatability reasons. - :Access Public Shared - r←1 ⎕C txt - ∇ - - ∇ r←IsChar y - ⍝ Checks `y` for being text - :Access Public Shared - r←0 2∊⍨10|⎕DR y - ∇ - - ∇ r←ToNum y - ⍝ Transforms `y` into number(s) - :Access Public Shared - r←⊃(//)⎕VFI y - ∇ - - ∇ r←IsScripted y - ⍝ Returns a 1 for classes, interfaces and scripted namespaces and 0 otherwise. - :Access Public Shared - r←{11 16::0 ⋄ 1⊣⎕SRC ⍵}y - ∇ - - ∇ {r}←{msg}Assert y;EN;success - ⍝ Use this to ensure certain conditions. If the condition is not met an error is signalled, otherwise a 1 is returned.\\ - ⍝ The optional left argument would become the message that is signalled.\\ - ⍝ `y` might be a scalar or a vector of length one: that must be a Boolean. 1 means "success".\\ - ⍝ `y` can also be a two-item vector: - ⍝ 1. A Boolean as before - ⍝ 2. An error number to be signalle; defaults to 11. - :Access Public Shared - r←1 - msg←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'msg' - (success EN)←2↑y,11 - :If (,1)≢,success - msg ⎕SIGNAL EN - :EndIf - ∇ - - ∇ r←IsDevelopment - :Access Public Shared - ⍝ Returns 1 in case the function is running under a Dyalog development (EXE or DLL). - r←'Development'≡4⊃'#'⎕WG'APLVersion' - r∨←'DLL'≡4⊃'#'⎕WG'APLVersion' ⍝ May be DLLRT instead! - ∇ - - ∇ r←{sep}SplitPath y;l - ⍝ Separates the path from the filename and returns both.\\ - ⍝ Default for the optional left argument (the separator) are `\/`.\\ - ⍝ `'C:\Buffer\' 'my.txt' ←→ SplitPath 'C:\Buffer\my.txt'` - ⍝ `(,¨'1.2.3.4.') (,'5') ←→ '.' SplitPath '1.2.3.4.5'` - :Access Public Shared - sep←,{0<⎕NC ⍵:⍎⍵ ⋄ '/\'}'sep' - :If 0=≢y - r←2⍴⊂y - :Else - l←1+-⌊/sep⍳⍨⌽y - r←(l↓y)(l↑y) - :EndIf - ∇ - - ∇ r←{sep}Split y;b - :Access Public Shared - ⍝ `'First' 'Second' ←→ Split 'First',(⎕UCS 13 10),'Second'`\\ - ⍝ `(,¨'1' '2' '3' '' '4') ←→ '.' Split '1.2.3..4'`\\ - ⍝ That's _different_ from what `(≠⊆⊢)` is doing:\\ - ⍝ `(,¨'1' '2' '3' '4') ←→ '.' (≠⊆⊢) '1.2.3..4'`\\ - ⍝ Default for the optional left argument (the separator) is CR+LF. - sep←{0<⎕NC ⍵:⍎⍵ ⋄ ⎕UCS 13 10}'sep' - b←(1↑⍨≢sep),sep⍷y ⍝ This is more efficient in terms of memory then doing it one one line - r←(≢sep)↓¨b⊂sep,y - ∇ - - ∇ r←{sep}Last y;where - :Access Public Shared - ⍝ Returns the last part in `y`.\\ - ⍝ Default separator is the dot (`.`), so for a filename it would return the extension:\\ - ⍝ `BAT ←→ Last '/path/to/file.BAT'`\\ - ⍝ You can also use this to get the filename from a path:\\ - ⍝ `file.BAT ←→ '/\' Last '/path/to/file.BAT'`\\ - ⍝ Returns always a vector:\\ - ⍝ `(,¨'3') ←→ Last '1.2.3'` - sep←{0<⎕NC ⍵:⍎⍵ ⋄ '.'}'sep' - :If (≢y)=where←¯1+⌊/sep⍳⍨⌽,y - r←0⍴y - :ElseIf ~0 1∊⍨≡r←(-where)↑y - r←⍬⍴r - :EndIf - ∇ - - ∇ r←{x}DMB y;w - :Access Public Shared - ⍝ Delete leading, trailing and multiple blanks by default. Accepts scalar, vector and matrix as argument. - x←{0<⎕NC ⍵:⍎⍵ ⋄ ' '}'x' - r←x{~0 1∊⍨≡⍵:⍺ ∇¨⍵ - 2=⍴⍴⍵:↑⍺ ∇¨↓⍵ - (,⍺)≡,⍵:'' - w←1↓¯1↓⍺{⍵/⍨~(2⍴⍺)⍷⍵}⍺,⍵,⍺ - (0=⍴⍴⍵)∧1=≢w:⍬⍴⍵ - w - }y - ∇ - - ∇ r←DLB y - :Access Public Shared - ⍝ Delete leading blanks. Accepts scalar, vector and matrix as argument. - :If 2=|≡y - r←DLB¨y - :ElseIf 1=⍴⍴y - r←(+/∧\' '=y)↓y ⍝ Vectors (main application) - :ElseIf 2=⍴⍴y - r←(+/∧\' '=y)⌽y ⍝ Matrix - :ElseIf 0=⍴⍴y - r←(1+' '≡y)⊃y'' ⍝ Scalar - :EndIf - ∇ - - ∇ r←DTB y - :Access Public Shared - ⍝ Delete trailing blanks. Accepts scalar, vector and matrix as argument. - :If 2=|≡y - r←DTB¨y - :ElseIf 1=⍴⍴y - r←⌽{(+/∧\' '=⍵)↓⍵}⌽y ⍝ Vectors (main application) - :ElseIf 2=⍴⍴y - r←(-+/∧⌿∧\' '=⌽y)↓[2]y ⍝ Matrix - :ElseIf 0=⍴⍴y - r←(1+' '≡y)⊃y'' ⍝ Scalar - :EndIf - ∇ - - ∇ {success}←{browser}GoToWebPage Url;wsh;url;html;title;EncodeBlanksForNix;⎕WX - :Access Public Shared - ⍝ Fires up the default browser and displays "Url". Exception is when the current - ⍝ session is connected to Ride: then "Url" is displayed in the Ride browser.\\ - ⍝ Instead of using the default browser you can specify an EXE (Windows) or command - ⍝ as the left argument. That will then be used to show "Url". Note that the left - ⍝ argument is ignored in case the current session is connected to Ride.\\ - ⍝ For displaying a local file rather then a url add "file:///".\\ - ⍝ However, note that "file:///" does not work on some systems / with some browsers.\\ - ⍝ Returns 1 for success and 0 for failure. That can happen for example when the - ⍝ Windows Scripting Host throws a DOMAIN ERROR.\\ - ⍝ Examples: - ⍝ ~~~ - ⍝ GoToWebPage 'file:///c:/my.html' - ⍝ GoToWebPage 'file://localhost/c:/my.html' - ⍝ GoToWebPage 'http://aplwiki.com' - ⍝ GoToWebPage 'https://en.wikipedia.org/wiki/Main_Page' - ⍝ ~~~ - ⎕WX←1 - success←1 - url←Lowercase Url - :If ∨/'file:'{⍺≡(≢⍺)↑⍵}url - :If 'Win'≡GetOperatingSystem ⍬ - Url←'"',('"'~⍨'file://'{⍺,(≢⍺)↓⍵}Url),'"' - :EndIf - :ElseIf ∨/'https:'{⍺≡(≢⍺)↑⍵}url - Url←'https://'{⍺,(≢⍺)↓⍵}Url - :ElseIf ∨/'http:'{⍺≡(≢⍺)↑⍵}url - Url←'http://'{⍺,(≢⍺)↓⍵}Url - :Else - :If ∨/'//:'∊Url ⍝ Any protocol at all?! - ⍝ ? No idea what that protocol is, so we just allow it going through. - :Else - Url←'https://',Url ⍝ That's the default - :EndIf - :EndIf - (('\'=Url)/Url)←'/' - Url←{l←3+1⍳⍨'://'⍷⍵ ⋄ (l↑⍵),{(~'//'⍷⍵)/⍵}l↓Url}Url - :If 3501⌶⍬ ⍝ Connected to Ride? - :If 'file://'{⍺≡(≢⍺)↑⍵}Url - ⍝Url←∊(⊂'\ ')@(⍸' '=Url)⊣Url - Url←(≢'file://')↓Url - html←⊃⎕NGET Url 1 - :If 0=≢title←'' '' - html,←⊂'' - html,←'' '' - success←0=Url(3500⌶)∊html - :EndIf - :Else - browser←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'browser' - browser←{'"',(⍵~'"'),'" '}⍣(0<≢browser)⊢browser - :Select GetOperatingSystem ⍬ - :Case 'Win' - 'wsh'⎕WC'OLEClient' 'WScript.Shell' - :Trap 11 - :If 0=≢browser - {}wsh.Run Url - :Else - {}wsh.Run browser,Url - :EndIf - :Else - success←0 - :EndTrap - :Case 'Lin' - :Trap 11 - :If 0=≢browser - {}⎕SH'xdg-open ',Url,' /dev/null 2>&1 &' - :Else - {}⎕SH browser,' ',Url,' /dev/null 2>&1 &' - :EndIf - :Else - success←0 - :EndTrap - :Case 'Mac' - :Trap 11 - {}⎕SH'open Safari ',Url - :Else - success←0 - :EndTrap - :EndSelect - :EndIf - ∇ - - ∇ r←IsRunningAsAdmin;IsUserAnAdmin - ⍝ Tells whether this process is being "Run as Administrator" (Windows) or has sudo rights (others) - :Access Public Shared - :If 'Win'≡APLTreeUtils2.GetOperatingSystem'' - :Trap r←0 - r←⍎⎕NA'I Shell32|IsUserAnAdmin' - :EndTrap - :Else - r←{∨/' sudo '⍷' ',⍵,' '}⊃⎕SH'groups ',⎕AN - :EndIf - ∇ - - ∇ r←GetOperatingSystem dummy - :Access Public Shared - ⍝ Returns one of: "Win", "Mac", "AIX", "Lin".\\ - ⍝ Note that under Linux you might need more information. - r←3↑⊃'.'⎕WG'APLVersion' - ∇ - - ∇ r←Create_UUID;⎕RL - ⍝ Produces a UUID - :Access Public Shared - ⎕RL←+/⎕TS - r←'-'@(+\9,3⍴5)⊢(⎕D,⎕C ⎕A)[?36⍴16] - ∇ - - ∇ r←{type}Base64 txt;charset - :Access Public Shared - ⍝ Base64 encoding. `txt` must be a simple character vector.\\ - ⍝ `type` defaults to 1 which specifies the default alphabet: `[a-zA-z0-9+/=]`.\\ - ⍝ If you want a file and URL-save alphabet specify `type` as 2. Then `- is used instead of `+`, and `_` instead of `/`.\\ - ⍝ See [RFC 4648](http://www.rfc-editor.org/rfc/rfc4648.txt) for details.\\ - ⍝ Whitespace in `txt` is ignored on decode. - type←{0<⎕NC ⍵:⍎⍵ ⋄ 1}'type' - :If (,1)≡,type - charset←'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' - :ElseIf (,2)≡,type - charset←'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_' - :Else - 'Invalid left argument: "type" must be either 1 or 2'⎕SIGNAL 11 - :EndIf - :If ∧/('='~⍨∪txt)∊charset - r←charset base64 txt - :Else - r←charset base64'UTF-8'⎕UCS txt - :EndIf - ∇ - - ∇ r←{x}AtLeastVersion min - :Access Public Shared - ⍝ Returns 1 if the currently running version is at least `min`.\\ - ⍝ If the current version is 17.1 then:\\ - ⍝ `1 1 1 0 ←→ AtLeastVersion¨16 17 17.1 18`\\ - ⍝ You may specify a version different from the currently running one via `⍺`:\\ - ⍝ `1 1 0 0 ←→ 17 AtLeastVersion¨16 17 17.1 18` - x←{0<⎕NC ⍵:⍎⍵ ⋄ {⊃⊃(//)⎕VFI ⍵/⍨2>+\⍵='.'}2⊃'#'⎕WG'APLVersion'}'x' - 'Right argument must be length 1'⎕SIGNAL 11/⍨1≠≢min - r←⊃min≤x - ∇ - - ∇ r←{length}FormatDateTime ts;ts2;formatstring;bool;buffer - :Access Public Shared - ⍝ Formats the right argument (defaults to `⎕TS` if empty) as a string with 'YYYY-MM-DD hh:mm:ss by default\\ - ⍝ The right argument can be one of: - ⍝ * A single float (like 20120102030405) representing date and time. - ⍝ * A simple vector of length 6 or 7 representing a timestamp (`⎕TS`). - ⍝ * A matrix of either floats or vectors (length 6 or 7) representing a DateTime. - ⍝ Note that you cannot mix floats and time stamps.\\ - ⍝ If the right argument has not 7 but 6 or 3 elements, formatting is done accordingly.\\ - ⍝ Via the left argument the length can be set to - ⍝ ⍬, 3, 6 or 7; default is 6; ⍬ Accepts any length of the right argument which is 3, 6 or 7.\\ - ⍝ If the right argument is a... - ⍝ * simple vector, a string is returned. - ⍝ * matrix, a matrix is returned. - :If 645≡⎕DR ts - :If (⍴⍴ts)∊0 1 - :If 1=≢ts - ts←{0=≢,⍵:⍬ ⋄ ⎕ML←3 ⋄ ⍎¨(4 2 2 2 2 2/⍳6)⊂14 0⍕⍵}ts - :EndIf - :Else - ts←↑,{0=⍵:6⍴0 ⋄ v←14 0⍕⍵ ⋄ ⎕ML←3 ⋄ ⍎¨(4 2 2 2 2 2/⍳6)⊂v}¨ts - :EndIf - :EndIf - :If ⍬≡length←{2=⎕NC ⍵:⍎⍵ ⋄ 6}'length' - length←''⍴¯1↑⍴ts - :EndIf - :If ~0=≢ts - :If 2=⍴⍴ts - buffer←{⍵/⍨0<≢¨⍵~¨⊂' ' 0}↓ts - 'Invalid right argument: must be integer'⎕SIGNAL 11/⍨~326 163∊⍨∪⎕DR¨buffer - 'Invalid right argument: must not be negative'⎕SIGNAL 11/⍨∨/¯1∊¨×¨buffer - 'Invalid right argument: must be simple'⎕SIGNAL 11/⍨1≠∪≡¨buffer - :Else - 'Invalid right argument: must be integer'⎕SIGNAL 11/⍨~326 163∊⍨⎕DR ts - 'Invalid right argument: must not be negative'⎕SIGNAL 11/⍨¯1∊×,ts - 'Invalid right argument: must be simple'⎕SIGNAL 11/⍨1≠≡ts - :EndIf - :EndIf - :If 2=⍴⍴ts - ts2←length↑[2]ts - :Else - ts2←,[0.5]length↑{0=≢⍵:⎕TS ⋄ ts}ts - :EndIf - :Select ⊃length - :Case 3 - formatstring←'ZI4,<->,ZI2,<->,ZI2' - :CaseList 6 7 - formatstring←'ZI4,<->,ZI2,<->,ZI2,< >,ZI2,<:>,ZI2,<:>,ZI2' - :Else - 'Invalid left argument'⎕SIGNAL 11 - :EndSelect - bool←(ts2∨.≠' ')∧ts2∨.≠0 - r←bool⍀formatstring ⎕FMT(6⌊length)↑[2]bool⌿ts2 - :If 7=2⊃⍴ts2 - r←⊃(↓r),¨{0=⍵:'' ⋄ 0=≢⍵~' ':'' ⋄ '.',⍕⍵}¨ts2[;7] - :EndIf - :If 2≠⍴⍴ts - r←,r - :EndIf - ∇ - - base64←{ - ⎕IO←0 - ⍺←'' - chars←⍺ - bits←{,⍉(⍺⍴2)⊤⍵} ⍝ encode each element of ⍵ in ⍺ bits, - ⍝ and catenate them all together - part←{((⍴⍵)⍴⍺↑1)⊂⍵} ⍝ partition ⍵ into chunks of length ⍺ - - 0=2|⎕DR ⍵:'UTF-8'⎕UCS 2∘⊥∘(8∘↑)¨8 part{(-8|≢⍵)↓⍵}6 bits{(⍵≠64)/⍵}chars⍳⍵ - ⍝ decode a string into octets - - four←{ ⍝ use 4 characters to encode either - 8=≢⍵:'=='∇ ⍵,0 0 0 0 ⍝ 1, - 16=≢⍵:'='∇ ⍵,0 0 ⍝ 2 - chars[2∘⊥¨6 part ⍵],⍺ ⍝ or 3 octets of input - } - cats←⊃∘(,/)∘((⊂'')∘,) ⍝ catenate zero or more strings - cats''∘four¨24 part 8 bits ⍵ - } - -:EndClass diff --git a/-packages_dev/aplteam-APLTreeUtils2-1.1.3/apl-package.json b/-packages_dev/aplteam-APLTreeUtils2-1.1.3/apl-package.json deleted file mode 100644 index 133aefa..0000000 --- a/-packages_dev/aplteam-APLTreeUtils2-1.1.3/apl-package.json +++ /dev/null @@ -1 +0,0 @@ -{ api: "APLTreeUtils2", assets: "", date: 20210407.185839, description: "General utilities required by most members of the APLTree library", documentation: "", group: "aplteam", io: 1, lx: "", maintainer: "Kai Jaeger ", minimumAplVersion: "18.0", ml: 1, name: "APLTreeUtils2", os_lin: 1, os_mac: 1, os_win: 1, project_url: "https://github.com/aplteam/APLTreeUtils2", source: "APLTreeUtils2.aplc", tags: "utilities", uri: "https://tatin.dev/", version: "1.1.3+53", } diff --git a/-packages_dev/aplteam-CodeCoverage-0.9.4/CodeCoverage.aplc b/-packages_dev/aplteam-CodeCoverage-0.9.4/CodeCoverage.aplc deleted file mode 100644 index 7e8fa1f..0000000 --- a/-packages_dev/aplteam-CodeCoverage-0.9.4/CodeCoverage.aplc +++ /dev/null @@ -1,924 +0,0 @@ -:Class CodeCoverage -⍝ # The class `CodeCoverage` -⍝ This class offers methods to watch certain parts of the workspace for being executed, probably as part of executing -⍝ a test framework like [https://github.com/aplteam/Tester2](`Tester2` "Link to Tester2 on GitHub"), although checking -⍝ on code coverage by just running an application can make sense as well, in particular with legacy code.\\ -⍝ For that the following steps need to be executed: -⍝ ## Prepare -⍝ * Instantiate `CodeCoverage` and specify a comma-separated list of namespaces and/or classes to be watched as argument -⍝ to `⎕NEW`. -⍝ * You might want to set the following two properties to make `CodeCoverage` fit your needs: -⍝ * `ignore`: comma-separated list of fully qualified names of functions, operators, namespaces and scripts to be -⍝ ignored. -⍝ * `filename`: name used for saving the data (with the extension .DCF) and also the HTML report (with the -⍝ extension .HTML).\\ -⍝ The collected data and the list of namespaces/classes to be watched can be referenced as `data` and -⍝ `watch` but _not_ set: they are read-only instance properties.\\ -⍝ ## Executing the code -⍝ You neeed to call the `Start` method before you execute any code that shall be watched for coverage. Assuming that -⍝ the instance created was assigned to `C` then call `C.Start ⍬`.\\ -⍝ Once all the code you are interested in has been executed call `C.Stop ⍬`.\\ -⍝ When the test framework is done execute `C.Finalise ⍬`.\\ -⍝ **Notes:** -⍝ * You may well restart and stop again as many times as you like. This can be useful to avoid `⎕PROFILE` to collect -⍝ data while a test framework is running rather than the application you are interested in: `⎕PROFILE` is expensive! -⍝ * You may run the test framework again, say on a different platform: if the `filename` property points to an already -⍝ existing component file, additional data is added by appending more components. -⍝ * The first component self-documents such a DCF file.\\ -⍝ ## Producing a report -⍝ In order to produce a meaningful report call the shared method `CodeCoverage.ProcessDataAndCreateReport` and -⍝ pass `C.filename` (or a character vector that holds the filename) as right argument.\\ -⍝ This method will aggregate the data, massage it, process it and finally create an HTML report from it.\\ -⍝ Note that by default the report is not verbose, meaning that only the (fully qualified) names of all functions -⍝ and operators that were not executed at all and all the names of functions and operators that have only been partly -⍝ executed are reported together with the lines not executed and the total number of lines.\\ -⍝ This is a good starting point. Usually that results in expanding the list of stuff to be ignored, adding more -⍝ test cases, deleting blocks of code that became superfluous etc.\\ -⍝ However, at one point or another you want the full details: for that just add a 1 as left argument when calling -⍝ `CodeCoverage.ProcessDataAndCreateReport`. Now the canonical representations of all functions and operators that are -⍝ only partly covered will become part of the report. The lines that weren't executed are highlighted (bold) and carry -⍝ a right-pointing arrow on the left.\\ -⍝ ## Restrictions and flaws -⍝ * For the time being nested namespaces/classes are not processed. This restriction might be lifted in a future release. -⍝ * Named dfns that are kept local inside a traditional function are not processed correctly. This is a consequence of a -⍝ flaw of `⎕PROFILE`. Without changing `⎕PROFILE` this cannot be overcome.\\ -⍝ This class is part of the APLTree Open Source project.\\ -⍝ Home page: \\ -⍝ Kai Jaeger - - ⎕IO←1 ⋄ ⎕ML←1 - - :Field Public Shared Info←'' ⍝ Stricly speaking this should not be shared, but then CodeCoverage should not run in multiple instances anyway - - ∇ r←Version - :Access Public Shared - r←'CodeCoverage' '0.9.4+52' '2022-12-12' - - ∇ - - ∇ History - :Access Public Shared - ⍝ * 0.9.4 from 2022-12-12 - ⍝ * Reports which edition of the interpreter a test was run on - ⍝ * Precaution against code changes while accumulating test results: a warning is shown in the session if differences were found - ⍝ * Runs under classic (no guarantees!) - ⍝ * When filtering the table the listings below the table are updated to only show code of functions matching the filter - ⍝ * 0.9.3 from 2022-10-06 - ⍝ * When `Finalise` was called without calling `Stop` the result appeared to be wrong. Is now called implicitly by `Finalise`. - ⍝ * Destructor added that executes `⎕PROFILE 'clear'` - ⍝ * 0.9.2 from 2022-09-19 - ⍝ * Couple of bug fixes - ⍝ * Typo fixed (Finalyse => Finalise) - ⍝ * Rearranged a few lines to avoid VALUE ERROR in CreateReport if no data was gathered - ⍝ * Start: ⎕PROFILE'clear' added - ⍝ * 0.9.1 from 2021-10-28 - ⍝ * Sort order of first column of the "Partly covered" category reversed. - ⍝ * 0.9.0 from 2021-10-06 - ⍝ * The table on coverage reports now on ALL fns (including 0% and 100%). Dedicated buttons allow selection of a category. - ⍝ a search field helps to navigate the table. re-ordering (click a col-header) is also supported. - ⍝ * 0.8.0 from 2021-05-27 - ⍝ * In the extended report the coverage percentage is now shown for each function - ⍝ * Field `Info` added. If not empty the text is added to the HTML right after the

- ⍝ * Bug fixes: - ⍝ * ⎕SE in mixed case and lowercase lead to wrong reports - ⍝ * Typo in message fixed - ⍝ * "&" was transformed into "&" (missing ";") - ⍝ * was not closed - ⍝ * was closed twice, but never opened - ⍝ * 0.7.3 from 2021-05-26 - ⍝ * Bug fix: single report failed on a new file due to cnfusion about number of reserved components: 9 rather than 10. - ⍝ * Test cases added - ⍝ * Minor cosmetic changes - ⍝ * 0.7.2 from 2021-03-01 - ⍝ * Package file corrected - ⍝ * 0.7.1 from 2020-12-20 - ⍝ * Bug fix: `NamesInScript` might crash on an {each}-operation on an empty vector - ⍝ * 0.7.0 from 2020-12-17 - ⍝ * For every test run a row is appended onto component number xx. It conains three pieces of information: - ⍝ 1. Version of Dyalog and which OS - ⍝ 2. Timestamp of execution - ⍝ 3. `⎕WA` in MB - ⍝ * Function `Finalyze` renamed to `Finalise` - ⍝ * A function operand passed to an operator cause CodeCoverage to crash. This is caused by assigned (derived) - ⍝ function definitions - ⍝ * Documentation corrected and enhanced - ⍝ * 0.6.1 from 2020-09-16 - ⍝ * Some minor bug fixes: - ⍝ * In case the directory supposed to hold the report does not exist `CodeCoverage` now attenpts to create it. - ⍝ * Creating the HTML report crashed under some circumstances (empty array). - ⍝ * 0.6.0 from 2020-09-04 - ⍝ * This version requires at least version 18.0 of Dyalog - ⍝ * Property Getters and Setters are now reported (lifted restriction) - ⍝ * Bug fix: `ignore` did not work as expected on ordinary namespaces. - ⍝ * 0.5.0 from 2020-07-14 - ∇ - - :Field Public Shared Readonly APL_Chars←'ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüþ0123456789∆⍙',⎕ucs (80=⎕dr' ')/9397+⍳26 - - ∇ make1(watch_) - :Access Public Instance - :Implements Constructor - :Access Public - _ignore←'' - :If ~(⊃watch_)∊'#⎕' - :AndIf 0<≢1↓⎕RSI - :AndIf 0<(⊃1↓⎕RSI).⎕NC watch_ - watch_←(⊃1↓⎕NSI),'.',watch_ - :EndIf - ⎕SIGNAL/{0∧.≠⍵:''⍬ ⋄ ('Not found: ',watch_)6}⎕NC watch_ - watch←'⎕se'⎕R'⎕SE'⍠('IC' 1)⊣watch_ - _filename←(739⌶0),'/CodeCoverage-',' '~⍨⍕⎕TS - _data←0 2⍴'' - ∇ - - ∇ Close - :Implements destructor - ⎕PROFILE'clear' - ∇ - - :Property data - ⍝ Matrix with two columns and as many rows as there are observations collected by `⎕PROFILE`.\\ - :Access Public Instance - ∇ r←Get - r←_data - ∇ - :EndProperty - - :Property ignore - ⍝ Either empty or a comma-separated list of fully qualified function, operator class and namespace names - ⍝ that should be ignored when the coverage report is compiled.\\ - ⍝ Note that in case it is an ordinary namespace this means that all objects in that namespace are ignored, - ⍝ incluuding all sub-namespaces. - :Access Public Instance - ∇ r←Get - r←','(≠⊆⊢),_ignore - ∇ - ∇ set value;v;b;v2;noOf - :If 0=noOf←+/∧\1=≡¨value.NewValue - v←∊value.NewValue - :Else - v←(⊃{⍺,',',⍵}/noOf↑value.NewValue),noOf↓value.NewValue - :EndIf - 'Must be character vector'⎕SIGNAL 11/⍨' '≠1↑0⍴v - ('Has invalid characters',b/v)⎕SIGNAL 11/⍨∨/b←~v∊APL_Chars,',⎕#.' - v2←','(≠⊆⊢),v - :If ∨/~b←0<⎕NC⊃v2 - 11 ⎕SIGNAL⍨'Unknown names: ',⊃{⍺,',',⍵}/(~b)/v2 - :EndIf - _ignore←v - ∇ - :EndProperty - - :Property watch - ⍝ Comma-separated list of namspaces and/or classes that are going to be watched for coverage, - :Access Public Instance - ∇ r←Get - r←_watch - ∇ - ∇ set value;v;b;v2 - v←∊value.NewValue - 'Must be character vector'⎕SIGNAL 11/⍨' '≠1↑0⍴v - ('Has invalid characters',b/v)⎕SIGNAL 11/⍨∨/b←~v∊APL_Chars,',⎕#.' - v2←','(≠⊆⊢),v - :If ∨/~b←0<⎕NC↑v2 - 11 ⎕SIGNAL⍨'Unknown names: ',⊃{⍺,',',⍵}/(~b)/v2 - :EndIf - _watch←v2 - ∇ - :EndProperty - - :Property filename - :Access Public Instance - ⍝ By default `filename` is a temp file. However, you may specify your own filename here, with or without - ⍝ file extension.\\ - ⍝ Note that this name would also be used for creating the HTML file, just with a different extension. - ∇ r←get - r←_filename - ∇ - ∇ set value;v - v←value.NewValue - 'Invalid depth'⎕SIGNAL 11/⍨~(≡v)∊0 1 - 'Must be a character vector'⎕SIGNAL 11/⍨' '≠1↑0⍴∊v - _filename←⊃,/2↑⎕NPARTS v - ∇ - :EndProperty - - ∇ htmlFilename←{verbose}ProcessDataAndCreateReport filename;details;watch;dcfFilename - ⍝ Takes the name of a component file that was created by first instatiating `CodeCoverage` and then calling - ⍝ the instance methods `Start`, `Stop` and `Finalise`.\\ - ⍝ The components holding the `⎕PROFILE` data (10 and running) are then read, aggregated, massaged and - ⍝ finally saved in the tenth component.\\ - ⍝ Then a report is created from the aggregated data and saved on disk. - ⍝ `filename` is used for both, identifying the DCF file and the HTML, just the extensions are different.\\ - ⍝ The optional left argument `verbose` defaults to 0, meaning that the code of the functions and operators - ⍝ that are only partly covered is not going to be listed.\\ - ⍝ However, by specifying a 1 as left argument you can force the canonical representations of those functions - ⍝ and operators to become part of the report with all lines that were not executed highlighted.\\ - ⍝ Note that this function can be called more than once on the same component file. It just wastes some ressources - ⍝ on calculating the result again, which is not necessary. However, as long as the number of functions and operators - ⍝ is not very large that does not matter much. If it does matter then call `ProcessData` and `CreateReport` instead: - ⍝ that is all this function is doing anyway. - :Access Public Shared - dcfFilename←(⊃,/2↑⎕NPARTS filename),'.dcf' - 'File not found'⎕SIGNAL 11/⍨0=⎕NEXISTS dcfFilename - verbose←{0=⎕NC ⍵:0 ⋄ ⍎⍵}'verbose' - {}ProcessData dcfFilename - htmlFilename←verbose CreateReport filename - ∇ - - ∇ filename←{verbose}CreateReport filename;html;tally;caption;b;buff2;linkAndName;buff3;dcfFilename;tno;watched;data;watch;ignore;align;runs;buff - ⍝ This function creates an HTML file with a coverage report from the data collected while executing - ⍝ one or more test suites or running an application.\\ - ⍝ You must call `ProcessData` first: this function relies on the data being aggregated.\\ - ⍝ If the file extension of `filename` is not ".html" this is enforced.\\ - ⍝ The optional ⍺ (`verbose`) defaults to 0, meaning that no code listings are part of the report. - :Access Public Shared - dcfFilename←(⊃,/2↑⎕NPARTS filename),'.dcf' - 'File not found'⎕SIGNAL 11/⍨0=⎕NEXISTS dcfFilename - tno←dcfFilename ⎕FSTIE 0 - watched←⎕FREAD tno,2 - data←⎕FREAD tno 10 - watch←⎕FREAD tno 2 - ignore←⎕FREAD tno 3 - runs←⎕FREAD tno 4 - ⎕FUNTIE tno - verbose←{0<⎕NC ⍵:⍎⍵ ⋄ 0}'verbose' - html←'' - html,←⊂'' - html,←⊂'' - html,←⊂'' - html,←⊂'Coverage' - html,←⊂'' - html,←⊂'' - ⍝ Download package with all needed components from DataTables CDN - html,←⊂'' - html,←⊂'' - html,←⊂'' - html,←⊂'' - html,←⊂'

Coverage Report

' - :If 0<≢Info - html,←⊂'

',(ExchangeHtmlSpecialChars Info),'

' - :EndIf - :If 0=≢data - html,←⊂'

Nothing to report at all

' - :Else - tally←≢data[;4] - caption←⊃,/{⍺,', ',⍵}/watched - html,←⊂'

Watched: ',(⍕tally),' fns/opr within ',caption,'

' - :If 1=≢runs - html,←⊂'

The test suite was executed once:

' - :Else - html,←⊂'

The test suite was executed ',(⍕≢runs),' times:

' - :EndIf - html,←⊂'' - html,←⊂'' - html,←⊂{'',(⊃,/{''}¨⍵),''}'Executed at' 'APLVersion' 'Memory (MB)' - html,←⊂'' - html,←⊂'' - html,←{'',(⊃,/{''}¨⍵),''}¨↓runs - html,←⊂'' - html,←⊂'
',⍵,'
',⍵,'
' - :If 0<≢∊data[;2 4] - html,←⊂'

Overall ',(⍕⌊0.5+100×÷/+⌿≢¨data[;2 4]),'% of the testable code is covered.

' - html,←⊂'

(Comment lines, empty lines, all :End* lines etc. are ignored)

' - :EndIf - html,←⊂'

',(⍕data[;3]+.=100),' of the fns/opr are 100% covered.

' - b←~data[;3]∊0 100 - data←{⍵[⍋⍵[;3];]}data - html,←⊂'
' - html,←⊂'' - html,←⊂'' - align←'left' 'left' 'left' 'right' - html,←⊂{'',⍵,''}⊃,/align{''}¨'Function/Operator' 'Lines not executed' 'Coverage' '≢' - html,←⊂'' - html,←⊂'' - :If 0<≢buff←((≢data),3)⍴0 - data[;2]←data[;4]~¨data[;2] ⍝ From "executed" to "not executed" - buff[;1]←{4>≢⍵:{0=≢⍵:⍵ ⋄ ⊃{⍺,', ',⍵}/⍵}⍕¨⍵ ⋄ (⍕≢⍵),'←≢',Shorten ⍵}¨data[;2] - buff[;2]←data[;3] - buff[;3]←⍕∘≢¨data[;4] - :If verbose - linkAndName←data[;1]{'',⍺,''}∘⍕¨⍳≢data - buff3←linkAndName{''}¨↓buff - :Else - buff3←data[;1]{''}¨↓buff - :EndIf - html,←(↓buff){'',⍵,''}¨buff3 - :EndIf - html,←⊂'' - html,←⊂'
',⍵,'
',⍺,'',(1⊃⍵),'',(⍕2⊃⍵),'',(3⊃⍵),'',⍺,'',(1⊃⍵),'',(⍕2⊃⍵),'',(3⊃⍵),'
' - html,←⊂'
' - html,←AddJavaScript buff - :If verbose - html,←⊂'

Listings

' - html,←CreateListingForFnsAndOpr data - :EndIf - :EndIf - html,←⊂'' - html,←⊂'' - html,←⊂'' - html,←⊂'' - filename←(⊃,/2↑⎕NPARTS filename),'.html' - (⊂html)⎕NPUT filename 1 - ∇ - - ∇ html←AddJavaScript data - html←'' - →(0=≢data)/0 - html,←⊂'' - ∇ - - ∇ html←AddJavaScriptButton(caption percent noOf search) - html←'' - html,←⊂' {' - html,←⊂' text: "',caption,' (',(⍕noOf),')",' - html,←⊂' titleAttr: "',percent,'",' - html,←⊂' className: "active",' - html,←⊂' action: function ( e, dt, node, config ) {' - html,←⊂' var text = this.text();' - html,←⊂' var search = "',search,'";' - html,←⊂' oTable.column(2)' - html,←⊂' .search(search,true,false,false)' - html,←⊂' .draw();' - html,←⊂' $(".dt-buttons button").removeClass("active");' - html,←⊂' this.active( true );' - html,←⊂' }' - html,←⊂' },' - ∇ - - ∇ {(details watch)}←ProcessData filename;tno;watched;data;b;details;where;wi;dcfFilename;ignore - ⍝ Takes the name of a component file that was created by calling `Start`, `Stop` and `Finalise`.\\ - ⍝ The components are read, aggregated and massaged and finally saved in the tenth component, - ⍝ but the aggregated data is also returned as a shy result together with what has been watched. - :Access Public Shared - dcfFilename←(⊃,/2↑⎕NPARTS filename),'.dcf' - 'File not found'⎕SIGNAL 11/⍨0=⎕NEXISTS dcfFilename - tno←dcfFilename ⎕FSTIE 0 - watched←⎕FREAD tno,2 - details←watch←⍬ - :If 0<≢∊data←tno{⎕FREAD ⍺,⍵}¨9↓⍳-/⌽2↑⎕FSIZE tno - watch←⎕FREAD tno 2 - ignore←⎕FREAD tno 3 - data←⊃⍪/data - data[;2]←(data[;2]∊¨data[;4])/¨data[;2] - details←data[;1]{(⊃⍺)(∪⊃,/⍵)}⌸data[;2] - where←data[;1]⍳details[;1] - details,←data[where;3 4] - details(RemoveToBeIgnored)←ignore - b←details[;3]≠100 - :If 0<≢b - :AndIf ∨/b - (b/details[;3])←100⌊⌊0.5+100×÷/≢¨b⌿details[;2 4] ⍝ Recalculate percentage - :EndIf - details ⎕FREPLACE tno 10 - :EndIf - ⎕FUNTIE tno - ∇ - - ∇ r←Finalise dummy;names;details;i;name;row;linesCovered;body;lines;bool;regExPattern;filename;tno;d;buff;crF;crX;crT;crN;fileM;bodyC;t∆ - ⍝ Call this once all the code you want to check on has been executed`.\\ - ⍝ It investigates all functions and operators that are only partly covered, and saves the lines that - ⍝ have been executed as well as the lines that could have been executed.\\ - ⍝ For the latter a number of lines are ignored, for example empty lines, comment lines and all lines - ⍝ that carry non-meaningful lines (with regard to being executed), like all `:End*` lines etc.\\ - ⍝ Note that the collected data is appended to the DCF file associated with the instance. Therefore - ⍝ you can move the DCF file to another platform and run the code under the supervision of `CodeCoverage` - ⍝ again, for example. - :Access Public Instance - r←⍬ - {Stop ⍵}⍣(~⊃∆STOPPED)⊣⍬ - _data←_data[;1]{(⊃⍺)(∪⊃,/⍵)}⌸_data[;2] - names←CollectDataForCoverageReport _watch - details←0 4⍴⍬ - regExPattern←'^ *:else$' '^ *:section$' ⍝ Lines that contain just these patterns... - regExPattern,←'^ *:access ' '^ *:field ' '^ *:attribute' ⍝ ... or these are to be ignored. - regExPattern,←⊂'^ *:end[a-zA-Z]*$' ⍝ All sorts of :End* statements are not of interest either - regExPattern,←⊂'^ *:implements' - regExPattern,←⊂'^ *:signature' - regExPattern,←⊂'^ *:section' - filename←(⊃,/2↑⎕NPARTS _filename),'.dcf' - crF←(∊2↑⎕NPARTS filename),'-CR.dcf' ⍝ this file has the CRs of everything we watched - :If crX←⎕NEXISTS crF - crT←crF ⎕FTIE 0 - crN←⎕FREAD crT,1 ⍝ the list of names for which we have CRs in component 1+index - :Else - crT←crF ⎕FCREATE 0 - crN←⍬ - ⍬ ⎕FAPPEND crT - :EndIf - - :For i :In ⍳≢names - name←i⊃names - :If (≢_data)≥row←_data[;1]⍳⊂name - linesCovered←2⊃_data[row;] - :Else - linesCovered←⍬ - :EndIf - - :If {~3 4∊⍨10×⍵-⌊⍵}⎕NC⊆name ⍝ Ignore derived functions and derived operators - :AndIf 2≠|≡buff←180⌶name ⍝ For weird staff (like function operands of an operator) we need to check - :If 0=≢body←{⍵↓⍨-+/∧\' '=⌽⍵}¨↓buff ⍝ True for localized dfns - ⍝ ---------- TODO - ⍝ ∘∘∘ ⍝TODO⍝ We cannot get the body of that dfn with ⎕CR or 180⌶, so we need to take other measures. - ⍝ ---------- - :EndIf - :If crX - :If (⊂name)∊crN - :If ~body CompareCR bodyC←⎕FREAD crT,1+crN⍳⊂name - fileM←(∊2↑⎕NPARTS _filename),'_mismatches' - t∆←{0::⍵ ⎕FCREATE 0 ⋄ ⍵ ⎕FTIE 0}fileM - (body bodyC)⎕FAPPEND t∆ - ⎕FUNTIE t∆ - ⎕←'Current definition of function "',name,'" does not match the one captured earlier - do not trust the results' ⍝ ⎕SIGNAL?! - :EndIf - :Else - ⎕←'Found new function "',name,'" that was not captured in previous runs - do not trust the results!' - :EndIf - :Else - crN,←⊂name - body ⎕FAPPEND crT - :EndIf - body←'''[^'']*'''⎕R''⍠('Greedy' 0)⊣body ⍝ Remove text - body←'⍝.*$'⎕R''⍠('Greedy' 0)⊣body ⍝ Remove comments - lines←¯1+⍳≢body - :If '}'=⊃{⍵↓⍨+/∧\' '=⍵}⊃¯1↑body ⍝ Is it possibly a dfn? (⎕NC does only work on stuff that's not part of a class!) - :AndIf ∨/(({⍵↑⍨1+-{⍵⍳'.'}⌽⍵}name),'←{')⍷1⊃body ⍝ First line carries ←{ - then it must be a dfn - :AndIf (,'}')≡¯1↑' '~⍨⊃¯1↑body - (body lines)←(0=≢{⍵↓⍨⍵⍳'{'}⊃body)↓¨body lines ⍝ Drop first line if it is nothing but ←{ - (body lines)←(-(,'}')≡' '~⍨⊃¯1↑body)↓¨body lines ⍝ Drop last line if it is nothing but a closing "`}` - :Else - (body lines)←1↓¨body lines ⍝ Always drop first line in case of a tfn - bool←regExPattern∘{0=≢⍺ ⎕S 0⍠('IC' 1)('Greedy' 0)⊣⍵}¨body - bool∧←'}'≠⊃∘{⍵↓⍨+/∧\' '=⍵}¨body ⍝ Get rid of closing lines of local dfns - otherwise they will be reported - (body lines)←bool∘/¨body lines - :EndIf - (body lines)←(0<≢¨body~¨' ')∘/¨body lines ⍝ Remove empty lines - details⍪←name linesCovered(100-⌊0.5+100×(≢lines~linesCovered)÷≢lines)lines - :EndIf - - :EndFor - - details←('.'≠⊃¨¯1↑¨details[;1])⌿details - :If ~crX - crN ⎕FREPLACE crT,1 - :EndIf - ⎕FUNTIE crT - :If ⎕NEXISTS filename - tno←filename ⎕FSTIE 0 - (∪watch,⎕FREAD tno 2)⎕FREPLACE tno 2 - (∪ignore,⎕FREAD tno 3)⎕FREPLACE tno 3 - (({0=≢d←⎕FREAD tno 4:0 3⍴'' ⋄ d}⍬)⍪CollectInformation ⍬)⎕FREPLACE tno 4 ⍝ Old versions might still carry an empty forth component - details ⎕FAPPEND tno - ⎕FUNTIE tno - :Else - 3 ⎕MKDIR 1⊃⎕NPARTS filename - tno←filename ⎕FCREATE 0 - d←'' - d,←⊂'Documentation regarding the contents of this file' - d,←⊂(⍴1⊃d)⍴'-' - d,←⊂'* The first component contains this documentation' - d,←⊂'* The second one contains what has been watched; this will eventually be used to' - d,←⊂' compile the caption for the coverage report.' - d,←⊂'* The third component holds the names of functions and operators to be ignored.' - d,←⊂'* The fourth component holds a matrix with as many rows as test runs have been performed:' - d,←⊂' [;1] Timestamp ("YYYY-MM-DD hh:mm:ss")' - d,←⊂' [;2] The result of the "APLVersion" property + info about the edition' - d,←⊂' [;3] ⎕WA in KB' - d,←⊂'* Components five to nine are reserved' - d,←⊂'* The tenth one is originally empty. when "ProcessData" or "ProcessDataAndCreateReport"' - d,←⊂' is called the resulting data is written to this component.' - d,←⊂'After the tenth one all components carry a matrix with n rows and 4 columns. n is' - d,←⊂'determined by the number of fns/oprs involved. The columns:' - d,←⊂'[;1] The name of the function or operator' - d,←⊂'[;2] Either empty or a vector of line numbers there were *not* executed.' - d,←⊂' Empty in case none or all lines were executed.' - d,←⊂'[;3] Coverage percentage.' - d,←⊂'[;4] Total number of lines that can be expected to be tested.' - d ⎕FAPPEND tno - watch ⎕FAPPEND tno - ignore ⎕FAPPEND tno - (CollectInformation ⍬)⎕FAPPEND tno - tno{⍵ ⎕FAPPEND ⍺}¨(9-¯1+2⊃⎕FSIZE tno)⍴⊂'' ⍝ Fill up to the tenth component - details ⎕FAPPEND tno - ⎕FUNTIE tno - :EndIf - r←filename - ⍝Done - ∇ - - ∇ {r}←Start dummy - ⍝ Execute `⎕PROFILE'start' 'coverage'` - :Access Public Instance - r←⍬ - ⎕PROFILE'clear' - ⎕PROFILE'start' 'coverage' - ∆STOPPED←0 - ∇ - - ∇ {r}←Stop dummy;buff - ⍝ Stores all the data collected since `Start` has been called, and then executes `⎕PROFILE'clear'` - :Access Public Instance - r←⍬ - buff←(⎕PROFILE'data')[;1 2] - ⎕PROFILE'clear' - buff←(buff[;2]≢¨⊂⍬)⌿buff ⍝ Fns as such are not of any interest, only lines - _data⍪←(⊃∨/watch{((1+≢¨⍺)↑¨¨⊂⍵)∊¨⊂¨⍺,¨'.'}buff[;1])⌿buff ⍝ Drop everthing that's not watched - ∆STOPPED←1 - ∇ - -⍝ ------------------------ Private stuff - - ∇ html←CreateListingForFnsAndOpr partlyCovered;name;lines;body;width;html2;all;testable;where;buff;i;links;percent;crT;crN;crF - html←'' - links←'' - links,←'' - crF←(⊃,/2↑⎕NPARTS filename),'-CR.dcf' ⍝ this file has the CRs of everything we watched - :If ~⎕NEXISTS crF - ⎕←'Did not find file "',crF,'" with CRs collected by fn "Finalize" - will try to work without it' - crT←0 - :Else - crT←crF ⎕FTIE 0 - crN←⎕FREAD crT,1 - ⎕←'tied ',crF,' for listings' - :EndIf - :For i :In ⍳≢partlyCovered - (name lines percent testable)←partlyCovered[i;1 2 3 4] - :If (crT=0)∨~(⊂name)∊crN - body←{⍵↓⍨-+/∧\' '=⌽⍵}¨↓180⌶name - :Else - :If ~crT∊⎕FNUMS - body←⍬ - :Else - body←⎕FREAD crT,1+crN⍳⊂name - :EndIf - :EndIf - - :If 0<≢body - body←ExchangeHtmlSpecialChars body - (1⊃body)←{⍵↑⍨¯1+⌊/⍵⍳'⍝;'}1⊃body - width←≢⍕≢body - html2←((⊂(width-1)⍴' '),(width+4){⍺↑' [',(⍕⍵),']'}¨¯1↓⍳≢body),¨body,¨⊂'' - :If 0<≢lines - (⊃¨html2[lines+1])←'→' ⍝TODO⍝ Check! - :EndIf - buff←(≢body)⍴⊂'' - buff[lines+1]←⊂'' - html2←buff,¨html2 - (1⊃html2)←'
',1⊃html2 - html2,←⊂'
' - html2←(⊂'',name,(' — ',(⍕percent),'%'),links,''),html2 - html,←html2 - :Else - html2←⊂'
Could not get canonical representation.
' - html2←(⊂'',name,(' — ',(⍕percent),'%'),links,''),html2 - html,←html2 - :EndIf - :EndFor - ⎕FUNTIE crT - ∇ - - Shorten←{ - ⍝ '1-3,5,6-9,11' ← Shorten 1 2 3 5 6 7 8 9 11 - ⍺←'' - 0=≢⍵:¯1↓⍺ - n←+/∧\⍵=(⊃⍵)+¯1+⍳≢⍵ - 1=n:(⍺,(⍕⊃⍵),',')∇ 1↓⍵ - (⍺,({(⍕⊃⍵),'-',(⍕¯1↑⍵)}n↑⍵),',')∇ n↓⍵ - } - - ∇ r←GetScreenCss - r←'' - r,←⊂'@media screen{' - r,←⊂' html {background-color: #FFFFF0;}' - r,←⊂'body {' - r,←⊂' font-size: 16px;' - r,←⊂' font-family : Verdana, "Bitstream Vera Sans", "DejaVu Sans", Tahoma, Geneva, Arial, Sans-serif;' - r,←⊂' margin: 1em;' - r,←⊂'}' - r,←⊂'th, td {padding: 5px 10px;}' - r,←⊂'th {text-align: left;}' - r,←⊂'h1, h2, h3, h4, h5, h6 {color: #424242;}' - r,←⊂'h1 {font-size: 22px;}' - r,←⊂'h2 {font-size: 18px; margin-top: 2em; margin-bottom:0.3em;}' - r,←⊂'tbody tr:nth-child(even) {background-color: #F0F0F0;}' - r,←⊂'tbody tr:nth-child(odd) {background-color: #FAFAFA;}' - r,←⊂'th {background-color: #E6E6E6;color: #424242;}' - r,←⊂'table {border: silver 1px solid; font-size: 14px;font-family: APLFont, monospace;}' - r,←⊂'code , code a {font-size: 14px; font-family: APLFont, monospace;}' - r,←⊂'code.header {' - r,←⊂' font-size: 16px; ' - r,←⊂' font-family: APLFont, monospace; ' - r,←⊂' margin: 1.5em 0.5em 0 0.5em; ' - r,←⊂' padding:0;' - r,←⊂' display: block;' - r,←⊂'}' - r,←⊂'div.code-block {' - r,←⊂' border: 1px silver dashed;' - r,←⊂' background-color: #F2F2F2;' - r,←⊂' display: block;' - r,←⊂' margin: 0.5em 0.5em 0.5em 0.5em;' - r,←⊂' padding: 0.5em;' - r,←⊂'}' - r,←⊂'div.code-block.missing {' - r,←⊂' background-color: #fa605254;' - r,←⊂'}' - r,←⊂'div.code-block code {display: block; white-space: pre-wrap; margin:0; padding:0; word-wrap: break-word;}' - r,←⊂'.emphasize { font-weight: 800;}' - r,←⊂'ul li, ol li {margin: 0.7em 0.2em;}' - r,←⊂'.float-right {float:right;}' - r,←⊂'.no-underline { text-decoration :none;}' - r,←⊂'.top-links {font-size:20px; padding-left: 0.6em;}' - r,←⊂'.align-right {text-align: right;}' - r,←⊂'#footer hr {margin-top:1.5em;}' - r,←⊂'#footer p {margin-top:5px; padding-top:0; font-size: 9px;}' - r,←⊂'@font-face {' - r,←⊂' font-family: "APLFont";' - r,←⊂' src:' - r,←⊂' local("APL385 Unicode"),' - r,←⊂' url("https://misc.aplteam.com/apl385.ttf") format("truetype");' - r,←⊂'}' - r,←⊂'.info {border: 1px silver dashed; background-color: #F2F2F2;margin: 0.5em; padding: 0.5em;}' - r,←⊂'}' - ∇ - - ∇ r←GetPrintCss - r←'' - r,←⊂'@media print{@page {size: portrait}' - r,←⊂'@page {' - r,←⊂' margin: 1cm 1cm 1cm 1.75cm;' - r,←⊂' @bottom-right {' - r,←⊂' content: counter(page) " / " counter(pages);' - r,←⊂' }' - r,←⊂'}' - r,←⊂'body {' - r,←⊂' font: 12pt "Times New Roman", Times, serif;' - r,←⊂' line-height: 1.2;' - r,←⊂' /* CSS3 filter, at the moment Webkit only. Prefix it for future implementations */' - r,←⊂' -webkit-filter: grayscale(100%);' - r,←⊂' filter: grayscale(100%); /* future-proof */' - r,←⊂'}' - r,←⊂'h1 {font-size: 18pt;}' - r,←⊂'h2 {font-size: 16pt; margin-top: 10pt; margin-bottom: 3pt;}' - r,←⊂'th, td {padding: 2pt 3pt;}' - r,←⊂'th {text-align: left;background-color: #DBDBDB;}' - r,←⊂'tbody tr:nth-child(odd) {background-color: #EDEDED;}' - r,←⊂'table {' - r,←⊂' color-adjust: exact !important;' - r,←⊂' -webkit-print-color-adjust: exact !important;' - r,←⊂' print-color-adjust: exact !important;' - r,←⊂' font-size: 8pt;' - r,←⊂' font-family: APLFont, monospace;' - r,←⊂'}' - r,←⊂'div.keep-together {break-inside: avoid; break-before:auto;}' - r,←⊂'table {border: silver 1pt solid;}' - r,←⊂'code , code a {font-size: 8pt; font-family: APLFont, monospace;}' - r,←⊂'code.header {' - r,←⊂' font-size: 8pt;' - r,←⊂' font-family: APLFont, monospace;' - r,←⊂' margin: 7pt 3pt 0 10pt;' - r,←⊂' padding:0;' - r,←⊂' display: block;' - r,←⊂'}' - r,←⊂'div.code-block {' - r,←⊂' border: 1pt silver dashed;' - r,←⊂' background-color: #F2F2F2;' - r,←⊂' display: block;' - r,←⊂' margin: 4pt 4pt 4pt 4pt;' - r,←⊂' padding: 4pt;' - r,←⊂'}' - r,←⊂'div.code-block code {display: block; white-space: pre-wrap; margin:0; padding:0; word-wrap: break-word;}' - r,←⊂'.emphasize { font-weight: 800;}' - r,←⊂'a {text-decoration: none;color: black;}' - r,←⊂'ul li, ol li {margin: 8pt 3pt;}' - r,←⊂'.no-print {display:none;}' - r,←⊂'.align-right {text-align: right;}' - r,←⊂'#footer hr {margin-top:1.5em;}' - r,←⊂'#footer p {margin-top:5pt; padding-top:0; font-size: 6pt;}' - r,←⊂'@font-face {' - r,←⊂' font-family: "APLFont";' - r,←⊂' src:' - r,←⊂' local("APL385 Unicode"),' - r,←⊂' url("https://misc.aplteam.com/apl385.ttf") format("truetype");' - r,←⊂'}' - r,←⊂'.info {border: 1px silver dashed; background-color: #F2F2F2;margin: 8px; padding: 8px;}' - r,←⊂'}' - ∇ - - ∇ names←CollectDataForCoverageReport watch;this;ref;list;isScripted;this2;ref2 - ⍝ Determins all objects to be observed together with the number of lines. - names←'' - :For this :In ,⊆watch - ref←⍎this - :If IsScripted ref - names,←(⊂this,'.'),¨NamesInScript ref - :Else - names,←(⊂this,'.'),¨' '~¨⍨↓ref.⎕NL 3 4 - :If 0<≢list←ref.⎕NL 9 - list←' '~¨⍨↓list - isScripted←IsScripted¨ref⍎¨list - :For this2 :In isScripted/list - ref2←ref⍎this2 - :If (⍕ref2)≡this,'.',this2 ⍝ Ignore references - names,←(⊂this,'.',this2,'.'),¨NamesInScript ref2 - :EndIf - :EndFor - :If 0<≢list←(~isScripted)/list - :AndIf 0<≢list←({⍵≡⍕⍎⍵}¨(⊂this,'.'),¨list)/list ⍝ Ignore references - names,←⊃,/CollectDataForCoverageReport¨(⊂this,'.'),¨list - :EndIf - :EndIf - :EndIf - :EndFor - ∇ - - ∇ r←NamesInScript ref;body;options;b;tfns;dfns;b2;bodies - :Access Public Shared - ⍝ Takes a ref pointing to a class or interface script and returns the names of all functions and operators - ⍝ within that script.\\ - ⍝ Has two limitations: - ⍝ * Cannot process nested classes and nested namespaces. - ⍝ * Might well mistake a variable name as the name of a dfn.\\ - r←'' - body←⎕SRC ref - body←'''[^'']*'''⎕R''⊣body ⍝ Get rid of everything between quotes - body←'⍝.*$'⎕R''⊣body ⍝ Get rid of comments - options←('IC' 1)('Greedy' 0)('DotAll' 1)('Mode' 'D') - r,←options GeterAndSetterNames body ⍝ Extract the names of all getters and setters (if any) - body←':Property .*:EndProperty'⎕R''⍠options⊣body ⍝ Remove Properties (because they carry `∇`!) - body←¯1↓1↓(~body∧.=¨' ')/body ⍝ Remove first, last and all empty lines - body←'^ {5,}∇.*$'⎕R''⊣body ⍝ Remove recursive ∇ calls that stand on their own - b←'∇'∊¨body ⍝ Which lines carry a ∇? - ((b\{{1=≢⍵:0 ⋄ '∇'≠⊃⍵}⍵~' '}¨b/body)/body)←' ' ⍝ Remove all other recursive ∇ calls - body↓¨⍨←{+/∧\' '=⍵}¨body ⍝ Drop all leading spaces - b←'∇'=⊃¨body ⍝ All lines that start with a nabla - tfns←b/body ⍝ Trad fns headers - tfns←1↓¨tfns ⍝ Remove the nablas - tfns←((≢tfns)⍴1 0)/tfns ⍝ Remove every second line: those are the closing ones - tfns←{'←'∊⍵:⍵↓⍨⍵⍳'←' ⋄ ⍵}¨tfns ⍝ Remove all explicit results - tfns←{'{'∊⍵:⍵↓⍨⍵⍳'}' ⋄ ⍵}¨tfns ⍝ Remove optional left argument - tfns←{⍵↓⍨+/∧\' '=⍵}¨tfns ⍝ Remove all leading spaces - tfns←{⍵/⍨~' '⍷⍵}¨tfns ⍝ Remove all multiple spaces - tfns←{⍵↓⍨{-+/∧\' '=⍵}⌽⍵}¨tfns ⍝ Remove all trailing spaces - :If ∨/b←'('=⊃¨tfns ⍝ These must be operators - (b/tfns)←{{⍵↑⍨¯1+⍵⍳')'}⍵↓⍨⍵⍳' '}¨b/tfns ⍝ Extract the operator names - :EndIf - tfns←'\([^)]+\)'⎕R' foo'⊣tfns ⍝ Replace anything betwen () by ` foo` = impersonate a simple ⍵ - :If 0<≢tfns←{2=' '+.=⍵:⍵↓⍨⍵⍳' ' ⋄ ⍵}¨tfns ⍝ Remove left arguments - r,←{⍵↑⍨¯1+⌊/⍵⍳' ;'}¨tfns ⍝ Name of all trad fns - :EndIf - :If 0<≢bodies←'∇[^∇]*∇'⎕S{⍵.Match}⍠options⊣body ⍝ Every trad fn must be investigated for any local dfns. - :AndIf 0<≢bodies←{(⎕UCS 10)~¨⍨(~(⎕UCS 13 10)⍷⍵)⊆⍵}¨bodies ⍝ Split them one-by-one - r,←{0=≢⍵:⍵ ⋄ ⊃,/⍵}EstablishDfns¨bodies ⍝ All dfns defined within tradfns - :EndIf - body←'∇[^∇]*∇'⎕R''⍠options⊣body ⍝ Wipe out all trad fns - body←(0<≢¨body~¨' ')/body ⍝ No empty lines - ⍝ --- Next two lines are future stuff - ⍝ dfns←EstablishDfns body ⍝ Extract the dfns (and dops of course) - ⍝ r,←∪dfns ⍝ Those might well be variable assignment, therefore ∪! - ∇ - - IsScripted←{16::0 ⋄ 1⊣⎕SRC ⍵} - - EstablishDfns←{ - ⍝ In case ⍺ is 1 just the names of all dfns (dops) found in ⍵ are returned. - ⍝ In case ⍺ is 0 only names that are localized are returned. - ⍺←1 - body←⍵ - dfns←(∨/¨'←{'∘⍷¨body)/body ⍝ Only lines that carry ←{ will survive - 0=≢dfns:'' - dfns←(0=≢¨1↓¨⊃¨{'\}(.*$)'⎕S{⍵.Match}⊣⍵}¨dfns)/dfns ⍝ Get rid of one-line unnamed dfns - 0=≢dfns:'' - dfns←{⍵↑⍨¯1+⍵⍳'←'}¨dfns ⍝ Assignments survive - dfns←(¯1≠⊃∘⎕NC¨dfns)/dfns ⍝ Get rid of what is an invalid name (those are variable assignments) - 0=≢dfns:'' - dfns~¨←' ' ⍝ Remove all spaces - ⍺:dfns - ∘∘∘ ⍝TODO⍝ - } - - ∇ r←options GeterAndSetterNames body;bool - r←'' - body←1↓⊃,/(⎕UCS 10),¨body - :If ∨/bool←':property'⍷⎕C body - r,←⊃,/body∘{'set_' 'get_',¨⊂(1+≢':propert')↓{⍵↑⍨¯1+⍵⍳⎕UCS 10}⍵↓⍺}¨{⍵/⍳≢⍵}bool - :EndIf - ∇ - - ∇ data←data RemoveToBeIgnored ignore;bool - ⍝ `ignore` is a nested vector with nanes. In case such a name identifies any APL object it is removed.\\ - ⍝ However, if an ordinary namespace is part of `ignore` then it won't appear in `data`. - ⍝ Therefore we identify container names in a second step and remove everything that belongs to such a container. - ⍝ That means it works recursively. - :If 0<≢ignore - :AndIf 0<≢data←(~data[;1]∊ignore)⌿data - bool←9=⊃∘⎕NC¨ignore - data←(⊃∧/data∘{⍵∘≢¨(≢⍵)↑¨⍺[;1]}¨((bool/ignore),¨'.'))⌿data - :EndIf - ∇ - - ∇ r←FormatDateTime ts - r←⊃'YYYY-MM-DD hh:mm:ss'(1200⌶)¯1 1 ⎕DT⊂ts - ∇ - - ∇ r←CollectInformation dummy;version;ts - ⍝ Collects information about the current test run. - ts←FormatDateTime ⎕TS - version←⊃{⍺,' ⋄ ',⍵}/# ⎕WG'APLVersion' - version,←' ⋄ ','Classic' 'Unicode'⊃⍨1+80=⎕DR' ' - r←1 3⍴ts version(' '~⍨,'K0G⊂ZZZ.ZZZ.ZZZ.ZZZ.ZZ9⊃'⎕FMT⌊⎕WA÷1024×1024) ⍝ MBs - ∇ - ∇ txt←ExchangeHtmlSpecialChars txt - ⍝ < => < ⋄ > => > ⋄ & => & - txt←(,¨'&<>')⎕R'\&' '\<' '\>'⊣txt - ∇ - - ∇ z←a CompareCR b;args;i;m;l - ⍝ compare two CRs taking into account that some symbols are replaced with ⎕Uxxxx when loaded into classic - ⍝ z=1: match, 0: did not match - ⍝--> this means that the final run which creates the report must be run on a Unicode interpreter, otherwise - ⍝ it will crash with errors because it can't deal with these characters... - :If {0::1 ⋄ 0⊣⎕UCS ⍵}8838 ⍝ do not even attempt to execute this on Classic! - z←1 - →0 - :EndIf - :If a≠⍥≢b ⍝ no of lines must match - z←0 - →0 - :Else - args←{1=≡⍵:↓⍵ ⋄ ⍵}¨a b - :For i :In ⍳2 - :For m :In ('(⎕u\d*)'⎕S 2⍠'IC' 1)i⊃args - :If m≢0 - l←(⎕IO+m)⊃i⊃args - l←('⎕u(\d*.)'⎕R{{(⎕UCS dec ¯1↓⍵),(' '≢⍥,¯1↑⍵)/¯1↑⍵}2↓⍵.Match}⍠'IC' 1)l - ((⎕IO+m)⊃i⊃args)←l - :EndIf - :EndFor - :EndFor - z←≡/args - :EndIf - ∇ - - ⍝ from dfns - dec←{⎕IO ⎕ML←0 1 ⍝ Decimal from hexadecimal - ⍺←0 ⍝ unsigned by default. - 1<⍴⍴⍵:⍺∘∇⍤1⊢⍵ ⍝ vector-wise: - 0=≢⍵:0 ⍝ dec'' → 0. - 1≠≡,⍵:⍺ ∇¨⍵ ⍝ simple-array-wise: - ws←∊∘(⎕UCS 9 10 13 32 160) ⍝ white-space? - ws⊃⍵:⍺ ∇ 1↓⍵ ⍝ ignoring leading and - ws⊃⌽⍵:⍺ ∇ ¯1↓⍵ ⍝ ... trailing blanks. - ∨/ws ⍵:⍺ ∇¨(1+ws ⍵)⊆⍵ ⍝ white-space-separated: - v←16|'0123456789abcdef0123456789ABCDEF'⍳⍵ ⍝ hex digits. - 11::'Too big'⎕SIGNAL 11 ⍝ number too big. - (16⊥v)-⍺×(8≤⊃v)×16*≢v ⍝ (signed) decimal number. - } - -:EndClass diff --git a/-packages_dev/aplteam-CodeCoverage-0.9.4/apl-package.json b/-packages_dev/aplteam-CodeCoverage-0.9.4/apl-package.json deleted file mode 100644 index 250af0e..0000000 --- a/-packages_dev/aplteam-CodeCoverage-0.9.4/apl-package.json +++ /dev/null @@ -1 +0,0 @@ -{ api: "CodeCoverage", assets: "", date: 20221212.172732, description: "Monitors which parts of an application got actually executed", documentation: "", group: "aplteam", io: 1, lx: "", maintainer: "", minimumAplVersion: "18.0", ml: 1, name: "CodeCoverage", os_lin: 1, os_mac: 1, os_win: 1, project_url: "https://github.com/aplteam/CodeCoverage", source: "CodeCoverage.aplc", tags: "code-coverage,test-framework,unit-tests", uri: "https://tatin.dev/", version: "0.9.4+52", } diff --git a/-packages_dev/aplteam-CommTools-1.0.1/CommTools.aplc b/-packages_dev/aplteam-CommTools-1.0.1/CommTools.aplc deleted file mode 100644 index 2b4c17f..0000000 --- a/-packages_dev/aplteam-CommTools-1.0.1/CommTools.aplc +++ /dev/null @@ -1,133 +0,0 @@ -:Class CommTools -⍝ Comes with a set of very simple communication tools designed to interact with the user via the session. -⍝ These tools are typically used by user commands, or their API's.\\ - - - :Field Public Shared ErrNo←811 - - ∇ r←Version - :Access Public Shared - r←'CommTools' '1.0.1+7' '2020-10-12' - ∇ - - ∇ History - :Access Public Shared - ⍝ * 1.0.1 from 2021-10-12 - ⍝ * Bug fix: API decleration was wrong - ⍝ * 1.0.0 from 2021-10-11 - ⍝ * First release - ∇ - - ∇ r←CR - r←⎕UCS 13 - ∇ - - ∇ yesOrNo←{default}YesOrNo question;isOkay;answer;add;dtb;answer2 - :Access Public Shared - ⍝ Asks a simple question and allows just "Yes" or "No" as answers.\\ - ⍝ You may specify a default via the optional left argument which when specified - ⍝ rules what happens when the user just presses . - ⍝ `default` must be either 1 (yes) or 0 (no).\\ - ⍝ You may inject CR into the question, making it a multi-line question.\\ - ⍝ Note that this function does NOT work as expected when traced! - isOkay←0 - default←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'default' - isOkay←0 - :If 0≠≢default - 'Left argument must be a scalar'⎕SIGNAL 11/⍨1≠≢default - :AndIf ~default∊0 1 - 'The left argument. if specified, must be a Boolean or empty'⎕SIGNAL 11 - :EndIf - :If 0=≢default - add←' (y/n) ' - :Else - :If default - add←' (Y/n) ' - :Else - add←' (y/N) ' - :EndIf - :EndIf - :If 1<≡question - ((≢question)⊃question)←((≢question)⊃question),add - question←⍪question - :Else - question←question,add - :EndIf - :Repeat - ⎕←'' - ⍞←question - answer←⍞ - :If answer≡question ⍝ Did ... (since version 18.0 trailing blanks are not removed anymore) - :OrIf (≢answer)=¯1+≢question ⍝ ... the ... - :OrIf 0=≢answer ⍝ ... user ... - :OrIf question≡(-≢question)↑answer ⍝ ... just ... - dtb←{⍵↓⍨-+/∧\' '=⌽⍵} - answer2←dtb answer - :OrIf answer2≡((-≢answer2)↑(⎕UCS 10){~⍺∊⍵:⍵ ⋄ ' ',dtb ⍺{⌽⍵↑⍨1+⍵⍳⍺}⌽⍵}question) ⍝ ... press ... - :OrIf answer≡{1↓⊃¯1↑(⍵∊⎕UCS 10 13)⊂⍵}(⎕UCS 10),question ⍝ ... ? - :If 0≠≢default - yesOrNo←default - isOkay←1 - :EndIf - :Else - answer←¯1↑{⍵↓⍨-+/∧\' '=⌽⍵}answer - :If answer∊'YyNn' - isOkay←1 - yesOrNo←answer∊'Yy' - :EndIf - :EndIf - :Until isOkay - ⍝Done - ∇ - - ∇ index←{x}Select options;flag;answer;question;value;bool;⎕ML;⎕IO;manyFlag;mustFlag;caption - :Access Public Shared - ⍝ Presents `options` as a numbered list and allows the user to select either exactly one or multiple ones.\\ - ⍝ One is the default.\\ - ⍝ The optional left argument allows you to specify more (positional) options: - ⍝ * `caption` is shown above the options. - ⍝ * `manyFlag` defaults to 0 (meaning just one item might be selected) or 1, in which case multiple items can be specified. - ⍝ * `mustFlag` forces the user to select at least one option. - ⍝ `options` must not have more than 999 items. - ⍝ If the user aborts by entering "q" (for "quit") `index` will be `⍬`. - x←{0<⎕NC ⍵:⊆⍎⍵ ⋄ ''}'x' - (caption manyFlag mustFlag)←x,(⍴,x)↓'' 0 0 - ⎕IO←1 ⋄ ⎕ML←1 - 'Invalid right argument; must be a vector of text vectors.'⎕SIGNAL ErrNo/⍨2≠≡options - 'Right argument has more than 999 items'⎕SIGNAL ErrNo/⍨999<≢options - flag←0 - :Repeat - ⎕←{⍵↑'--- ',caption,((0≠≢caption)/' '),⍵⍴'-'}⎕PW-1 - ⎕←⍪{((⊂'. '),¨⍨(⊂3 0)⍕¨⍳≢⍵),¨⍵}options - ⎕←'' - question←'Select one ',(manyFlag/'or more '),'item',((manyFlag)/'s'),' ' - question,←((manyFlag∨~mustFlag)/'('),((~mustFlag)/'q=quit'),((manyFlag∧~mustFlag)/', '),(manyFlag/'a=all'),((manyFlag∨~mustFlag)/')'),' :' - :If 0<≢answer←⍞,0/⍞←question - answer←(⍴question)↓answer - :If 1=≢answer - :AndIf answer∊'Qq',manyFlag/'Aa' - :If answer∊'Qq' - :If 0=mustFlag - index←⍬ - flag←1 - :EndIf - :Else - index←⍳≢options - flag←1 - :EndIf - :Else - (bool value)←⎕VFI answer - :If ∧/bool - :AndIf manyFlag∨1=+/bool - value←bool/value - :AndIf ∧/value∊⍳⍴options - index←value - flag←0≠≢index - :EndIf - :EndIf - :EndIf - :Until flag - index←{1<≢⍵:⍵ ⋄ ⊃⍵}⍣(⍬≢index)⊣index - ∇ - -:endclass diff --git a/-packages_dev/aplteam-CommTools-1.0.1/apl-package.json b/-packages_dev/aplteam-CommTools-1.0.1/apl-package.json deleted file mode 100644 index fab92e8..0000000 --- a/-packages_dev/aplteam-CommTools-1.0.1/apl-package.json +++ /dev/null @@ -1 +0,0 @@ -{ api: "CommTools", assets: "", date: 20221012.183357, description: "Communication tools for interactions in the session: YesOrNo and Select", documentation: "", group: "aplteam", io: 1, lx: "", maintainer: "kai@aplteam.com", minimumAplVersion: "18.0", ml: 1, name: "CommTools", os_lin: 1, os_mac: 1, os_win: 1, project_url: "https://github.com/aplteam/CommTools", source: "CommTools.aplc", tags: "communication-tools,yes-or-no,select-tool", uri: "https://tatin.dev/", version: "1.0.1+7", } diff --git a/-packages_dev/aplteam-DotNetZip-2.0.2/DotNetZip.aplc b/-packages_dev/aplteam-DotNetZip-2.0.2/DotNetZip.aplc deleted file mode 100644 index 38b35a1..0000000 --- a/-packages_dev/aplteam-DotNetZip-2.0.2/DotNetZip.aplc +++ /dev/null @@ -1,377 +0,0 @@ -:Class DotNetZip -⍝ Zipping and unzipping with .NET(Core) on Windows, Linux and Mac-OS.\\ -⍝ This class offers three shared methods: -⍝ * `ZipFolder` -⍝ * `UnzipTo` -⍝ * `ListZipContents`\\ -⍝ For more advanced features the class can also be instantiated.\\ -⍝ With `⎕NEW` either a new zip file is created or (by default) an existing one is opened. -⍝ This can be changed by passing an `overwrite` flag in addition to the name of the ZIP file.\\ -⍝ You can then use these instance methods: -⍝ * `Add` -⍝ * `Delete` -⍝ * `ExtractTo` -⍝ * `List` -⍝ * `Dispose`\\ -⍝ Once instantiated the read-only property `filename` carries the name of the ZIP file.\\ -⍝ Kai Jaeger - APL Team Ltd.\\ -⍝ Homepage: - - ⎕IO←1 ⋄ ⎕ML←1 - - ∆INIT←0 - - ∇ r←Version - :Access Public Shared - r←'DotNetZip' '2.0.2+67' '2022-05-31' - ∇ - - ∇ History - :Access Public Shared - ⍝ * 2.0.2 from 2022-05-31 - ⍝ * Bug fixed in "Delete" - ⍝ * 2.0.1 from 2022-05-20 - ⍝ * Bug fixed in "Delete" - ⍝ * Documentation fixed regarding `overwriteFlag` and `UnzipTo` - ⍝ * Test cases polished - ⍝ * 2.0.0 from 2022-05-18 - ⍝ * The constructor now checks whether .NET (core) is really available, and throws an error - ⍝ if it is not. - ⍝ * Documentation polished. - ⍝ * Now managed by Cider rather than acre. - ⍝ * 1.0.2 from 2021-03-01 - ⍝ * Problem with backslash as separator fixed - ⍝ * Package config corrected - ⍝ * 1.0.1 from 2021-01-10 - ⍝ * Paths are written to a ZIP file with / rather than \, no matter what the platform is. - ⍝ Only then can we be sure that it will work on Linux and Mac-OS due to bugs in many - ⍝ versions of .NET and .NET Core.\\ - ⍝ `ZipFolder` does not call the corresponding .NET method in order to overcome the \ bug. - ⍝ * The `Add` function now checks the existence of any file. Sometimes non-existent files - ⍝ did not cause the .NET call to crash. - ⍝ * 1.0.0 from 2020-09-21 - ⍝ * First official release. Requires Dyalog 18.0 and is delivered as a Tatin package - ∇ - - :Property filename - :Access Public Instance - ⍝ The name of the ZIP file - ∇ r←Get - r←_filename - ∇ - :EndProperty - - ∇ make1(zipFilename);overwriteFlag - ⍝ Constructor that takes just one argument: the name of the ZIP file.\\ - ⍝ If `zipFilename` already exists it is kind of opened. - :Access Public Instance - :Implements Constructor - overwriteFlag←0 - make zipFilename overwriteFlag - ⍝Done - ∇ - - ∇ make2(zipFilename overwriteFlag) - ⍝ Constructor that takes two arguments: - ⍝ * the name of the ZIP file - ⍝ * Boolean for `overwriteFlag`\\ - ⍝ `overwriteFlag` is used to determine whether the ZIP should be opened (0=default) - ⍝ or overwritten (1). - :Access Public Instance - :Implements Constructor - '"overwriteFlag" must be a Boolean'⎕SIGNAL 11/⍨~(⊂overwriteFlag)∊0 1 - make zipFilename overwriteFlag - ⍝Done - ∇ - - ∇ make(zipFilename overwriteFlag);stream - CheckMinVersion ⍬ - Initialize ⍬ - zipFilename←AddExtension F.ExpandPath zipFilename - QEX_System - :If F.Exists zipFilename - :AndIf 0=overwriteFlag - :Trap 90 - stream←System.IO.File.Open(zipFilename System.IO.FileMode.Open) - :Else - 99 ⎕SIGNAL⍨{⍵↓⍨1+⍵⍳':'}{⍵↑⍨¯1+⌊/⍵⍳⎕UCS 10 13}∊⍕⎕EXCEPTION - :EndTrap - _zip←QuadNEW System.IO.Compression.ZipArchive(stream System.IO.Compression.ZipArchiveMode.Update) - :Else - F.DeleteFile zipFilename - :Trap 90 - stream←System.IO.File.Open(zipFilename System.IO.FileMode.CreateNew) - :Else - 99 ⎕SIGNAL⍨{⍵↓⍨1+⍵⍳':'}{⍵↑⍨¯1+⌊/⍵⍳⎕UCS 10 13}∊⍕⎕EXCEPTION - :EndTrap - _zip←QuadNEW System.IO.Compression.ZipArchive(stream System.IO.Compression.ZipArchiveMode.Create) - _zip.Dispose - ⍝ `List` is not available in "Create" mode, so we re-open it - stream←System.IO.File.Open(zipFilename System.IO.FileMode.Open) - _zip←QuadNEW System.IO.Compression.ZipArchive(stream System.IO.Compression.ZipArchiveMode.Update) - :EndIf - _zip.⎕DF'[archive:',zipFilename,']' - _filename←zipFilename - ⍝Done - ∇ -⍝ ------------------------ Instance stuff - - ∇ {r}←{parent}Add toBeZipped;list;isDir - ⍝ Use this to add one or more files to the ZIP file.\\ - ⍝ `toBeZipped` specifies the full path (or full paths) of what's going to be zipped. That's what's going to be - ⍝ stored in the ZIP file.\\ - ⍝ If `toBeZipped` refers to a full path as in `C:\Foo.txt` or `/tmp/myfile` or, much more likely, refers to - ⍝ the current directory as in `./foo.txt` then there is no need to specify the optional left argument.\\ - ⍝ If however you want to store the file `C:\Projects\Foo\docs\ReadMe.txt`, but it should be saved in the ZIP - ⍝ file as `docs\ReadMe.txt`, then you must call `Add` like this: - ⍝ ``` - ⍝ `C:\Projects\Foo` myDotNetZip.Add `docs\ReadMe.txt` - ⍝ ``` - ⍝ Notes: - ⍝ * `parent` might or might not have a trailing separator, and `toBeZipped` might or might not have a - ⍝ leading separator: `Add` works that out. - ⍝ * While `parent`, if specified, must be a simple string, `toBeZipped` might be simple (single file) or nested, when - ⍝ every single item is treated as the name of a file or a folder.\\ - ⍝ Returns `⍬` (shy). - :Access Public Instance - r←⍬ - parent←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'parent' - parent←F.EnforceSlash{0=≢⍵:⍵ ⋄ ⍵,(~'/\'∊⍨¯1↑⍵)/F.CurrentSep}parent - :If (≡toBeZipped)∊0 1 - toBeZipped←{⍵↓⍨'/\'∊⍨1⍴⍵}toBeZipped - toBeZipped←F.EnforceSlash toBeZipped - :If F.IsDir parent,toBeZipped - :If 0<≢list←⊃('recursive' 1)F.Dir parent,toBeZipped,'/*' - :AndIf 0<≢list←(F.IsFile list)/list - list←(≢parent)↓¨list - list←F.EnforceSlash¨list - parent∘Add_¨list - :EndIf - :Else - parent Add_ toBeZipped - :EndIf - :Else - toBeZipped←{⍵↓⍨'/\'∊⍨1⍴⍵}¨toBeZipped - toBeZipped←F.EnforceSlash¨toBeZipped - isDir←F.IsDir parent∘,¨toBeZipped - :If ∨/~isDir - parent∘Add_¨(~isDir)/toBeZipped - :EndIf - :If ∨/isDir - parent∘Add¨isDir/toBeZipped - :EndIf - :EndIf - ∇ - - ∇ r←names ExtractTo folder;name;entry;writer;buff;zip;stream;rc;i;targetFilename;list;sep - ⍝ `names` is the name of one or more zipped objects (files or directories). - ⍝ Those will be extracted into `folder\`.\\ - ⍝ `names` may be simple (single object) or nested (vector of objects).\\ - ⍝ There must be no file or folder of the given name in the target folder, otherwise an error is thrown.\\ - ⍝ `r` is a vector of Booleans with the same lengths as `names`, carrying 1 for success and 0 otherwise. - ⍝ However, if `names` is or contains the name of a folder, the length of `r` may be smaller than the - ⍝ number of files and folders extracted. - ⍝ A typical reason for a failure is that a given file or folder does not exist in the ZIP file. - :Access Public Instance - names←,⊆names - r←(≢names)⍴0 - :For i :In ⍳≢names - name←F.EnforceSlash i⊃names - :If ⎕NULL≢entry←_zip.GetEntry⊂name - targetFilename←F.NormalizePath folder,'/',name - :Trap 90 - 'Create!'F.CheckPath 1⊃⎕NPARTS targetFilename - QEX_System - System.IO.Compression.ZipFileExtensions.ExtractToFile(entry targetFilename) - r[i]←1 - :Else - ⎕EXCEPTION.Message ⎕SIGNAL 11 - :EndTrap - :Else - :If 0<≢list←List - :AndIf 0<≢≢∪(1⊃¨⎕NPARTS list)~⊂'' - sep←('\'∊∊list)⌽'/\' - name←(sep[1]@(⍸name=sep[2]))name - :AndIf 0<≢list←(((1+≢name)↑[2]↑list)∧.=name,sep[1])/list - r[i]←⊃∨/list ExtractTo¨⊂folder - :EndIf - :EndIf - :EndFor - ∇ - - ∇ r←List;collection - ⍝ Lists the contents of the ZIP file. - :Access Public Instance - collection←⌷_zip.Entries - r←collection.ToString - ∇ - - ∇ {r}←Delete filenames;bool;toBeDeleted - ⍝ Delete one or more files from the ZIP.\\ - ⍝ Returns `⍬` (shy). - :Access Public Instance - r←⍬ - filenames←F.EnforceSlash¨⊆filenames - :If 0<+/bool←(⍕¨⌷_zip.Entries)∊F.EnforceSlash¨⊆filenames - toBeDeleted←bool/⌷_zip.Entries - toBeDeleted.Delete - :EndIf - ∇ - - ∇ {r}←Dispose - ⍝ Use this to close the `DotNetZip` instance.\\ - ⍝ Note that deleteting a instance of `DotNetZip` has the same effect as calling this method although the timing might differ - ⍝ Returns `⍬` (shy). - :Access Public Instance - r←⍬ - :If 0<⎕NC'_zip' - _zip.Dispose - ⎕EX'_zip' - :EndIf - ∇ - -⍝ ------------------------ Shared stuff - - ∇ Cleanup - :Implements Destructor - ⍝ Calls the `Dispose` method and deletes `_zip` - :Trap 6 90 - _zip.Dispose - :Case 90 - Assert'Cannot access a closed file.'≡⎕EXCEPTION.Message - :EndTrap - ⎕EX'_zip' - ∇ - - ∇ {r}←zipfile UnzipTo targetFolder - ⍝ Unzip `⍺` into `⍵`.\\ - ⍝ `targetFolder` must not yet exist. - :Access Public Shared - r←Initialize ⍬ - QEX_System - :Trap 6 - System.IO.Compression.ZipFile.ExtractToDirectory zipfile targetFolder - :Else - ⍝ Workaround for bug Mantis 18404 from 2020-08 - ⍝ The VALUE ERROR is not really a VALUE ERROR. This appears to happen only when `DotNetZip` is - ⍝ instanciated within `⎕SE`, then )CLEAR is issed and then `DotNetZip` is again instanciated within `⎕SE`. - ⎕EX'System' - System.IO.Compression.ZipFile.ExtractToDirectory zipfile targetFolder - :EndTrap - ⍝Done - ∇ - - ∇ {zipFilename}←sourceFolder ZipFolder zipFilename;fileList;myZip;F;∆INIT;b - ⍝ Takes a folder and zips it. `zipFilename` must not exist.\\ - ⍝ Returns the fully expanded name of `zipFilename`.\\ - ⍝ This is a workaround thats gets around the `\` problem on Linux and Mac-OS.\\ - ⍝ The "real" solution is available under the name `ZipFolder_` and can be brought back once - ⍝ Microsoft fixes the bug, which means probably not in the foreseeable future. - :Access Public Shared - ∆INIT←0 - Initialize ⍬ - sourceFolder,←((0<≢sourceFolder)∧~'/\'∊⍨¯1↑sourceFolder)/'/' - fileList←'recursive'F.ListFiles sourceFolder - fileList←(≢sourceFolder)↓¨fileList - :If ~∧/b←⎕NEXISTS sourceFolder∘,¨fileList - ('',⊃{⍺,',',⍵}/(~b)/fileList)Assert 0 - :Else - myZip←⎕NEW ⎕THIS(,⊂zipFilename) - sourceFolder∘myZip.Add¨fileList - zipFilename←myZip.filename - :EndIf - ∇ - - ∇ {targetFile}←sourceFolder ZipFolder_ targetFile - ⍝ Takes a folder and zips it. `target` must not exist.\\ - ⍝ Returns the fully expanded name of the `targetFile`. - ⍝ :Access Public Shared - Initialize ⍬ - targetFile←F.ExpandPath AddExtension targetFile - sourceFolder←F.ExpandPath sourceFolder - QEX_System - System.IO.Compression.ZipFile.CreateFromDirectory sourceFolder targetFile - ⍝Done - ∇ - - ∇ r←ListZipContents zipfile;myZip - :Access Public Shared - ⍝ Helper that instantiates the `DotNetZip` class temporarily just for the purpose of unzipping a zip file. - myZip←QuadNEW ⎕THIS(zipfile 0) - r←myZip.List - ∇ - -⍝ ------------------------ Private stuff ------------------- - - ∇ r←QuadNEW arg;success;counter;qdmx - ⍝ Attempts to be successful several times in case of "being used by another process" errors with - ⍝ increasingly long delays. This often occured when `DotNetZip` itself had just dealt with the zip file, - ⍝ and it almost always goes away after some tries. - success←counter←0 - :Repeat - :Trap 90 - r←⎕NEW arg - success←1 - :Else - qdmx←⎕DMX - :If ∨/'because it is being used by another process'⍷⍕⎕EXCEPTION - counter+←1 - ⎕DL 0.2×counter - :Else - qdmx.EM ⎕SIGNAL qdmx.EN - :EndIf - :EndTrap - :Until success∨10+\'.'=⍵}2⊃# ⎕WG'APLVersion' - } - - CheckMinVersion←{ - IfAtLeastVersion 17:shy←1 - 'This class requires at least version 17.0 of Dyalog APL'⎕SIGNAL 11 - } - - ∇ {r}←QEX_System - ⍝ Workaround for bug Mantis 18404 from 2020-08 - ⍝ The VALUE ERROR is not really a VALUE ERROR. This appears to happen only when `DotNetZip` is instanciated - ⍝ within `⎕SE`, then )CLEAR is issued and then again `DotNetZip` instanciated within `⎕SE`. - r←⎕EX'System' - ∇ - -:EndClass diff --git a/-packages_dev/aplteam-DotNetZip-2.0.2/apl-dependencies.txt b/-packages_dev/aplteam-DotNetZip-2.0.2/apl-dependencies.txt deleted file mode 100644 index a5ad3b7..0000000 --- a/-packages_dev/aplteam-DotNetZip-2.0.2/apl-dependencies.txt +++ /dev/null @@ -1,2 +0,0 @@ -aplteam-APLTreeUtils2-1.1.3 -aplteam-FilesAndDirs-5.1.5 diff --git a/-packages_dev/aplteam-DotNetZip-2.0.2/apl-package.json b/-packages_dev/aplteam-DotNetZip-2.0.2/apl-package.json deleted file mode 100644 index 5d00893..0000000 --- a/-packages_dev/aplteam-DotNetZip-2.0.2/apl-package.json +++ /dev/null @@ -1 +0,0 @@ -{ api: "DotNetZip", assets: "", date: 20220531.123346, description: "Zipping and unzipping with.NET Core on all major platforms", documentation: "", group: "aplteam", io: 1, lx: "", maintainer: "Kai Jaeger ", minimumAplVersion: "18.0", ml: 1, name: "DotNetZip", os_lin: 1, os_mac: 1, os_win: 1, project_url: "https://github.com/aplteam/DotNetZip", source: "DotNetZip.aplc", tags: "zip-tools", uri: "https://tatin.dev/", version: "2.0.2+67", } diff --git a/-packages_dev/aplteam-Execute-3.0.2/Execute.aplc b/-packages_dev/aplteam-Execute-3.0.2/Execute.aplc deleted file mode 100644 index 6652f1d..0000000 --- a/-packages_dev/aplteam-Execute-3.0.2/Execute.aplc +++ /dev/null @@ -1,445 +0,0 @@ -:Class Execute -⍝ This class allows you two different things: -⍝ * Start a process and catch its return code. -⍝ * Start an application and catch its standard output.\\ -⍝ The two goals are quite different and therefore handled by two -⍝ different methods: `Process` and `Application`.\\ -⍝ You would use `Application` in order to start... -⍝ * another instance of Dyalog from Dyalog. -⍝ * a console application from within Dyalog. -⍝ * any EXE from Dyalog. -⍝ * a batch script from Dyalog.\\ -⍝ When you need the actual output then you would use `Process`. Examples are:\ -⍝ * Get a list with a SubVersion command. -⍝ * Get a directory listing with the console DIR command.\\ -⍝ Note that if you specify `/` as a delimiter at the beginning then `Execute` -⍝ enforces `\` characters for you. Example:\\ -⍝ ~~~ -⍝ #.Execute.Process'"C:/My Scripts/foo.bat" ⍝ this will work -⍝ ~~~ -⍝ If however a parameter passed later on happens to be a directory name then -⍝ it is up to you to specify `\` rather than `/` as separator. Example: -⍝ ~~~ -⍝ #.Execute.Process'CMD' 'dir C:/' 'Exit 199' ⍝ this won't work -⍝ ~~~ -⍝ Thanks to Peter Michael Hager () without whom -⍝ this class would hardly exist.\\ -⍝ Author: Kai Jaeger ⋄ APL Team Ltd\\ -⍝ Home page: - - okay←false←null←0 ⋄ true←1 - - ∇ r←Version - :Access Public shared - r←'Execute' '3.0.2+18' '2021-03-02' - ∇ - - ∇ History - :Access Public Shared - ⍝ * 3.0.2 ⋄ 2020-03-02 - ⍝ * Package config file corrected - ⍝ * 3.0.1 ⋄ 2020-09-21 - ⍝ * The script delivered with 3.0.0 (and earlier versions as well) carried two characters - ⍝ at the end of the first line, causing potentially trouble. - ⍝ * 3.0.0 - ⍝ * BREAKING CHANGES: - ⍝ * Requires at least Dyalog 18.0 - ⍝ * Requires the class `APLTreeUtils2` - ⍝ * Does not `:Include APLTreeUtils` anymore - ⍝\\ - ⍝ For information regarding older versions see - ∇ - - ∇ {(rc processInfo result more)}←{cs}Application program;⎕IO;⎕ML;NORMAL_PRIORITY_CLASS;nl;bool;startupInfo;processHandle;threadHandle;StillActive;Ctrl_C_Is;ProcessAborted;i;∆CreateProcess;∆GetCurrentDirectory;∆GetExitCodeProcess;∆GetExitCodeThread;∆WaitForSingleObject;∆TerminateProcess;∆TerminateThread - ⍝ # Overview - ⍝ - ⍝ Run "program" in the same environment as the calling process. - ⍝ - ⍝ The left argument is optional. If passed this must be a command space. - ⍝ You can call the public shared method `DefaultParms` in order to get - ⍝ a command space pre-populated with default settings. Then make - ⍝ appropriate changes and pass it as left argument. - ⍝ - ⍝ ## Explicit Result - ⍝ - ⍝ There are four items returned as explicit result: - ⍝ * `rc` (return code) with 0 being okay. - ⍝ * `processInfo`: an integer vector with process related information. - ⍝ * `result`: that's what is returned by `⎕OFF n` where `n` gets the result, - ⍝ or "Exit n" in a batch program. When wait is 0 there is no result - ⍝ so this is always 0 then. - ⍝ * `more`: might carry additional information in case something went wrong. - :Access Public Shared - ⎕IO←0 ⋄ ⎕ML←3 - result←⍬ ⋄ more←'' - NORMAL_PRIORITY_CLASS←32 - 'Invalid right argument'⎕SIGNAL 11/⍨(' '≠1↑0⍴∊program)∨~(≡program)∊0 1 - cs←{0<⎕NC ⍵:⍎⍵ ⋄ DefaultParms}'cs' - nl←cs.⎕NL-2 - :If 0<+/bool←~nl∊'dir' 'hidden' 'wait' 'timeoutAfter' - 11 ⎕SIGNAL⍨'Unknown parameters: ',↑{⍺,',',⍵}/bool/nl - :EndIf - program←EnforceBackslash program - :If Is64Bit - '∆CreateProcess'⎕NA'I4 KERNEL32.C32|CreateProcess',QnaType,'I4 <0T P P I4 I4 P <0T <{I4 U4 P P P I4 I4 I4 I4 I4 I4 I4 I4 I2 I2 U4 P P P P} >{P P I4 I4}' - :Else - '∆CreateProcess'⎕NA'I4 KERNEL32.C32|CreateProcess',QnaType,' I4 <0T I4 I4 I4 I4 I4 <0T <{I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I4 I2 I2 I4 I4 I4 I4} >{I4 I4 I4 I4}' - :EndIf - '∆CloseHandle'⎕NA'I4 KERNEL32.C32|CloseHandle I4' - 'GetLastError'⎕NA'I4 KERNEL32.C32|GetLastError' - '∆ExpandEnvironmentStrings'⎕NA'I4 KERNEL32.C32|ExpandEnvironmentStrings',QnaType,' <0T >0T I4' - :If 0∊⍴,cs.dir - '∆GetCurrentDirectory'⎕NA'I4 KERNEL32.C32|GetCurrentDirectory',QnaType,' I4 >T[]' - :If 0=↑rc←∆GetCurrentDirectory 260 260 - rc←GetLastError - more←'GetCurrentDirectory error' - :Return - :Else - cs.dir←↑↑/rc - :EndIf - :EndIf - startupInfo←CreateStartupInfo cs.hidden - program←ExpandEnv program - (rc processInfo)←∆CreateProcess null program null null true NORMAL_PRIORITY_CLASS null cs.dir startupInfo 0 - :If false=rc - rc←GetLastError - more←'Creating process failed' - :Else - (processHandle threadHandle)←2↑processInfo - :If cs.wait - StillActive←259 - Ctrl_C_Is←¯1073741510 - ProcessAborted←1067 - '∆GetExitCodeProcess'⎕NA'I4 KERNEL32.C32|GetExitCodeProcess I4 >I4' - '∆GetExitCodeThread'⎕NA'I4 KERNEL32.C32|GetExitCodeThread I4 >I4' - '∆WaitForSingleObject'⎕NA'I4 KERNEL32.C32|WaitForSingleObject I4 I4' - '∆TerminateProcess'⎕NA'I4 KERNEL32.C32|TerminateProcess I4 I4' - '∆TerminateThread'⎕NA'I4 KERNEL32.C32|TerminateThread I4 I4' - i←0 - :Trap 1002 1003 - :While (okay StillActive)≡2↑(∆GetExitCodeProcess GetExitCodeProcess)processHandle - i←i+⎕DL 0.5 - :If 0≠cs.timeoutAfter - :AndIf cs.timeoutAfter