Skip to content

Commit a0c32d2

Browse files
committed
Couple of minor improvements
1 parent a6bddf7 commit a0c32d2

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

APLSource/GitHubAPIv3.aplc

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
∇ r←Version
1818
:Access Public Shared
19-
r←'GitHub' '0.3.0.8' '2019-02-17'
19+
r←'GitHub' '0.3.0.11' '2019-04-16'
2020
2121

2222
∇ History
2323
:Access Public Shared
2424
⍝ * 0.3.0
25-
⍝ * Oktokit support added.
2625
⍝ * Versioning corrected.
2726
⍝ * Documentation polished.
2827
⍝ * :Include ##.APLTreeUtils fixed
29-
⍝ * Now compatible with 1.50
28+
⍝ * Bug fixes
29+
⍝ * `CastTagname2Number` did not accept something like `1.0.2`
3030
⍝ * 0.0.2
3131
⍝ * Method `GetAllTopics` added.
3232
⍝ * 0.0.1
@@ -158,6 +158,8 @@
158158
⍝ Assumptions:
159159
⍝ * `text` may or may not start with a non-digit. All leading non-digit characters are ignored.\\
160160
⍝ Therefore both `1.2.3` and `v.1.2.3` are valid input.
161+
⍝ * None is allowed to start with a zero followd by a non-zero digit. Therefore 1.0.0 is valid input but
162+
⍝ 01.02.3, 1.02.3 and 1.2.03 are not.
161163
⍝ * The remaining `text` must consist of nothing but digits and dots.
162164
⍝ * The first two numbers ("major" and "minor") must not be bigger than 99.
163165
⍝ * The third number ("path") must not be bigger than 999.
@@ -171,24 +173,23 @@
171173
⍝ If the tag name does not fulfil the assumptions the conversion might crash. In that case `⍬` is
172174
⍝ returned as result.
173175
number←⍬
174-
text←{⍵↓⍨+/∧\0=⍵∊⎕D}text
175-
:If 0=+/{+/∧\'0'=⍵}¨'.'Split text
176+
:If 0<≢text←{⍵↓⍨+/∧\0=⍵∊⎕D}text
177+
:AndIf 0=+/{(1<⊃≢⍵)∧⊃'0'=1↑⍵}¨'.'Split text
176178
(bool vec)←'.'⎕VFI text
177-
:If 3 4∊⍨⍴bool
178-
vec←{⍵↑⍨3⌈4⌊⍴⍵}↑vec
179-
:If 3=⍴vec
180-
:If ∧/100 100 1000>vec
181-
:AndIf 0=number←100 100 1000⊥vec
182-
number←⍬
183-
:EndIf
184-
:Else
185-
:If ~∧/100 100 1000 100000>vec
186-
number←⍬
187-
:ElseIf 0=number←100 100 1000 100000⊥vec
188-
number←⍬
189-
:EndIf
190-
number÷←100000
179+
:AndIf 3 4∊⍨⍴bool
180+
vec←{⍵↑⍨3⌈4⌊⍴⍵}↑vec
181+
:If 3=⍴vec
182+
:If ∧/100 100 1000>vec
183+
:AndIf 0=number←100 100 1000⊥vec
184+
number←⍬
185+
:EndIf
186+
:Else
187+
:If ~∧/100 100 1000 100000>vec
188+
number←⍬
189+
:ElseIf 0=number←100 100 1000 100000⊥vec
190+
number←⍬
191191
:EndIf
192+
number÷←100000
192193
:EndIf
193194
:EndIf
194195
@@ -318,7 +319,7 @@
318319
∘∘∘ ⍝ Huuh?!
319320
:EndIf
320321
:Else
321-
r←⍎'type ⎕JSON filename'
322+
r←⍎'type ⎕JSON y'
322323
:EndIf
323324
324325

APLSource/TestCases/Test_006.aplf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
→PassesIf 102003.00001=##.GitHubAPIv3.CastTagname2Number'1.2.3.1'
1111
→PassesIf 102003.09999=##.GitHubAPIv3.CastTagname2Number'1.2.3.9999'
1212

13-
→PassesIf 102003=##.GitHubAPIv3.CastTagname2Number'v1.2.3'
13+
→PassesIf 1000=##.GitHubAPIv3.CastTagname2Number'v0.1.0'
14+
→PassesIf 100000=##.GitHubAPIv3.CastTagname2Number'v1.0.0'
15+
→PassesIf 100000≡##.GitHubAPIv3.CastTagname2Number'1.0.0'
16+
→PassesIf 100000≡##.GitHubAPIv3.CastTagname2Number'1.0.0.0'
17+
→PassesIf 102000=##.GitHubAPIv3.CastTagname2Number'v1.2.0'
1418
→PassesIf 1002003=##.GitHubAPIv3.CastTagname2Number'v10.2.3'
1519
→PassesIf 1020003=##.GitHubAPIv3.CastTagname2Number'v10.20.3'
1620
→PassesIf 1020030=##.GitHubAPIv3.CastTagname2Number'v10.20.30'

Dist/GitHubAPIv3-0.3..11.zip

4.36 KB
Binary file not shown.

Dist/GitHubAPIv3.zip

-4.25 KB
Binary file not shown.

Make/Make.DWS

79.6 KB
Binary file not shown.

Make/Make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
"C:\Program Files\Dyalog\Dyalog APL-64 16.0 Unicode\dyalog.exe" %1 maxw=64000 %2 %3 %4
1+
"C:\Program Files\Dyalog\Dyalog APL-64 15.0 Unicode\dyalog.exe" %1 maxw=64000 %2 %3 %4
22
IF %ERRORLEVEL% NEQ 0 echo ERROR

publish.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<tool name="GitHubAPIv3"> <version>0.3.0</version> <date>2019-02-17</date> <files></files> <container>#._GitHubAPIv3</container> <needs> <script>APLTreeUtils</script> <script>FilesAndDirs</script> <script>OS</script> <script>Tester</script> </needs> <scriptOnly>1</scriptOnly> <wsid>Development</wsid> <autoload>1</autoload> <buildid>9</buildid></tool>
1+
<tool name="GitHubAPIv3"> <version>0.3.0</version> <date>2019-04-16</date> <files></files> <container>#._GitHubAPIv3</container> <needs> <script>APLTreeUtils</script> <script>FilesAndDirs</script> <script>OS</script> <script>Tester</script> </needs> <scriptOnly>1</scriptOnly> <wsid>Development</wsid> <autoload>1</autoload> <buildid>11</buildid></tool>

0 commit comments

Comments
 (0)