-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate existing
newTemporaryFileReference
in favour of `newTempo…
…raryFile` which returns a pathString consistent with other Grease file-handling methods
- Loading branch information
Showing
10 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFile.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
files | ||
newTemporaryFile | ||
"Create a new temporary file in the systems temp directory and answer its pathString. | ||
It is the users responsibility to delete or move the file, it will not be cleaned up automatically | ||
(unless the host system has a policy for it)." | ||
^ self subclassResponsibility |
6 changes: 6 additions & 0 deletions
6
repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileNamed..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
files | ||
newTemporaryFileNamed: aName | ||
"Create a new temporary file in the systems temp directory and answer its pathString. | ||
It is the users responsibility to delete or move the file, it will not be cleaned up automatically | ||
(unless the host system has a policy for it)." | ||
self subclassResponsibility |
8 changes: 0 additions & 8 deletions
8
repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReferenceNamed..st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFile.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
files | ||
newTemporaryFile | ||
|
||
^ self newTemporaryFileNamed: UUID new greaseString |
4 changes: 4 additions & 0 deletions
4
...ory/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileNamed..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
files | ||
newTemporaryFileNamed: aName | ||
|
||
^ (FileLocator temp / aName) pathString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testNewTemporaryFile.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
tests-files | ||
testNewTemporaryFile | ||
|
||
| temporaryFile | | ||
[ | ||
temporaryFile := GRPlatform current newTemporaryFile. | ||
GRPlatform current | ||
writeFileStreamOn: temporaryFile | ||
do: [ :str | str nextPutAll: 'test temporary' ] | ||
binary: false. | ||
self assert: (GRPlatform current fileExists: temporaryFile) | ||
] ensure: [ GRPlatform current deleteFile: temporaryFile ]. | ||
self deny: (GRPlatform current fileExists: temporaryFile) |
13 changes: 13 additions & 0 deletions
13
...tory/Grease-Tests-Core.package/GRPlatformTest.class/instance/testNewTemporaryFileNamed.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
tests-files | ||
testNewTemporaryFileNamed | ||
|
||
| temporaryFile | | ||
[ | ||
temporaryFile := GRPlatform current newTemporaryFileNamed: 'test_temporary'. | ||
GRPlatform current | ||
writeFileStreamOn: temporaryFile | ||
do: [ :str | str nextPutAll: 'test temporary' ] | ||
binary: false. | ||
self assert: (GRPlatform current fileExists: temporaryFile) | ||
] ensure: [ GRPlatform current deleteFile: temporaryFile ]. | ||
self deny: (GRPlatform current fileExists: temporaryFile) |