From fd607d1dba672b03e75763eaf22eee2cb0db84e3 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Wed, 20 May 2020 10:26:42 +0200 Subject: [PATCH 1/7] 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 From 4a739737f884e793446af766b88cebb7a051aa38 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sat, 4 Jun 2022 15:10:31 +0200 Subject: [PATCH 2/7] Add methods used for streaming to Pharo 100 platform --- .../instance/binaryWriteStreamFor.do..st | 6 ++++++ .../instance/newTemporaryFileReference.st | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st create mode 100644 repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st new file mode 100644 index 00000000..6c8a0772 --- /dev/null +++ b/repository/Grease-Pharo100-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-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st new file mode 100644 index 00000000..272bb249 --- /dev/null +++ b/repository/Grease-Pharo100-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 From 8b34088fc592d7506c4d83c2d77318d4cd1a937f Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sat, 4 Jun 2022 15:11:52 +0200 Subject: [PATCH 3/7] Add methods for streaming to Pharo 9 platform --- .../instance/binaryWriteStreamFor.do..st | 6 ++++++ .../instance/newTemporaryFileReference.st | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st create mode 100644 repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st new file mode 100644 index 00000000..6c8a0772 --- /dev/null +++ b/repository/Grease-Pharo90-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-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st new file mode 100644 index 00000000..272bb249 --- /dev/null +++ b/repository/Grease-Pharo90-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 From 47808cbd36ca1a6181cec0c1ad4be64fedfd9f6a Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 5 Jun 2022 15:56:03 +0200 Subject: [PATCH 4/7] Remove #binaryWriteStreamFor:do: #writeFileStreamOn:do:binary: already provides this functionality --- .../GRPlatform.class/instance/binaryWriteStreamFor.do..st | 6 ------ .../instance/binaryWriteStreamFor.do..st | 6 ------ 2 files changed, 12 deletions(-) delete mode 100644 repository/Grease-Core.package/GRPlatform.class/instance/binaryWriteStreamFor.do..st delete mode 100644 repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..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 deleted file mode 100644 index 08e52e93..00000000 --- a/repository/Grease-Core.package/GRPlatform.class/instance/binaryWriteStreamFor.do..st +++ /dev/null @@ -1,6 +0,0 @@ -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-Pharo90-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st deleted file mode 100644 index 6c8a0772..00000000 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st +++ /dev/null @@ -1,6 +0,0 @@ -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 From c5c716756e7263fbb85c026fe77bd4be0a6c5a48 Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 5 Jun 2022 15:58:35 +0200 Subject: [PATCH 5/7] Removed #binaryWriteStreamFor:do: from Pharo 10 #writeFileStreamOn:do:binary: already provides this functionality --- .../instance/binaryWriteStreamFor.do..st | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st deleted file mode 100644 index 6c8a0772..00000000 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st +++ /dev/null @@ -1,6 +0,0 @@ -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 From 3899a411625b7a5aba1d2bc7ab80c79364f3336b Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 5 Jun 2022 15:59:25 +0200 Subject: [PATCH 6/7] Removed #binaryWriteStreamFor:do: from Pharo 7 #writeFileStreamOn:do:binary: already provides this functionality --- .../instance/binaryWriteStreamFor.do..st | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st 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 deleted file mode 100644 index 6c8a0772..00000000 --- a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/binaryWriteStreamFor.do..st +++ /dev/null @@ -1,6 +0,0 @@ -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 From a248d0807a1552daacadab408e521c5dcc03776c Mon Sep 17 00:00:00 2001 From: Max Leske Date: Sun, 5 Jun 2022 16:00:39 +0200 Subject: [PATCH 7/7] Removed #binaryWriteStreamFor:do: from Squeak #writeFileStreamOn:do:binary: already provides this functionality --- .../instance/binaryWriteStreamFor.do..st | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/binaryWriteStreamFor.do..st 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 deleted file mode 100644 index dbf0bbef..00000000 --- a/repository/Grease-Squeak-Core.package/GRSqueakPlatform.class/instance/binaryWriteStreamFor.do..st +++ /dev/null @@ -1,8 +0,0 @@ -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