From 6819b8e63d5768d94f4309c4911ed6d0d36a138b Mon Sep 17 00:00:00 2001 From: Max Leske Date: Wed, 20 May 2020 10:26:42 +0200 Subject: [PATCH] Added #binaryWriteStreamFor:do: and #newTemporaryFileReference to GRPlatform and concrete implementations to GRPharoPlatform and GRSqueakPlatform --- .../instance/binaryWriteStreamFor.do..st | 6 ++++++ .../instance/newTemporaryFileReference.st | 8 ++++++++ .../GRPharoPlatform.class/README.md | 2 +- .../instance/binaryWriteStreamFor.do..st | 6 ++++++ .../instance/newTemporaryFileReference.st | 8 ++++++++ .../GRPharoPlatform.class/properties.json | 2 +- .../Grease-Squeak-Core.package/.filetree | 5 +++-- .../instance/binaryWriteStreamFor.do..st | 8 ++++++++ .../instance/newTemporaryFileReference.st | 8 ++++++++ .../GRSqueakPlatform.class/properties.json | 19 ++++++++----------- .../Object.extension/properties.json | 3 ++- .../SmallInteger.extension/properties.json | 3 ++- .../properties.json | 3 +-- 13 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/binaryWriteStreamFor.do..st create mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st create mode 100644 repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st create mode 100644 repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st create mode 100644 repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/binaryWriteStreamFor.do..st create mode 100644 repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/newTemporaryFileReference.st diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/binaryWriteStreamFor.do..st b/repository/Grease-Core.package/GRPlatform.class/instance/binaryWriteStreamFor.do..st new file mode 100644 index 00000000..08e52e93 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/binaryWriteStreamFor.do..st @@ -0,0 +1,6 @@ +file library +binaryWriteStreamFor: aFileReference do: aBlock + "Open a binary writeStream for aFileReference and evaluate aBlock + with the stream as argument. + The stream will be closed after the block has completed." + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st b/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st new file mode 100644 index 00000000..7b885531 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st @@ -0,0 +1,8 @@ +file library +newTemporaryFileReference + "Create a new temporary file in the systems temp directory + and answer a reference to it. + 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 \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/README.md b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/README.md index f0375aac..e71bb46d 100644 --- a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/README.md +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/README.md @@ -1 +1 @@ -A WASqueakPlatform is the Squeak implementation of SeasidePlatformSupport, the Seaside class that provides functionality that can not be implemented in a platform independent way. +A GRPharoPlatform is the Pharo implementation of GRPlatform, the Grease class that provides functionality that can not be implemented in a platform independent way. diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st new file mode 100644 index 00000000..6c8a0772 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st @@ -0,0 +1,6 @@ +file library +binaryWriteStreamFor: aFileReference do: aBlock + "Open a binary writeStream for aFileReference and evaluate aBlock + with the stream as argument. + The stream will be closed after the block has completed." + aFileReference binaryWriteStreamDo: aBlock \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st new file mode 100644 index 00000000..272bb249 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st @@ -0,0 +1,8 @@ +file library +newTemporaryFileReference + "Create a new temporary file in the systems temp directory + and answer a reference to it. + 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)." + ^ FileLocator temp / UUID new asString \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/properties.json b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/properties.json index 6c67d70a..ab8c26b8 100644 --- a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/properties.json +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/properties.json @@ -1,5 +1,5 @@ { - "commentStamp" : "pmm 6/1/2008 01:03", + "commentStamp" : "pmm 2/1/2014 13:28", "super" : "GRPlatform", "category" : "Grease-Pharo70-Core", "classinstvars" : [ ], diff --git a/repository/Grease-Squeak-Core.package/.filetree b/repository/Grease-Squeak-Core.package/.filetree index 8998102c..57a67973 100644 --- a/repository/Grease-Squeak-Core.package/.filetree +++ b/repository/Grease-Squeak-Core.package/.filetree @@ -1,4 +1,5 @@ { - "noMethodMetaData" : true, "separateMethodMetaAndSource" : false, - "useCypressPropertiesFile" : true } + "noMethodMetaData" : true, + "useCypressPropertiesFile" : true +} \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/binaryWriteStreamFor.do..st b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/binaryWriteStreamFor.do..st new file mode 100644 index 00000000..dbf0bbef --- /dev/null +++ b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/binaryWriteStreamFor.do..st @@ -0,0 +1,8 @@ +file library +binaryWriteStreamFor: aFileReference do: aBlock + "Open a binary writeStream for aFileReference and evaluate aBlock + with the stream as argument. + The stream will be closed after the block has completed." + FileDirectory default + fileNamed: aFileReference fullName + do: aBlock \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/newTemporaryFileReference.st b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/newTemporaryFileReference.st new file mode 100644 index 00000000..ec935dad --- /dev/null +++ b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/newTemporaryFileReference.st @@ -0,0 +1,8 @@ +file library +newTemporaryFileReference + "Create a new temporary file in the systems temp directory + and answer a reference to it. + 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)." + ^ FileDirectory default / UUID new asString \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/properties.json b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/properties.json index b07c70d3..5f39af5c 100644 --- a/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/properties.json +++ b/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/properties.json @@ -1,14 +1,11 @@ { - "category" : "Grease-Squeak-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], "commentStamp" : "", - "instvars" : [ - ], - "name" : "GRSqueakPlatform", - "pools" : [ - ], "super" : "GRPharoPlatform", - "type" : "normal" } + "category" : "Grease-Squeak-Core", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "GRSqueakPlatform", + "type" : "normal" +} \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/Object.extension/properties.json b/repository/Grease-Squeak-Core.package/Object.extension/properties.json index 3d3b9ec4..f30a86e1 100644 --- a/repository/Grease-Squeak-Core.package/Object.extension/properties.json +++ b/repository/Grease-Squeak-Core.package/Object.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "Object" } + "name" : "Object" +} \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/SmallInteger.extension/properties.json b/repository/Grease-Squeak-Core.package/SmallInteger.extension/properties.json index d2d9ab4a..ca9cd21f 100644 --- a/repository/Grease-Squeak-Core.package/SmallInteger.extension/properties.json +++ b/repository/Grease-Squeak-Core.package/SmallInteger.extension/properties.json @@ -1,2 +1,3 @@ { - "name" : "SmallInteger" } + "name" : "SmallInteger" +} \ No newline at end of file diff --git a/repository/Grease-Squeak-Core.package/properties.json b/repository/Grease-Squeak-Core.package/properties.json index f037444a..6f31cf5a 100644 --- a/repository/Grease-Squeak-Core.package/properties.json +++ b/repository/Grease-Squeak-Core.package/properties.json @@ -1,2 +1 @@ -{ - } +{ } \ No newline at end of file