Skip to content

Commit 2410a28

Browse files
LinqLoverj4yk
authored andcommitted
Revises #base and #extension for complex extensions so that plonk.tar.gz is splitted up into base=plonk.tar and extension=gz.
For the original request, see: http://lists.squeakfoundation.org/pipermail/squeak-dev/2020-November/212899.html I did not find any relevant senders in FileSystems-Git nor in Squot. All tests in these packages still pass.
1 parent ad72cf7 commit 2410a28

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
accessing
22
base
3-
"Returns the base of the basename, i.e. /foo/gloops.taz basename is 'gloops'"
4-
^ self basename copyUpTo: self extensionDelimiter
3+
"Returns the base of the basename, i.e. /foo/gloops.tar.gz basename is 'gloops.tar'"
4+
^ self basename copyUpToLast: self extensionDelimiter
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
accessing
22
extension
3-
"Return the extension of path basename i.e., /foo/gloops.taz extension is 'taz'"
3+
"Return the extension of path basename i.e., /foo/gloops.tar.gz extension is 'gz'"
44

5-
^ self basename copyAfter: self extensionDelimiter
5+
^ self basename copyAfterLast: self extensionDelimiter

src/FS-Core.package/FSPath.class/methodProperties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
"asPathWith:" : "cwp 10/10/2009 18:04",
2424
"asReference" : "jr 3/2/2017 17:39",
2525
"asResolvedBy:" : "cwp 9/22/2009 09:08",
26-
"base" : "StephaneDucasse 2/15/2010 18:06",
26+
"base" : "ct 12/29/2021 20:43",
2727
"basename" : "CamilloBruni 8/9/2011 16:11",
2828
"contains:" : "cwp 10/26/2009 01:03",
2929
"containsPath:" : "cwp 10/25/2009 22:59",
3030
"containsReference:" : "cwp 10/25/2009 23:05",
3131
"copyFrom:" : "cwp 12/13/2008 21:08",
3232
"delimiter" : "cwp 10/11/2009 11:05",
3333
"do:" : "cwp 7/18/2009 01:13",
34-
"extension" : "StephaneDucasse 2/15/2010 18:04",
34+
"extension" : "ct 12/29/2021 20:34",
3535
"extensionDelimiter" : "cwp 12/23/2008 11:25",
3636
"fullName" : "sd 2/11/2011 21:02",
3737
"hash" : "cwp 12/14/2008 17:06",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
accessing
22
extension
3-
"Returns the extension of the basename, i.e. /foo/gloops.taz extension is 'taz'.
4-
Note that compound extensions are returned completely:
5-
/foo/gloops.taz.txt extension is 'taz.txt'"
3+
"Returns the extension of the basename, i.e. /foo/gloops.taz extension is 'taz'.
4+
Note that for compound extensions, only the last segment is returned:
5+
/foo/gloops.tar.gz extension is 'gz'"
66

77
^ path extension

src/FS-Core.package/FSReference.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"entries" : "CamilloBruni 1/19/2012 13:46",
6868
"entry" : "sd 2/11/2011 19:58",
6969
"exists" : "cwp 1/13/2009 20:52",
70-
"extension" : "cwp 3/29/2011 16:56",
70+
"extension" : "ct 12/29/2021 20:42",
7171
"fileStreamDo:" : "CamilloBruni 2/6/2012 09:36",
7272
"fileStreamWritable:do:" : "CamilloBruni 2/6/2012 09:36",
7373
"fileSystem" : "jr 10/22/2016 23:11",

src/FS-Tests-Core.package/FSReferenceTest.class/instance/testBaseAndExtension.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ testBaseAndExtension
99
self assert: ref extension = 'taz'.
1010

1111
"Note that the extension of a complex extension starts from the first period up until the end"
12-
ref := filesystem * 'plonk' / 'griffle.taz.txt'.
13-
self assert: ref base = 'griffle'.
14-
self assert: ref extension = 'taz.txt'.
12+
ref := filesystem * 'plonk' / 'griffle.tar.gz'.
13+
self assert: ref base = 'griffle.tar'.
14+
self assert: ref extension = 'gz'.

src/FS-Tests-Core.package/FSReferenceTest.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"testAsAbsoluteConverted" : "CamilloBruni 8/12/2011 15:44",
1111
"testAsAbsoluteIdentity" : "CamilloBruni 8/12/2011 15:44",
1212
"testAsReference" : "CamilloBruni 8/12/2011 15:44",
13-
"testBaseAndExtension" : "CamilloBruni 8/12/2011 15:44",
13+
"testBaseAndExtension" : "ct 12/29/2021 20:42",
1414
"testBasename" : "CamilloBruni 8/12/2011 15:43",
1515
"testChildDirectories" : "CamilloBruni 8/12/2011 15:43",
1616
"testChildFiles" : "CamilloBruni 8/12/2011 15:43",

0 commit comments

Comments
 (0)