diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67d01c8c..3250ee60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,50 +3,30 @@ name: smalltalkCI on: [push, pull_request] jobs: - build: - runs-on: ubuntu-18.04 + test: + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0, Pharo64-7.0, Pharo-6.1, GemStone64-3.6.3, GemStone64-3.5.7, GemStone64-3.4.5, GemStone64-3.3.9, GemStone64-3.2.17, GemStone64-3.1.0.6, Squeak64-5.3, Squeak64-5.2, Squeak64-5.1 ] + smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0, Pharo64-7.0, GemStone64-3.6.5, GemStone64-3.5.7, Squeak64-5.3 ] experimental: [ false ] include: - - smalltalk: Squeak64-trunk + - smalltalk: Squeak64-6.0 experimental: true continue-on-error: ${{ matrix.experimental }} name: ${{ matrix.smalltalk }} steps: - - name: Get current date - id: date - run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')" - - name: Log date - run: echo "${{ steps.date.outputs.date }}" - - name: Set default run status - run: echo "::set-output name=last_run_status::default" > last_run_status - - name: Restore last run status - id: last_run - uses: actions/cache@v2 - with: - path: | - last_run_status - key: ${{ github.run_id }}-${{ matrix.smalltalk }}-${{ steps.date.outputs.date }} - restore-keys: | - ${{ github.run_id }}-${{ matrix.smalltalk }}- - - name: Set last run status - id: last_run_status - run: cat last_run_status - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.workflow_dispatch.ref }} - - uses: hpi-swa/setup-smalltalkCI@v1 + - uses: actions/checkout@v3 + - uses: dalehenrich/setup-smalltalkCI@solo with: smalltalk-image: ${{ matrix.smalltalk }} - name: Run tests - id: test_run - if: steps.last_run_status.outputs.last_run_status != 'success' run: smalltalkci -s ${{ matrix.smalltalk }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash timeout-minutes: 20 - - name: Save run status - if: steps.last_run_status.outputs.last_run_status != 'success' - run: echo "::set-output name=last_run_status::${{ steps.test_run.outcome }}" > last_run_status \ No newline at end of file + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + name: ${{ matrix.smalltalk }} diff --git a/.smalltalk.ston b/.smalltalk.ston index 9edb3f39..e62640ac 100644 --- a/.smalltalk.ston +++ b/.smalltalk.ston @@ -20,5 +20,15 @@ SmalltalkCISpec { #load : [ 'Tests' ], #platforms : [ #gemstone ] } - ] + ], + #testing : { + #defaultTimeout : 30, + #include : { + #classes : [ #SentButNotImplementedTest , #UndefinedSymbolsTest ] + }, + #coverage : { + #packages: [ 'Grease*' ], + #format: #lcov + } + } } diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..1277759a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,24 @@ +# MIT License + +Copyright © 2001 –- 2009 Avi Bryant, Julian Fitzell +Copyright © 2007 –- 2009 Lukas Renggli, Michel Bany, Philippe Marschall +Copyright © Seaside Contributors https://github.com/SeasideSt/Seaside/wiki/Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + diff --git a/README.md b/README.md index bed04f04..c4fa80b6 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Grease is widely adopted. Implementations exist already for all platforms that s ## Platform compatibility -The latest Grease version is supported on the Pharo and GemStone/S platforms and versions tested in the SmalltalkCI workflow in Github Actions: [![smalltalkCI](https://github.com/SeasideSt/Grease/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/SeasideSt/Grease/actions/workflows/ci.yml) +The latest Grease version is supported on the Pharo and GemStone/S platforms and versions tested in the SmalltalkCI workflow in Github Actions: [![smalltalkCI](https://github.com/SeasideSt/Grease/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/SeasideSt/Grease/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/SeasideSt/Grease/branch/master/graph/badge.svg?token=75NIYAHAGI)](https://codecov.io/gh/SeasideSt/Grease) ## Installation diff --git a/repository/BaselineOfGrease.package/BaselineOfGrease.class/instance/baselinePharo..st b/repository/BaselineOfGrease.package/BaselineOfGrease.class/instance/baselinePharo..st index 69725fe7..1b210730 100644 --- a/repository/BaselineOfGrease.package/BaselineOfGrease.class/instance/baselinePharo..st +++ b/repository/BaselineOfGrease.package/BaselineOfGrease.class/instance/baselinePharo..st @@ -1,17 +1,6 @@ baselines baselinePharo: spec - spec - for: #(#'pharo5.x') - do: [ spec - package: 'Grease-Core' with: [ spec includes: #('Grease-Pharo30-Core') ]; - package: 'Grease-Tests-Pharo-Core' with: [ spec requires: #('Grease-Tests-Core') ]; - package: 'Grease-Tests-Core' - with: [ spec - requires: #('Grease-Pharo30-Core'); - includes: #('Grease-Tests-Pharo-Core') ]; - package: 'Grease-Pharo30-Core' with: [ spec requires: #('Grease-Core') ] ]. - spec for: #'pharo6.x' do: [ spec @@ -36,7 +25,7 @@ baselinePharo: spec spec for: #(#'pharo6.x' #'pharo7.x' #'pharo8.x') - do: [ + do: [ spec package: 'Grease-Pharo40-Slime' with: [ spec requires: #('Grease-Core') ]; package: 'Grease-Tests-Slime' with: [ spec requires: #('Grease-Pharo40-Slime') ]. @@ -46,7 +35,7 @@ baselinePharo: spec spec for: #(#'pharo9.x') - do: [ + do: [ spec package: 'Grease-Core' with: [ spec includes: #('Grease-Pharo90-Core') ]; package: 'Grease-Tests-Pharo-Core' with: [ spec requires: #('Grease-Tests-Core') ]; @@ -61,10 +50,10 @@ baselinePharo: spec spec group: 'Slime' with: #('Grease-Pharo90-Slime'); group: 'Slime Tests' with: #('Grease-Tests-Slime') ]. - + spec - for: #(#'pharo10.x') - do: [ + for: #(#'pharo10.x' #'pharo11.x') + do: [ spec package: 'Grease-Core' with: [ spec includes: #('Grease-Pharo100-Core') ]; package: 'Grease-Tests-Pharo-Core' with: [ spec requires: #('Grease-Tests-Core') ]; @@ -78,4 +67,4 @@ baselinePharo: spec spec group: 'Slime' with: #('Grease-Pharo90-Slime'); - group: 'Slime Tests' with: #('Grease-Tests-Slime') ]. \ No newline at end of file + group: 'Slime Tests' with: #('Grease-Tests-Slime') ] \ No newline at end of file diff --git a/repository/BaselineOfGrease.package/monticello.meta/categories.st b/repository/BaselineOfGrease.package/monticello.meta/categories.st index aad806f8..4a7c5b2b 100644 --- a/repository/BaselineOfGrease.package/monticello.meta/categories.st +++ b/repository/BaselineOfGrease.package/monticello.meta/categories.st @@ -1 +1,2 @@ SystemOrganization addCategory: #BaselineOfGrease! +SystemOrganization addCategory: #'BaselineOfGrease-Manifest'! diff --git a/repository/Grease-Core.package/GRCodec.class/class/forEncoding..st b/repository/Grease-Core.package/GRCodec.class/class/forEncoding..st index 1ba7afb0..64699961 100644 --- a/repository/Grease-Core.package/GRCodec.class/class/forEncoding..st +++ b/repository/Grease-Core.package/GRCodec.class/class/forEncoding..st @@ -2,7 +2,7 @@ instance creation forEncoding: aString "Answer a new codec instance for the given encoding name. Raise an WAUnsupportedEncodingError if the encoding name is not supported by this image." - self allSubclassesDo: [ :each | + self allSubclassesDo: [ :each | (each supportsEncoding: aString) ifTrue: [ ^ each basicForEncoding: aString ] ]. ^ self unsupportedEncoding: aString \ No newline at end of file diff --git a/repository/Grease-Core.package/GRCodec.class/instance/decoderFor..st b/repository/Grease-Core.package/GRCodec.class/instance/decoderFor..st index 40ab1f1f..4ba317d5 100644 --- a/repository/Grease-Core.package/GRCodec.class/instance/decoderFor..st +++ b/repository/Grease-Core.package/GRCodec.class/instance/decoderFor..st @@ -1,5 +1,5 @@ conversion decoderFor: aReadStream - "Wrap aReadStream with an decoder for the codec of the receiver. Answer a read stream that delegates to and shares the state of aReadStream." - + "Wrap aReadStream with an decoder for the codec of the receiver. Answer a read stream that delegates to and shares the state of aReadStream." + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRCodec.class/instance/encoderFor..st b/repository/Grease-Core.package/GRCodec.class/instance/encoderFor..st index b19ecb3d..b691c1ef 100644 --- a/repository/Grease-Core.package/GRCodec.class/instance/encoderFor..st +++ b/repository/Grease-Core.package/GRCodec.class/instance/encoderFor..st @@ -1,5 +1,5 @@ conversion encoderFor: aWriteStream "Wrap aWriteStream with an encoder for the codec of the receiver. Answer a write stream that delegates to and shares the state of aWriteStream." - + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector..st b/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector..st index a1ee82f0..0322111e 100644 --- a/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector..st +++ b/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector..st @@ -1,6 +1,6 @@ instance creation -receiver: anObject selector: aSymbol - ^ self basicNew +receiver: anObject selector: aSymbol + ^ self basicNew initializeWithReceiver: anObject message: (GRUnboundMessage selector: aSymbol); yourself \ No newline at end of file diff --git a/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector.arguments..st b/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector.arguments..st index a7cd1ee2..310042bf 100644 --- a/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector.arguments..st +++ b/repository/Grease-Core.package/GRDelayedSend.class/class/receiver.selector.arguments..st @@ -1,6 +1,6 @@ instance creation -receiver: anObject selector: aSymbol arguments: anArray - ^ self basicNew +receiver: anObject selector: aSymbol arguments: anArray + ^ self basicNew initializeWithReceiver: anObject message: (GRBoundMessage selector: aSymbol arguments: anArray); yourself \ No newline at end of file diff --git a/repository/Grease-Core.package/GRDelayedSend.class/instance/argumentCount.st b/repository/Grease-Core.package/GRDelayedSend.class/instance/argumentCount.st index cafc361e..5e6683e1 100644 --- a/repository/Grease-Core.package/GRDelayedSend.class/instance/argumentCount.st +++ b/repository/Grease-Core.package/GRDelayedSend.class/instance/argumentCount.st @@ -1,5 +1,5 @@ accessing argumentCount "Answer the number of arguments that must be provided to the receiver when sending it." - + ^ message argumentCount \ No newline at end of file diff --git a/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/argumentCount.st b/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/argumentCount.st index 00146dd7..1ac3d919 100644 --- a/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/argumentCount.st +++ b/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/argumentCount.st @@ -1,5 +1,5 @@ delegation argumentCount "Answer the number of arguments that must be provided when sending this message." - + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withArguments..st b/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withArguments..st index 9efaca14..e97189fe 100644 --- a/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withArguments..st +++ b/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withArguments..st @@ -2,5 +2,5 @@ delegation valueFor: receiver withArguments: anArray "Send the message to receiver with the arguments in anArray. Answer the result. Signal an error if the number of arguments does not match the selector." - + ^ self basicPerformFor: receiver withArguments: (self mergeArguments: anArray) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withPossibleArguments..st b/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withPossibleArguments..st index e0708319..5cd1f582 100644 --- a/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withPossibleArguments..st +++ b/repository/Grease-Core.package/GRDelayedSendMessage.class/instance/valueFor.withPossibleArguments..st @@ -5,7 +5,7 @@ valueFor: receiver withPossibleArguments: anArray | allArguments | allArguments := self mergeArguments: anArray. - + ^ allArguments size < selector numArgs ifTrue: [ self invalidArgumentCount ] ifFalse: [ self basicPerformFor: receiver withArguments: (allArguments first: selector numArgs) ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRDelegatingStream.class/instance/position..st b/repository/Grease-Core.package/GRDelegatingStream.class/instance/position..st new file mode 100644 index 00000000..a20d8783 --- /dev/null +++ b/repository/Grease-Core.package/GRDelegatingStream.class/instance/position..st @@ -0,0 +1,3 @@ +accessing +position: anInteger + ^ stream position: anInteger \ No newline at end of file diff --git a/repository/Grease-Core.package/GRMappedPrinter.class/class/block.next..st b/repository/Grease-Core.package/GRMappedPrinter.class/class/block.next..st index 17a32993..0e7ba6d2 100644 --- a/repository/Grease-Core.package/GRMappedPrinter.class/class/block.next..st +++ b/repository/Grease-Core.package/GRMappedPrinter.class/class/block.next..st @@ -1,6 +1,6 @@ instance creation block: aBlock next: aPrinter - ^ self new + ^ self new block: aBlock; next: aPrinter; yourself \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/use.during..st b/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/use.during..st index 33ae4c99..ba04b46e 100644 --- a/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/use.during..st +++ b/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/use.during..st @@ -1,5 +1,5 @@ evaluating use: anObject during: aBlock "Set the dynamic value of the receiver to anObject during the evaluation of aBlock." - + ^ aBlock on: self do: [ :notification | notification resume: anObject ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/value.st b/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/value.st index 9416cedb..bedb8f2b 100644 --- a/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/value.st +++ b/repository/Grease-Core.package/GRNotificationBasedDynamicVariable.class/class/value.st @@ -1,5 +1,5 @@ evaluating value "Answer the dynamic value of the receiver." - + ^ self signal \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNullCodec.class/instance/decoderFor..st b/repository/Grease-Core.package/GRNullCodec.class/instance/decoderFor..st index 7c198828..d855375c 100644 --- a/repository/Grease-Core.package/GRNullCodec.class/instance/decoderFor..st +++ b/repository/Grease-Core.package/GRNullCodec.class/instance/decoderFor..st @@ -1,4 +1,4 @@ conversion -decoderFor: aReadStream +decoderFor: aReadStream "wrap to avoid String vs ByteArray issues" ^ GRNullCodecStream on: aReadStream \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNullCodec.class/instance/encoderFor..st b/repository/Grease-Core.package/GRNullCodec.class/instance/encoderFor..st index c4c0196f..fcab009a 100644 --- a/repository/Grease-Core.package/GRNullCodec.class/instance/encoderFor..st +++ b/repository/Grease-Core.package/GRNullCodec.class/instance/encoderFor..st @@ -1,4 +1,4 @@ conversion -encoderFor: aWriteStream +encoderFor: aWriteStream "wrap to avoid String vs ByteArray issues" ^ GRNullCodecStream on: aWriteStream \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNullCodec.class/instance/url.st b/repository/Grease-Core.package/GRNullCodec.class/instance/url.st index f1a3ffe3..f26d9994 100644 --- a/repository/Grease-Core.package/GRNullCodec.class/instance/url.st +++ b/repository/Grease-Core.package/GRNullCodec.class/instance/url.st @@ -1,5 +1,5 @@ accessing url "The selfish method. Let's do it with ourselves." - + ^ self \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/accuracy..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/accuracy..st index fa3867ed..6e122a37 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/accuracy..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/accuracy..st @@ -1,5 +1,5 @@ accessing accuracy: aFloat "Round towards the nearest number that is a multiple of aFloat." - + accuracy := aFloat \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/digitsOf.base..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/digitsOf.base..st index 0469766d..47e728a3 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/digitsOf.base..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/digitsOf.base..st @@ -8,7 +8,7 @@ digitsOf: aNumber base: aBaseInteger stream := WriteStream on: (String new: 10). [ integer > 0 ] whileTrue: [ next := integer quo: aBaseInteger. - stream nextPut: (characters + stream nextPut: (characters at: 1 + integer - (next * aBaseInteger)). integer := next ]. ^ stream contents reverse \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/infinite..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/infinite..st index a34708fd..ed18785f 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/infinite..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/infinite..st @@ -1,5 +1,5 @@ accessing infinite: aString "The string that should be displayed if the number is positive or negative infinity." - + infinite := aString \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/lengthOf.base..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/lengthOf.base..st index 028a3bc2..62f6b34d 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/lengthOf.base..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/lengthOf.base..st @@ -7,7 +7,7 @@ lengthOf: aNumber base: aBaseInteger integer := aNumber truncated abs. length := 1. current := aBaseInteger. - [ current <= integer ] whileTrue: [ + [ current <= integer ] whileTrue: [ length := length + 1. current := current * aBaseInteger ]. ^ length \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/nan..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/nan..st index 22c5de66..8451e143 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/nan..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/nan..st @@ -1,5 +1,5 @@ accessing nan: aString "The string that should be displayed if the number is not a number." - + nan := aString \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/precision..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/precision..st index 03f0b9b7..6db5d820 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/precision..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/precision..st @@ -1,5 +1,5 @@ accessing precision: anInteger "The number of digits to be printed in the fraction part." - + precision := anInteger \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/print.on..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/print.on..st index 9ad6fbb5..67dd487b 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/print.on..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/print.on..st @@ -2,7 +2,7 @@ printing print: aNumber on: aStream aNumber isNaN ifTrue: [ ^ self printNaN: aNumber on: aStream ]. - aNumber isInfinite + aNumber isInfinite ifTrue: [ ^ self printInfinite: aNumber on: aStream ]. precision = 0 ifTrue: [ self printInteger: aNumber on: aStream ] diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/printDigitsOf.withLength.on..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/printDigitsOf.withLength.on..st index 59cfde82..7b24a6aa 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/printDigitsOf.withLength.on..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/printDigitsOf.withLength.on..st @@ -9,7 +9,7 @@ printDigitsOf: aNumber withLength: aLengthInteger on: aStream | divisor current | divisor := base raisedTo: aLengthInteger - index. current := rest // divisor. - separator isNil ifFalse: [ + separator isNil ifFalse: [ (index ~= 1 and: [ (aLengthInteger - index) \\ 3 = 2 ]) ifTrue: [ aStream nextPut: separator ] ]. aStream nextPut: (characters at: current + 1). diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/printInteger.on..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/printInteger.on..st index 39c33dbb..0442220e 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/printInteger.on..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/printInteger.on..st @@ -2,8 +2,8 @@ printing printInteger: aNumber on: aStream | length | length := self lengthOf: aNumber base: base. - + (digits notNil and: [ padding notNil ]) ifTrue: [ self padLeft: padding to: (digits - length) on: aStream ]. - + self printDigitsOf: aNumber withLength: length on: aStream \ No newline at end of file diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.left.on..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.left.on..st index f2f090bd..574c0646 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.left.on..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.left.on..st @@ -1,7 +1,7 @@ utilities separate: aString left: aCharacter on: aStream "Separate from the left side every 3 characters with aCharacter." - + | size | size := aString size. 1 to: size do: [ :index | diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.right..st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.right..st index 26923f9a..e0daa4b1 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.right..st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/separate.right..st @@ -1,7 +1,7 @@ utilities separate: aString right: aCharacter "Separate from the right side every 3 characters with aCharacter." - + | size stream | size := aString size. stream := WriteStream on: (String new: 2 * size). diff --git a/repository/Grease-Core.package/GRNumberPrinter.class/instance/uppercase.st b/repository/Grease-Core.package/GRNumberPrinter.class/instance/uppercase.st index dcf77ba5..1ba88490 100644 --- a/repository/Grease-Core.package/GRNumberPrinter.class/instance/uppercase.st +++ b/repository/Grease-Core.package/GRNumberPrinter.class/instance/uppercase.st @@ -1,5 +1,5 @@ actions uppercase "Use uppercase characters for numbers of base 10 and higher." - + self characters: NumbersToCharactersUppercase \ No newline at end of file diff --git a/repository/Grease-Core.package/GROrderedMultiMap.class/instance/at.add..st b/repository/Grease-Core.package/GROrderedMultiMap.class/instance/at.add..st index 38f1ff12..02112e49 100644 --- a/repository/Grease-Core.package/GROrderedMultiMap.class/instance/at.add..st +++ b/repository/Grease-Core.package/GROrderedMultiMap.class/instance/at.add..st @@ -2,5 +2,5 @@ accessing at: aKey add: aValue "Add an association between aKey and aValue. Do not replace existing values with the same key." - + ^ self privateAt: aKey put: aValue \ No newline at end of file diff --git a/repository/Grease-Core.package/GROrderedMultiMap2.class/instance/at.add..st b/repository/Grease-Core.package/GROrderedMultiMap2.class/instance/at.add..st index 2e6255d6..a8f957ab 100644 --- a/repository/Grease-Core.package/GROrderedMultiMap2.class/instance/at.add..st +++ b/repository/Grease-Core.package/GROrderedMultiMap2.class/instance/at.add..st @@ -2,5 +2,5 @@ adding at: aKey add: aValue "Add an association between aKey and aValue. Do not replace existing values with the same key." - + ^ self privateAt: aKey put: aValue \ No newline at end of file diff --git a/repository/Grease-Core.package/GROrdinalizePrinter.class/instance/ordinalize..st b/repository/Grease-Core.package/GROrdinalizePrinter.class/instance/ordinalize..st index a43d828d..b54bad3d 100644 --- a/repository/Grease-Core.package/GROrdinalizePrinter.class/instance/ordinalize..st +++ b/repository/Grease-Core.package/GROrdinalizePrinter.class/instance/ordinalize..st @@ -2,7 +2,7 @@ private ordinalize: anInteger ^ (anInteger \\ 100 between: 11 and: 13) ifTrue: [ 'th' ] - ifFalse: [ + ifFalse: [ #('st' 'nd' 'rd') - at: anInteger \\ 10 + at: anInteger \\ 10 ifAbsent: [ 'th' ] ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPackage.class/class/grPackages.st b/repository/Grease-Core.package/GRPackage.class/class/grPackages.st index 6b9143cb..b225b989 100644 --- a/repository/Grease-Core.package/GRPackage.class/class/grPackages.st +++ b/repository/Grease-Core.package/GRPackage.class/class/grPackages.st @@ -5,7 +5,7 @@ grPackages | packages package | packages := Dictionary new. self class selectors do: [ :each | - (each numArgs = 0 and: [ each ~= #grPackages ]) ifTrue: [ + (each numArgs = 0 and: [ each ~= #grPackages ]) ifTrue: [ package := self perform: each. packages at: package name put: package ] ]. packages do: [ :each | each resolveWith: packages ]. diff --git a/repository/Grease-Core.package/GRPackage.class/instance/resolveWith..st b/repository/Grease-Core.package/GRPackage.class/instance/resolveWith..st index 2707d7f0..210c7f65 100644 --- a/repository/Grease-Core.package/GRPackage.class/instance/resolveWith..st +++ b/repository/Grease-Core.package/GRPackage.class/instance/resolveWith..st @@ -1,10 +1,10 @@ dependencies resolveWith: aDictionary - dependencies := dependencies + dependencies := dependencies collect: [ :each | aDictionary at: each ifAbsent: [ "if Foo-Pharo-Bar fails try Foo-Pharo20-Bar and Foo-Pharo30-Bar" - (each indexOfSubCollection: '-Pharo-' startingAt: 1) ~= 0 ifTrue: [ + (each indexOfSubCollection: '-Pharo-' startingAt: 1) ~= 0 ifTrue: [ "try -Pharo40-" aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Pharo40-') ifAbsent: [ "try -Pharo50-" @@ -16,7 +16,7 @@ resolveWith: aDictionary "try -Pharo90-" aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Pharo90-') ifAbsent: [ "try -Pharo100-" - aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Pharo100-') ifAbsent: [ + aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Pharo100-') ifAbsent: [ "try -Squeak-" aDictionary at: (each copyReplaceAll: '-Pharo-' with: '-Squeak-') ifAbsent: [ "try -Squeak5-" diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/asMethodReturningString.named..st b/repository/Grease-Core.package/GRPlatform.class/instance/asMethodReturningString.named..st new file mode 100644 index 00000000..1edbb346 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/asMethodReturningString.named..st @@ -0,0 +1,21 @@ +file library +asMethodReturningString: aByteArrayOrString named: aSymbol + "Generates the source of a method named aSymbol that returns aByteArrayOrString as a String. + + This implementation answers a String formatted like so + + aSymbol + ^ aByteArrayOrString + + Subclasses need to override this method if the dialect needs changes to support Unicode string literals" + ^ String streamContents: [ :stream | + stream + nextPutAll: aSymbol; + nextPut: Character cr. + stream + tab; + nextPutAll: '^ '''. + aByteArrayOrString greaseString do: [ :each | + each = $' ifTrue: [ stream nextPut: $' ]. + stream nextPut: each ]. + stream nextPut: $' ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/base64Encode..st b/repository/Grease-Core.package/GRPlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..1e94d60c --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/base64Encode..st @@ -0,0 +1,4 @@ +encoding +base64Encode: aByteArray + "Base64 encode the given byte array and answer the result as a String." + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/bindingOf..st b/repository/Grease-Core.package/GRPlatform.class/instance/bindingOf..st index 8b9e9f23..f3a7c268 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/bindingOf..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/bindingOf..st @@ -4,12 +4,12 @@ bindingOf: aClass The binding is the literal that get compiled into the method. We need the binding to be updated when the class is changed. The binding has to respond to #value. - + This is mostly an issue on GemStone/S because when we hold on to a class directly we will end up holding on to an old class version. - + Dialects with namespaces will need to override this. - + On VisualWorks this should like this ^ aClass fullyQualifiedReference" ^ Smalltalk associationAt: aClass name \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/contentsOfFile.binary..st b/repository/Grease-Core.package/GRPlatform.class/instance/contentsOfFile.binary..st index 291cfff6..515d6552 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/contentsOfFile.binary..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/contentsOfFile.binary..st @@ -1,3 +1,3 @@ -file library +files contentsOfFile: aString binary: aBoolean self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/convertToSmalltalkNewlines..st b/repository/Grease-Core.package/GRPlatform.class/instance/convertToSmalltalkNewlines..st index 0415a873..fd2fdde6 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/convertToSmalltalkNewlines..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/convertToSmalltalkNewlines..st @@ -1,8 +1,8 @@ file library convertToSmalltalkNewlines: aString "Convert any line endings (CR, CRLF, LF) to the default platform newline." - - aString isNil + + aString isNil ifTrue: [ ^ nil ]. ^ String streamContents: [ :writeStream | | readStream | diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/deleteFile..st b/repository/Grease-Core.package/GRPlatform.class/instance/deleteFile..st new file mode 100644 index 00000000..9819eed2 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/deleteFile..st @@ -0,0 +1,3 @@ +files +deleteFile: aPathString + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/directoriesIn..st b/repository/Grease-Core.package/GRPlatform.class/instance/directoriesIn..st index c7077286..14b5f839 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/directoriesIn..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/directoriesIn..st @@ -1,4 +1,4 @@ -file library +files directoriesIn: aPathString "Answer a collection of absolute paths for all the directories (no files) in the directory given by aPathString must not include directory names that start with ." diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/doSilently..st b/repository/Grease-Core.package/GRPlatform.class/instance/doSilently..st new file mode 100644 index 00000000..89a96f47 --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/doSilently..st @@ -0,0 +1,4 @@ +file library +doSilently: aBlock + "Suspend all notifications value evaluating the given block." + ^ aBlock value \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/ensureExistenceOfFolder..st b/repository/Grease-Core.package/GRPlatform.class/instance/ensureExistenceOfFolder..st index c86a0539..a4b8da7c 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/ensureExistenceOfFolder..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/ensureExistenceOfFolder..st @@ -1,4 +1,4 @@ -file library +files ensureExistenceOfFolder: aString "Create a folder named aString in the image directory." self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/fileExists..st b/repository/Grease-Core.package/GRPlatform.class/instance/fileExists..st index fe0b42f0..208d4d40 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/fileExists..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/fileExists..st @@ -1,3 +1,3 @@ -file library +files fileExists: aString self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/fileStreamOn.do.binary..st b/repository/Grease-Core.package/GRPlatform.class/instance/fileStreamOn.do.binary..st index f0155c88..3d9e825a 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/fileStreamOn.do.binary..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/fileStreamOn.do.binary..st @@ -1,6 +1,6 @@ -file library +files fileStreamOn: aString do: aBlock binary: aBoolean - self + self greaseDeprecatedApi: 'GRPlatform>>#fileStreamOn:do:binary:' details: 'Use readFileStreamOn:do:binary:'. ^ self readFileStreamOn: aString do: aBlock binary: aBoolean \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/filesIn..st b/repository/Grease-Core.package/GRPlatform.class/instance/filesIn..st index 1edd1fc6..eacae2b3 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/filesIn..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/filesIn..st @@ -1,4 +1,4 @@ -file library +files filesIn: aPathString "Answer a collection of absolute paths for all the files (no directories) in the directory given by aPathString must not include file names that start with ." diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/isProcessTerminated..st b/repository/Grease-Core.package/GRPlatform.class/instance/isProcessTerminated..st index afa154f2..94e6e96b 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/isProcessTerminated..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/isProcessTerminated..st @@ -1,5 +1,5 @@ processes isProcessTerminated: aProcess "Return a boolean indicating whether aProcess has been terminated." - + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/label.st b/repository/Grease-Core.package/GRPlatform.class/instance/label.st index cc4c5a5b..44330a02 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/label.st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/label.st @@ -1,5 +1,5 @@ version info label "Answer a descriptive label string for the platform implementation" - + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/localNameOf..st b/repository/Grease-Core.package/GRPlatform.class/instance/localNameOf..st index 36c6934d..3e0a423f 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/localNameOf..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/localNameOf..st @@ -1,7 +1,7 @@ -file library +files localNameOf: aFilename "Answer the local name of a file identified by an absolute file path. - + Eg. If the platform is Windwos and aFilename is 'C:\Windows\win32.dll' then it would answer 'win32.dll'. If the platform is Unix and aFilename is '/usr/bin/vim' then it would answer 'vim'." diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/newRandom.st b/repository/Grease-Core.package/GRPlatform.class/instance/newRandom.st index e50a9858..5f6271cc 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/newRandom.st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/newRandom.st @@ -3,9 +3,9 @@ newRandom "Answers the random number generator to be used to create session and continuation keys. Make sure it is seeded. They only methods that will be sent to it are: #nextInt: - should answer a random integer in the interval [1, anInteger] #randomFrom: - should answer a random element from the given collection - + Make sure that both methods are safe under heavy concurrent load. - + Used by Gemstone/S traditional Randoms which cannot be persisted. Used by Squeak to use a secure random when avaiable." 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 index 7b885531..91961b92 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReference.st @@ -1,4 +1,4 @@ -file library +files newTemporaryFileReference "Create a new temporary file in the systems temp directory and answer a reference to it. diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReferenceNamed..st b/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReferenceNamed..st new file mode 100644 index 00000000..93059d5f --- /dev/null +++ b/repository/Grease-Core.package/GRPlatform.class/instance/newTemporaryFileReferenceNamed..st @@ -0,0 +1,3 @@ +files +newTemporaryFileReferenceNamed: aName + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/newline.st b/repository/Grease-Core.package/GRPlatform.class/instance/newline.st index 9c8062eb..3834fe40 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/newline.st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/newline.st @@ -1,5 +1,5 @@ file library newline "Answer a String with the default newline character of this platform." - + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/pathSeparator.st b/repository/Grease-Core.package/GRPlatform.class/instance/pathSeparator.st index 430f97c3..a4c10b7f 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/pathSeparator.st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/pathSeparator.st @@ -1,4 +1,4 @@ -file library +files pathSeparator "Answer the path separator as a String, eg. '/' on Unix and '\' on Windows." self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/readFileStreamOn.do.binary..st b/repository/Grease-Core.package/GRPlatform.class/instance/readFileStreamOn.do.binary..st index 3ffa885a..b43b743e 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/readFileStreamOn.do.binary..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/readFileStreamOn.do.binary..st @@ -1,3 +1,3 @@ -file library +files readFileStreamOn: aString do: aBlock binary: aBoolean - self subclassResponsibility \ No newline at end of file + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/terminateProcess..st b/repository/Grease-Core.package/GRPlatform.class/instance/terminateProcess..st index a7d9537b..36cf5cbc 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/terminateProcess..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/terminateProcess..st @@ -1,5 +1,5 @@ processes terminateProcess: aProcess "Permanently terminate the process, unwinding first to execute #ensure: and #ifCurtailed: blocks." - + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/thisContext.st b/repository/Grease-Core.package/GRPlatform.class/instance/thisContext.st index 22b5c4dd..5f6f20ee 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/thisContext.st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/thisContext.st @@ -1,8 +1,8 @@ processes thisContext "Answer the current activation of a method execution or block activation. - + For dialects with a thisContext variable and implementation can look like this. - + ^ thisContext sender" self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/version.st b/repository/Grease-Core.package/GRPlatform.class/instance/version.st index 1649dccd..2bf3551f 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/version.st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/version.st @@ -2,5 +2,5 @@ version info version "Answer the Grease version" - ^ (GRVersion major: 1 minor: 9 revision: 0) + ^ (GRVersion major: 1 minor: 10 revision: 0) yourself \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/write.toFile.inFolder..st b/repository/Grease-Core.package/GRPlatform.class/instance/write.toFile.inFolder..st index a855cb60..5d974bc9 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/write.toFile.inFolder..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/write.toFile.inFolder..st @@ -1,4 +1,4 @@ -file library +files write: aStringOrByteArray toFile: aFileNameString inFolder: aFolderString "Write aStringOrByteArray to a file named aFileNameString in the folder aFolderString." self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPlatform.class/instance/writeFileStreamOn.do.binary..st b/repository/Grease-Core.package/GRPlatform.class/instance/writeFileStreamOn.do.binary..st index 3d67b1a2..8bf94c9f 100644 --- a/repository/Grease-Core.package/GRPlatform.class/instance/writeFileStreamOn.do.binary..st +++ b/repository/Grease-Core.package/GRPlatform.class/instance/writeFileStreamOn.do.binary..st @@ -1,3 +1,3 @@ -file library +files writeFileStreamOn: aString do: aBlock binary: aBoolean - self subclassResponsibility \ No newline at end of file + self subclassResponsibility \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/absOffsetHoursPadded.st b/repository/Grease-Core.package/GRPrinter.class/class/absOffsetHoursPadded.st index 21f6d41e..c8fc6478 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/absOffsetHoursPadded.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/absOffsetHoursPadded.st @@ -1,5 +1,5 @@ parts-date absOffsetHoursPadded - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date offset hours abs ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/absOffsetMinutesPadded.st b/repository/Grease-Core.package/GRPrinter.class/class/absOffsetMinutesPadded.st index 3ee546ea..ceede65a 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/absOffsetMinutesPadded.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/absOffsetMinutesPadded.st @@ -1,5 +1,5 @@ parts-date absOffsetMinutesPadded - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date offset minutes abs ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/isoTime.st b/repository/Grease-Core.package/GRPrinter.class/class/isoTime.st index b9fa9797..ec25236d 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/isoTime.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/isoTime.st @@ -1,5 +1,5 @@ factory-http isoTime "Ansers a printer that formats time according to ISO(HH:MM:SS) E.g. 12:23:34" - + ^ self paddedHour24 , $: , self paddedMinute , $: , self paddedSecond \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/monthName..st b/repository/Grease-Core.package/GRPrinter.class/class/monthName..st index 3acf62f9..0eaa7afb 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/monthName..st +++ b/repository/Grease-Core.package/GRPrinter.class/class/monthName..st @@ -1,3 +1,3 @@ parts-date -monthName: anArray +monthName: anArray ^ GRPluggablePrinter on: [ :date | anArray at: date monthIndex ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/offsetSign.st b/repository/Grease-Core.package/GRPrinter.class/class/offsetSign.st index de1b6882..583c0f1d 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/offsetSign.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/offsetSign.st @@ -1,6 +1,6 @@ parts-date offsetSign - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date offset ] next: (GRSignPrinter new positivePrinter: $+; diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedCentury.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedCentury.st index 72ffd192..f1367586 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedCentury.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedCentury.st @@ -1,5 +1,5 @@ parts-date paddedCentury - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date year \\ 100 ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedDay.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedDay.st index b9eed5c6..35a1123b 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedDay.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedDay.st @@ -1,5 +1,5 @@ parts-date paddedDay - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date dayOfMonth ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedHour12.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedHour12.st index d2ddb673..c3f66f9d 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedHour12.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedHour12.st @@ -1,5 +1,5 @@ parts-time paddedHour12 - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | (time hour - 1) \\ 12 + 1 ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedHour24.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedHour24.st index 85834571..d7480d63 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedHour24.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedHour24.st @@ -1,5 +1,5 @@ parts-time paddedHour24 - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | time hour ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedMinute.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedMinute.st index ded20981..a8a57c0c 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedMinute.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedMinute.st @@ -1,5 +1,5 @@ parts-time paddedMinute - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | time minute ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedMonth.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedMonth.st index 99bf9d4b..4a655a3f 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedMonth.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedMonth.st @@ -1,5 +1,5 @@ parts-date paddedMonth - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date monthIndex ] next: (self numberWithAtLeastDigits: 2) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedSecond.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedSecond.st index 0d542442..6283fa62 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedSecond.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedSecond.st @@ -1,6 +1,6 @@ parts-time paddedSecond - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | time second ] next: (GRNumberPrinter new padding: $0; diff --git a/repository/Grease-Core.package/GRPrinter.class/class/paddedYear.st b/repository/Grease-Core.package/GRPrinter.class/class/paddedYear.st index 8b8c7830..2734e145 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/paddedYear.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/paddedYear.st @@ -1,5 +1,5 @@ parts-date paddedYear - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date year ] next: (self numberWithAtLeastDigits: 4) \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/rfc1123.st b/repository/Grease-Core.package/GRPrinter.class/class/rfc1123.st index dfda6425..3ecf821a 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/rfc1123.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/rfc1123.st @@ -2,9 +2,9 @@ factory-http rfc1123 "Answers a printer that formats dates for HTTP1.1 (RFC 1123). Eg. Sun, 06 Nov 1994 08:49:37 GMT " - - ^ GRMappedPrinter - block: [ :date | + + ^ GRMappedPrinter + block: [ :date | "For the purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal Time)" date asUTC ] next: GRSequentialPrinter new , self abbreviatedWeekName , ', ' , self paddedDay , Character space , self abbreviatedMonthName , Character space , self paddedYear , Character space , self isoTime , ' GMT' \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedCentury.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedCentury.st index 4380f77e..bc7ac349 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedCentury.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedCentury.st @@ -1,5 +1,5 @@ parts-date unpaddedCentury - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date year \\ 100 ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedDay.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedDay.st index a9e973f3..1c0ae5f5 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedDay.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedDay.st @@ -1,5 +1,5 @@ parts-date unpaddedDay - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date dayOfMonth ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour12.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour12.st index 60942672..2c146675 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour12.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour12.st @@ -1,5 +1,5 @@ parts-time unpaddedHour12 - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | (time hour - 1) \\ 12 + 1 ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour24.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour24.st index b850356d..e84fe99c 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour24.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedHour24.st @@ -1,5 +1,5 @@ parts-time unpaddedHour24 - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | time hour ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMinute.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMinute.st index 4215c0ab..53cdf04c 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMinute.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMinute.st @@ -1,5 +1,5 @@ parts-time unpaddedMinute - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | time minute ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMonth.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMonth.st index ed4bf5a2..38090256 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMonth.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedMonth.st @@ -1,5 +1,5 @@ parts-date unpaddedMonth - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date monthIndex ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedSecond.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedSecond.st index 177d6e77..368fe3d8 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedSecond.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedSecond.st @@ -1,5 +1,5 @@ parts-time unpaddedSecond - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :time | time second ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedYear.st b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedYear.st index 3a74d2ad..8959df3f 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/unpaddedYear.st +++ b/repository/Grease-Core.package/GRPrinter.class/class/unpaddedYear.st @@ -1,5 +1,5 @@ parts-date unpaddedYear - ^ GRMappedPrinter + ^ GRMappedPrinter block: [ :date | date year ] next: GRNumberPrinter new \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/class/weekName..st b/repository/Grease-Core.package/GRPrinter.class/class/weekName..st index c49b2f90..ca348c35 100644 --- a/repository/Grease-Core.package/GRPrinter.class/class/weekName..st +++ b/repository/Grease-Core.package/GRPrinter.class/class/weekName..st @@ -1,3 +1,3 @@ parts-date -weekName: anArray +weekName: anArray ^ GRPluggablePrinter on: [ :date | anArray at: date dayOfWeek ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRPrinter.class/instance/^comma.st b/repository/Grease-Core.package/GRPrinter.class/instance/^comma.st index 533a11bd..a5ed96c8 100644 --- a/repository/Grease-Core.package/GRPrinter.class/instance/^comma.st +++ b/repository/Grease-Core.package/GRPrinter.class/instance/^comma.st @@ -1,3 +1,3 @@ operators -, aPrinter +, aPrinter ^ GRSequentialPrinter new , self , aPrinter \ No newline at end of file diff --git a/repository/Grease-Core.package/GRSequentialPrinter.class/instance/print.on..st b/repository/Grease-Core.package/GRSequentialPrinter.class/instance/print.on..st index b8a6a1a7..b4c06885 100644 --- a/repository/Grease-Core.package/GRSequentialPrinter.class/instance/print.on..st +++ b/repository/Grease-Core.package/GRSequentialPrinter.class/instance/print.on..st @@ -1,3 +1,3 @@ printing -print: anObject on: aStream +print: anObject on: aStream parts do: [ :each | each print: anObject on: aStream ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRSignPrinter.class/instance/negativePrinter..st b/repository/Grease-Core.package/GRSignPrinter.class/instance/negativePrinter..st index 87b49fb0..910228c3 100644 --- a/repository/Grease-Core.package/GRSignPrinter.class/instance/negativePrinter..st +++ b/repository/Grease-Core.package/GRSignPrinter.class/instance/negativePrinter..st @@ -1,5 +1,5 @@ accessing negativePrinter: aPrinter "The printer to be used when the number is negative." - + negativePrinter := aPrinter \ No newline at end of file diff --git a/repository/Grease-Core.package/GRSignPrinter.class/instance/positivePrinter..st b/repository/Grease-Core.package/GRSignPrinter.class/instance/positivePrinter..st index e62ba1e8..f4c64563 100644 --- a/repository/Grease-Core.package/GRSignPrinter.class/instance/positivePrinter..st +++ b/repository/Grease-Core.package/GRSignPrinter.class/instance/positivePrinter..st @@ -1,5 +1,5 @@ accessing positivePrinter: aPrinter "The printer to be used when the number is zero or positive." - + positivePrinter := aPrinter \ No newline at end of file diff --git a/repository/Grease-Core.package/GRSignPrinter.class/instance/print.on..st b/repository/Grease-Core.package/GRSignPrinter.class/instance/print.on..st index a7046136..acf1c72d 100644 --- a/repository/Grease-Core.package/GRSignPrinter.class/instance/print.on..st +++ b/repository/Grease-Core.package/GRSignPrinter.class/instance/print.on..st @@ -1,5 +1,5 @@ printing -print: anObject on: aStream +print: anObject on: aStream anObject negative ifTrue: [ negativePrinter print: anObject on: aStream ] ifFalse: [ positivePrinter print: anObject on: aStream ] \ No newline at end of file diff --git a/repository/Grease-Core.package/GRSmallDictionary.class/instance/printOn..st b/repository/Grease-Core.package/GRSmallDictionary.class/instance/printOn..st index 9138b7f5..1dc1be7b 100644 --- a/repository/Grease-Core.package/GRSmallDictionary.class/instance/printOn..st +++ b/repository/Grease-Core.package/GRSmallDictionary.class/instance/printOn..st @@ -1,7 +1,7 @@ printing printOn: aStream super printOn: aStream. - + aStream nextPut: $(. self size <= 100 ifTrue: [ @@ -14,7 +14,7 @@ printOn: aStream ifFalse: [ aStream space ]. aStream print: key; - nextPutAll: '->'; + nextPutAll: '->'; print: value ] ] ifFalse: [ aStream diff --git a/repository/Grease-Core.package/GRSmallDictionary.class/instance/removeIndex..st b/repository/Grease-Core.package/GRSmallDictionary.class/instance/removeIndex..st index 872fceb8..d936d69f 100644 --- a/repository/Grease-Core.package/GRSmallDictionary.class/instance/removeIndex..st +++ b/repository/Grease-Core.package/GRSmallDictionary.class/instance/removeIndex..st @@ -3,7 +3,7 @@ removeIndex: index | value | value := values at: index. index to: size - 1 do: - [ :i | + [ :i | keys at: i put: (keys at: i + 1). values at: i put: (values at: i + 1) ]. keys at: size put: nil. diff --git a/repository/Grease-Core.package/GRSmallDictionary2.class/instance/printOn..st b/repository/Grease-Core.package/GRSmallDictionary2.class/instance/printOn..st index 9138b7f5..1dc1be7b 100644 --- a/repository/Grease-Core.package/GRSmallDictionary2.class/instance/printOn..st +++ b/repository/Grease-Core.package/GRSmallDictionary2.class/instance/printOn..st @@ -1,7 +1,7 @@ printing printOn: aStream super printOn: aStream. - + aStream nextPut: $(. self size <= 100 ifTrue: [ @@ -14,7 +14,7 @@ printOn: aStream ifFalse: [ aStream space ]. aStream print: key; - nextPutAll: '->'; + nextPutAll: '->'; print: value ] ] ifFalse: [ aStream diff --git a/repository/Grease-Core.package/GRSmallDictionary2.class/instance/removeIndex..st b/repository/Grease-Core.package/GRSmallDictionary2.class/instance/removeIndex..st index 10b8c291..79822d57 100644 --- a/repository/Grease-Core.package/GRSmallDictionary2.class/instance/removeIndex..st +++ b/repository/Grease-Core.package/GRSmallDictionary2.class/instance/removeIndex..st @@ -2,7 +2,7 @@ private removeIndex: index | value | value := table at: index + 1. - index to: size * 2 - 2 do: [ :i | + index to: size * 2 - 2 do: [ :i | table at: i put: (table at: i + 2) ]. table at: size * 2 - 1 put: nil. table at: size * 2 put: nil. diff --git a/repository/Grease-Core.package/GRSmallOrderedSet.class/instance/privateAdd..st b/repository/Grease-Core.package/GRSmallOrderedSet.class/instance/privateAdd..st index 52130cfb..a66f316b 100644 --- a/repository/Grease-Core.package/GRSmallOrderedSet.class/instance/privateAdd..st +++ b/repository/Grease-Core.package/GRSmallOrderedSet.class/instance/privateAdd..st @@ -1,4 +1,4 @@ private privateAdd: newObject size = table size ifTrue: [ self grow ]. - table at: (size := size + 1) put: newObject. \ No newline at end of file + table at: (size := size + 1) put: newObject \ No newline at end of file diff --git a/repository/Grease-Core.package/GRStringPrinter.class/instance/character..st b/repository/Grease-Core.package/GRStringPrinter.class/instance/character..st index 5f92375b..fd789e7b 100644 --- a/repository/Grease-Core.package/GRStringPrinter.class/instance/character..st +++ b/repository/Grease-Core.package/GRStringPrinter.class/instance/character..st @@ -1,5 +1,5 @@ accessing character: aCharacter "The character to pad the string with." - + character := aCharacter \ No newline at end of file diff --git a/repository/Grease-Core.package/GRStringPrinter.class/instance/padCenter.st b/repository/Grease-Core.package/GRStringPrinter.class/instance/padCenter.st index c4090a8c..d67d56a5 100644 --- a/repository/Grease-Core.package/GRStringPrinter.class/instance/padCenter.st +++ b/repository/Grease-Core.package/GRStringPrinter.class/instance/padCenter.st @@ -1,5 +1,5 @@ padding padCenter "Pad to the center." - + pad := #pad:center:to: \ No newline at end of file diff --git a/repository/Grease-Core.package/GRStringPrinter.class/instance/padLeft.st b/repository/Grease-Core.package/GRStringPrinter.class/instance/padLeft.st index 607d8b5f..e12c2152 100644 --- a/repository/Grease-Core.package/GRStringPrinter.class/instance/padLeft.st +++ b/repository/Grease-Core.package/GRStringPrinter.class/instance/padLeft.st @@ -1,5 +1,5 @@ padding padLeft "Pad to the left." - + pad := #pad:left:to: \ No newline at end of file diff --git a/repository/Grease-Core.package/GRStringPrinter.class/instance/padNone.st b/repository/Grease-Core.package/GRStringPrinter.class/instance/padNone.st index 549c1100..8ef5e9f2 100644 --- a/repository/Grease-Core.package/GRStringPrinter.class/instance/padNone.st +++ b/repository/Grease-Core.package/GRStringPrinter.class/instance/padNone.st @@ -1,5 +1,5 @@ padding padNone "Do not pad the input." - + pad := nil \ No newline at end of file diff --git a/repository/Grease-Core.package/GRStringPrinter.class/instance/padRight.st b/repository/Grease-Core.package/GRStringPrinter.class/instance/padRight.st index 81897648..57cb176b 100644 --- a/repository/Grease-Core.package/GRStringPrinter.class/instance/padRight.st +++ b/repository/Grease-Core.package/GRStringPrinter.class/instance/padRight.st @@ -1,5 +1,5 @@ padding padRight "Pad to the right." - + pad := #pad:right:to: \ No newline at end of file diff --git a/repository/Grease-Core.package/GRStringPrinter.class/instance/print.on..st b/repository/Grease-Core.package/GRStringPrinter.class/instance/print.on..st index 77cb55a3..7646fdad 100644 --- a/repository/Grease-Core.package/GRStringPrinter.class/instance/print.on..st +++ b/repository/Grease-Core.package/GRStringPrinter.class/instance/print.on..st @@ -1,11 +1,11 @@ printing -print: anObject on: aStream +print: anObject on: aStream | string | string := anObject greaseString. trim isNil ifFalse: [ string := string perform: trim ]. length isNil ifFalse: [ - length < string size + length < string size ifTrue: [ string := string copyFrom: 1 to: length ]. (pad isNil or: [ character isNil ]) ifFalse: [ string := self perform: pad with: string with: character with: length ] ]. diff --git a/repository/Grease-Core.package/GRUnitPrinter.class/class/base.units..st b/repository/Grease-Core.package/GRUnitPrinter.class/class/base.units..st index b547b8ef..a824c272 100644 --- a/repository/Grease-Core.package/GRUnitPrinter.class/class/base.units..st +++ b/repository/Grease-Core.package/GRUnitPrinter.class/class/base.units..st @@ -1,6 +1,6 @@ instance creation base: anInteger units: anArray - ^ self new + ^ self new base: anInteger; units: anArray; yourself \ No newline at end of file diff --git a/repository/Grease-Core.package/Integer.extension/instance/pluralize..st b/repository/Grease-Core.package/Integer.extension/instance/pluralize..st index 35ed7d73..449e521b 100644 --- a/repository/Grease-Core.package/Integer.extension/instance/pluralize..st +++ b/repository/Grease-Core.package/Integer.extension/instance/pluralize..st @@ -1,5 +1,5 @@ *grease-core -pluralize: aSingularString - ^ self +pluralize: aSingularString + ^ self pluralize: aSingularString with: (GRInflector pluralize: aSingularString) \ No newline at end of file diff --git a/repository/Grease-Core.package/Object.extension/instance/greaseDeprecatedApi.details..st b/repository/Grease-Core.package/Object.extension/instance/greaseDeprecatedApi.details..st index e35298ad..475f1bb6 100644 --- a/repository/Grease-Core.package/Object.extension/instance/greaseDeprecatedApi.details..st +++ b/repository/Grease-Core.package/Object.extension/instance/greaseDeprecatedApi.details..st @@ -1,5 +1,5 @@ *grease-core -greaseDeprecatedApi: apiString details: detailsString +greaseDeprecatedApi: apiString details: detailsString GRDeprecatedApiNotification new details: detailsString; signal: apiString \ No newline at end of file diff --git a/repository/Grease-Core.package/String.extension/instance/excerpt..st b/repository/Grease-Core.package/String.extension/instance/excerpt..st index 21b44226..c6843001 100644 --- a/repository/Grease-Core.package/String.extension/instance/excerpt..st +++ b/repository/Grease-Core.package/String.extension/instance/excerpt..st @@ -1,5 +1,5 @@ *grease-core excerpt: aString "Answer an excerpt of the receiver that matches the first occurence of aString. If aString isn't found, nil is answered." - + ^ self excerpt: aString radius: 100 \ No newline at end of file diff --git a/repository/Grease-Core.package/String.extension/instance/excerpt.radius..st b/repository/Grease-Core.package/String.extension/instance/excerpt.radius..st index 57c3607f..98a14aa7 100644 --- a/repository/Grease-Core.package/String.extension/instance/excerpt.radius..st +++ b/repository/Grease-Core.package/String.extension/instance/excerpt.radius..st @@ -1,5 +1,5 @@ *grease-core excerpt: aString radius: anInteger "Answer an excerpt of the receiver that matches the first occurence of aString. The radius anInteger expands the excerpt on each side of the first occurrence by the number of characters defined in radius. If aString isn't found, nil is answered." - + ^ self excerpt: aString radius: anInteger ellipsis: '...' \ No newline at end of file diff --git a/repository/Grease-Core.package/String.extension/instance/greaseInteger.st b/repository/Grease-Core.package/String.extension/instance/greaseInteger.st index ad2d0b4d..ddc5b29d 100644 --- a/repository/Grease-Core.package/String.extension/instance/greaseInteger.st +++ b/repository/Grease-Core.package/String.extension/instance/greaseInteger.st @@ -16,7 +16,7 @@ greaseInteger ifTrue: [ 0 ] ifFalse: [ 10 * number ]) + (char greaseInteger - $0 greaseInteger) ] ifFalse: [ - ^ number isNil ifFalse: [ + ^ number isNil ifFalse: [ negated not ifFalse: [ number negated ] ifTrue: [ number ] ] ] ] ]. diff --git a/repository/Grease-Core.package/String.extension/instance/truncate..st b/repository/Grease-Core.package/String.extension/instance/truncate..st index 8e624b44..7bda5b57 100644 --- a/repository/Grease-Core.package/String.extension/instance/truncate..st +++ b/repository/Grease-Core.package/String.extension/instance/truncate..st @@ -1,5 +1,5 @@ *grease-core truncate: anInteger "Truncate the receiver to anInteger characters." - + ^ self truncate: anInteger ellipsis: '...' \ No newline at end of file diff --git a/repository/Grease-Core.package/String.extension/instance/truncate.st b/repository/Grease-Core.package/String.extension/instance/truncate.st index 1c855a76..6217e9c2 100644 --- a/repository/Grease-Core.package/String.extension/instance/truncate.st +++ b/repository/Grease-Core.package/String.extension/instance/truncate.st @@ -1,5 +1,5 @@ *grease-core truncate "Truncate the receiver to 30 characters." - + ^ self truncate: 30 \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/base64Encode..st b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..4a3631f8 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/GRGemStonePlatform.class/instance/base64Encode..st @@ -0,0 +1,3 @@ +encoding +base64Encode: aByteArray + ^ (Base64MimeConverter mimeEncode: aByteArray readStream) contents diff --git a/repository/Grease-GemStone-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st b/repository/Grease-GemStone-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st new file mode 100644 index 00000000..d9528b3d --- /dev/null +++ b/repository/Grease-GemStone-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st @@ -0,0 +1,5 @@ +*grease-gemstone-core +greaseBeginsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-GemStone-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st b/repository/Grease-GemStone-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st new file mode 100644 index 00000000..242c2dd4 --- /dev/null +++ b/repository/Grease-GemStone-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st @@ -0,0 +1,5 @@ +*grease-gemstone-core +greaseEndsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/decoderFor..st b/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/decoderFor..st index 256dbac4..5bce5556 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/decoderFor..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/decoderFor..st @@ -1,4 +1,4 @@ conversion -decoderFor: aReadStream +decoderFor: aReadStream "wrap to avoid String vs ByteArray issues" ^ GRPharoLatin1CodecStream on: aReadStream \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/encoderFor..st b/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/encoderFor..st index 20102849..1f770ac9 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/encoderFor..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/encoderFor..st @@ -1,4 +1,4 @@ conversion -encoderFor: aWriteStream +encoderFor: aWriteStream "wrap to avoid String vs ByteArray issues" ^ GRPharoLatin1CodecStream on: aWriteStream \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/initializeWithName..st b/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/initializeWithName..st index b0256973..03133d93 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/initializeWithName..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoLatin1Codec.class/instance/initializeWithName..st @@ -1,4 +1,4 @@ initialization -initializeWithName: aString +initializeWithName: aString self initialize. name := aString \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/addToStartUpList..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/addToStartUpList..st index c4ab1dea..8721690e 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/addToStartUpList..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/addToStartUpList..st @@ -2,4 +2,4 @@ startup addToStartUpList: aClass "Add anObject to the startup-list of the system. On startup the message #startUp will be sent to anObject." - SessionManager default registerUserClassNamed: aClass name. \ No newline at end of file + SessionManager default registerUserClassNamed: aClass name \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/base64Encode..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..4cb93d20 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/base64Encode..st @@ -0,0 +1,3 @@ +encoding +base64Encode: aByteArray + ^ aByteArray base64Encoded \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/bindingOf..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/bindingOf..st index e878c01b..f121b44b 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/bindingOf..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/bindingOf..st @@ -1,4 +1,4 @@ bindings bindingOf: aClass - + ^ Smalltalk globals associationAt: aClass name \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/compile.into.classified..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/compile.into.classified..st index 45c37a45..c64d0bc2 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/compile.into.classified..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/compile.into.classified..st @@ -1,3 +1,3 @@ file library -compile: aString into: aClass classified: aSymbol +compile: aString into: aClass classified: aSymbol aClass compile: aString classified: aSymbol \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st index ecfdc9d4..01aff905 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st @@ -1,3 +1,3 @@ -file library +files contentsOfFile: aString binary: aBoolean ^ self readFileStreamOn: aString do: [ :stream | stream contents ] binary: aBoolean \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/deleteFile..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/deleteFile..st new file mode 100644 index 00000000..69d63003 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/deleteFile..st @@ -0,0 +1,3 @@ +files +deleteFile: aPathString + aPathString asFileReference delete \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/directoriesIn..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/directoriesIn..st index c5beee09..81b4dce9 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/directoriesIn..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/directoriesIn..st @@ -1,8 +1,8 @@ -file library +files directoriesIn: aPathString "Answer a collection of absolute paths for all the directories (no files) in the directory given by aPathString must not include directory names that start with ." - ^ Array streamContents: [ :stream | + ^ Array streamContents: [ :stream | FileSystem disk directoriesAt: aPathString do: [ :each | each basename first = $. ifFalse: [ stream nextPut: each asFileReference fullName ] ] ] \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st index 907e0168..ef505d70 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st @@ -1,4 +1,4 @@ -file library +files ensureExistenceOfFolder: aString "creates a folder named aString in the image directory" FileSystem disk ensureCreateDirectory: aString \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/fileExists..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/fileExists..st index 2a02cc3f..1fc0dddf 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/fileExists..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/fileExists..st @@ -1,3 +1,3 @@ -file library +files fileExists: aString - ^ aString asFileReference exists \ No newline at end of file + ^ aString asFileReference exists \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/filesIn..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/filesIn..st index e3b9a6b0..4b9fcd27 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/filesIn..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/filesIn..st @@ -1,8 +1,8 @@ -file library +files filesIn: aPathString "Return a collection of absolute paths for all the files (no directories) in the directory given by aPathString must not include file names that start with ." - ^ Array streamContents: [ :stream | + ^ Array streamContents: [ :stream | FileSystem disk filesAt: aPathString do: [ :each | each basename first = $. ifFalse: [ stream nextPut: each asFileReference fullName ] ] ] \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/localNameOf..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/localNameOf..st index 8f4efb85..64db9825 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/localNameOf..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/localNameOf..st @@ -1,3 +1,3 @@ -file library +files localNameOf: aFilename ^ (FileSystem disk resolveString: aFilename) basename \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newRandom.st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newRandom.st index 9d90824d..eb03a167 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newRandom.st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newRandom.st @@ -3,8 +3,8 @@ newRandom "Answers the random number generator to be used to create session and continuation keys. Make sure it is seeded. They only methods that will be sent to it are: #nextInt: - should answer a random integer in the interval [1, anInteger] #randomFrom: - should answer a random element from the given collection - + Make sure that both methods are safe under heavy concurrent load. - + Used by Gemstone/S traditional Randoms which cannot be persisted.." ^ GRPharoRandomProvider \ 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 index 272bb249..cd503715 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st @@ -1,8 +1,8 @@ -file library +files 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 + ^ self newTemporaryFileReferenceNamed: UUID new asString \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st new file mode 100644 index 00000000..5f4d0602 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st @@ -0,0 +1,8 @@ +files +newTemporaryFileReferenceNamed: aName + "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 / aName \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/openDebuggerOn..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/openDebuggerOn..st index 305157e2..d417abb1 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/openDebuggerOn..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/openDebuggerOn..st @@ -1,18 +1,3 @@ exceptions openDebuggerOn: anError - | process | - process := Processor activeProcess. - "If we are running in the UI process, we don't want to suspend the active process. The - error was presumably triggered while stepping in the Debugger. If we simply immediately - signal an UnhandledError, the debugger will catch this and display the signaling context. - It isn't perfect or pretty but it works." - (ProcessBrowser isUIProcess: process) - ifTrue: [ - UnhandledError signalForException: anError ] - ifFalse: [ - WorldState addDeferredUIMessage: [ - UIManager default - requestDebuggerOpeningForProcess: process - named: anError description - inContext: anError signalerContext ]. - process suspend ] \ No newline at end of file + (OupsDebugRequest newForException: anError) submit \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/pathSeparator.st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/pathSeparator.st index 10f88300..2da9f364 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/pathSeparator.st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/pathSeparator.st @@ -1,3 +1,3 @@ -file library +files pathSeparator ^ String with: FileSystem disk delimiter \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st index 1852f83e..6324baf5 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st @@ -1,4 +1,4 @@ -file library +files readFileStreamOn: aString do: aBlock binary: aBoolean ^ aBoolean diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readWriteByteStream.st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readWriteByteStream.st index db9518ee..142efa0f 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readWriteByteStream.st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/readWriteByteStream.st @@ -1,5 +1,5 @@ factory readWriteByteStream "ByteArray based read write stream" - + ^ ReadWriteStream on: (ByteArray new: 4096) \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/stackDepth.st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/stackDepth.st index d7e6feab..7b994393 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/stackDepth.st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/stackDepth.st @@ -1,6 +1,6 @@ exceptions stackDepth - + | depth current | depth := 0. current := thisContext. diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/thisContext.st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/thisContext.st index c936ecad..97018fc5 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/thisContext.st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/thisContext.st @@ -1,4 +1,4 @@ processes thisContext - + ^ thisContext sender \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st index bbde965a..6a1bd7a0 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st @@ -1,4 +1,4 @@ -file library +files write: aStringOrByteArray toFile: aFileNameString inFolder: aFolderString "writes aStringOrByteArray to a file named aFilenameString in the folder aFolderString" ^ self diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st index 0b43135e..43d33949 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st @@ -1,4 +1,4 @@ -file library +files writeFileStreamOn: aString do: aBlock binary: aBoolean ^ aBoolean ifTrue: [ aString asFileReference binaryWriteStreamDo: aBlock ] diff --git a/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/decoderFor..st b/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/decoderFor..st index 0e839208..be53dfea 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/decoderFor..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/decoderFor..st @@ -1,3 +1,3 @@ conversion -decoderFor: aStream +decoderFor: aStream ^ self encoderFor: aStream \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/encoderFor..st b/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/encoderFor..st index e64e8135..83482e43 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/encoderFor..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/encoderFor..st @@ -1,5 +1,5 @@ conversion -encoderFor: aStream - ^ GRPharoZnCodecStream +encoderFor: aStream + ^ GRPharoZnCodecStream on: aStream withEncoder: (ZnCharacterEncoder newForEncoding: self name) \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/initializeWithName..st b/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/initializeWithName..st index 57f52136..e7c86042 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/initializeWithName..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoZnCodec.class/instance/initializeWithName..st @@ -2,6 +2,6 @@ initialization initializeWithName: aString self initialize. name := aString. - urlCodec := (#('iso-8859-15' 'cp-1252' 'utf8' 'utf-8' 'UTF-8') includes: aString) + urlCodec := (#('iso-8859-15' 'cp-1252' 'utf8' 'utf-8' 'UTF-8') includes: aString) ifFalse: [ GRCodec forEncoding: 'utf8' ] ifTrue: [ self ] \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/greaseNext.putAll.startingAt..st b/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/greaseNext.putAll.startingAt..st index 73411a20..365093e2 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/greaseNext.putAll.startingAt..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/greaseNext.putAll.startingAt..st @@ -1,3 +1,3 @@ accessing greaseNext: anInteger putAll: aCollection startingAt: startIndex - self nextPutAll: (aCollection copyFrom: startIndex to: startIndex + anInteger - 1) \ No newline at end of file + encoder next: anInteger putAll: aCollection startingAt: startIndex toStream: stream \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPut..st b/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPut..st index 3cad62a0..30014e3d 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPut..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPut..st @@ -1,3 +1,3 @@ accessing nextPut: aCharacter - encoder nextPut: aCharacter asCharacter toStream: stream \ No newline at end of file + encoder nextPut: aCharacter asCharacter toStream: stream \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPutAll..st b/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPutAll..st index f8f3e8e4..bd42bba5 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPutAll..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoZnCodecStream.class/instance/nextPutAll..st @@ -1,3 +1,5 @@ streaming nextPutAll: aString - aString asString do:[ :each | self nextPut: each ] \ No newline at end of file + | string | + string := aString asString. + encoder next: string size putAll: string startingAt: 1 toStream: stream \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/GRSmallDictionary.extension/instance/inspectionItems..st b/repository/Grease-Pharo100-Core.package/GRSmallDictionary.extension/instance/inspectionItems..st index 0f446672..cb666a56 100644 --- a/repository/Grease-Pharo100-Core.package/GRSmallDictionary.extension/instance/inspectionItems..st +++ b/repository/Grease-Pharo100-Core.package/GRSmallDictionary.extension/instance/inspectionItems..st @@ -1,14 +1,14 @@ *Grease-Pharo100-Core inspectionItems: aBuilder - - - ^ aBuilder newTable - addColumn: (SpStringTableColumn + + + ^ aBuilder newTable + addColumn: (SpStringTableColumn title: 'Key' evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each key ]) beSortable; - addColumn: (SpStringTableColumn - title: 'Value' + addColumn: (SpStringTableColumn + title: 'Value' evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each value ]) beSortable; items: self associations; diff --git a/repository/Grease-Pharo100-Core.package/GRSmallDictionary2.extension/instance/inspectionItems..st b/repository/Grease-Pharo100-Core.package/GRSmallDictionary2.extension/instance/inspectionItems..st index 0f446672..cb666a56 100644 --- a/repository/Grease-Pharo100-Core.package/GRSmallDictionary2.extension/instance/inspectionItems..st +++ b/repository/Grease-Pharo100-Core.package/GRSmallDictionary2.extension/instance/inspectionItems..st @@ -1,14 +1,14 @@ *Grease-Pharo100-Core inspectionItems: aBuilder - - - ^ aBuilder newTable - addColumn: (SpStringTableColumn + + + ^ aBuilder newTable + addColumn: (SpStringTableColumn title: 'Key' evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each key ]) beSortable; - addColumn: (SpStringTableColumn - title: 'Value' + addColumn: (SpStringTableColumn + title: 'Value' evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each value ]) beSortable; items: self associations; diff --git a/repository/Grease-Pharo100-Core.package/Interval.extension/instance/any.st b/repository/Grease-Pharo100-Core.package/Interval.extension/instance/any.st index 5568eb95..45ebf480 100644 --- a/repository/Grease-Pharo100-Core.package/Interval.extension/instance/any.st +++ b/repository/Grease-Pharo100-Core.package/Interval.extension/instance/any.st @@ -2,5 +2,5 @@ any "#first (used by SequenceableCollection>>anyOne) is an accessor of Interval and does not error on an empty Interval." - + ^ self at: 1 \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/PositionableStream.extension/instance/greaseUpToAll..st b/repository/Grease-Pharo100-Core.package/PositionableStream.extension/instance/greaseUpToAll..st index 348d9987..b3fd7893 100644 --- a/repository/Grease-Pharo100-Core.package/PositionableStream.extension/instance/greaseUpToAll..st +++ b/repository/Grease-Pharo100-Core.package/PositionableStream.extension/instance/greaseUpToAll..st @@ -1,5 +1,5 @@ *Grease-Pharo100-Core -greaseUpToAll: aCollection +greaseUpToAll: aCollection "Needed for Seaside ports to other dialects where #upToAll: may have different semantics" ^ self upToAll: aCollection \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st index 2cd270c8..738a82b7 100644 --- a/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st +++ b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st @@ -1,4 +1,8 @@ *Grease-Pharo100-Core beginsWithSubCollection: aSequenceableCollection "Some platforms implement #beginsWith: to answer true for an empty argument." + self + greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:' + details: 'Use SequenceableCollection>>#greaseBegins:'. + aSequenceableCollection isEmpty ifTrue: [ ^ false ]. ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st index d3b8f6eb..43af03a2 100644 --- a/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st +++ b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st @@ -1,4 +1,8 @@ *Grease-Pharo100-Core endsWithSubCollection: aSequenceableCollection "Some platforms implement #endsWith: to answer true for an empty argument." + self + greaseDeprecatedApi: 'SequenceableCollection>>#endsWithSubCollection:' + details: 'Use SequenceableCollection>>#greaseEndsWith:'. + aSequenceableCollection isEmpty ifTrue: [ ^ false ]. ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st new file mode 100644 index 00000000..572bc2ce --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st @@ -0,0 +1,5 @@ +*Grease-Pharo100-Core +greaseBeginsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st new file mode 100644 index 00000000..efbbc0d0 --- /dev/null +++ b/repository/Grease-Pharo100-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st @@ -0,0 +1,5 @@ +*Grease-Pharo100-Core +greaseEndsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo40-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st b/repository/Grease-Pharo40-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st index 643668f1..776d58af 100644 --- a/repository/Grease-Pharo40-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st +++ b/repository/Grease-Pharo40-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st @@ -3,6 +3,6 @@ initialize super initialize. self rewriteRule replace: '`@collection beginsWith: `@subCollection' - with: '`@collection beginsWithSubCollection: `@subCollection'; + with: '`@collection greaseBeginsWith: `@subCollection'; replace: '`@collection endsWith: `@subCollection' - with: '`@collection endsWithSubCollection: `@subCollection' \ No newline at end of file + with: '`@collection greaseEndsWith: `@subCollection' \ No newline at end of file diff --git a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/base64Encode..st b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..f5e24f05 --- /dev/null +++ b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/base64Encode..st @@ -0,0 +1,3 @@ +encoding +base64Encode: aByteArray + ^ (Base64MimeConverter base64Encode: aByteArray readStream) contents diff --git a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/stackDepth.st b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/stackDepth.st index d7e6feab..7b994393 100644 --- a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/stackDepth.st +++ b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/stackDepth.st @@ -1,6 +1,6 @@ exceptions stackDepth - + | depth current | depth := 0. current := thisContext. diff --git a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/thisContext.st b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/thisContext.st index c936ecad..97018fc5 100644 --- a/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/thisContext.st +++ b/repository/Grease-Pharo60-Core.package/GRPharoPlatform.class/instance/thisContext.st @@ -1,4 +1,4 @@ processes thisContext - + ^ thisContext sender \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/base64Encode..st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..4cb93d20 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/base64Encode..st @@ -0,0 +1,3 @@ +encoding +base64Encode: aByteArray + ^ aByteArray base64Encoded \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/deleteFile..st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/deleteFile..st new file mode 100644 index 00000000..7aa3b432 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/deleteFile..st @@ -0,0 +1,3 @@ +file library +deleteFile: aPathString + aPathString asFileReference delete \ 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 index 272bb249..ce7f6f18 100644 --- a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st @@ -5,4 +5,4 @@ newTemporaryFileReference 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 + ^ self newTemporaryFileReferenceNamed: UUID new asString \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st new file mode 100644 index 00000000..f0fdf80f --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st @@ -0,0 +1,8 @@ +file library +newTemporaryFileReferenceNamed: aName + "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 / aName \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/stackDepth.st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/stackDepth.st index d7e6feab..7b994393 100644 --- a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/stackDepth.st +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/stackDepth.st @@ -1,6 +1,6 @@ exceptions stackDepth - + | depth current | depth := 0. current := thisContext. diff --git a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/thisContext.st b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/thisContext.st index c936ecad..97018fc5 100644 --- a/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/thisContext.st +++ b/repository/Grease-Pharo70-Core.package/GRPharoPlatform.class/instance/thisContext.st @@ -1,4 +1,4 @@ processes thisContext - + ^ thisContext sender \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st b/repository/Grease-Pharo70-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st new file mode 100644 index 00000000..01880fd1 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st @@ -0,0 +1,5 @@ +*Grease-Pharo70-Core +greaseBeginsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo70-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st b/repository/Grease-Pharo70-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st new file mode 100644 index 00000000..a2483ea4 --- /dev/null +++ b/repository/Grease-Pharo70-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st @@ -0,0 +1,5 @@ +*Grease-Pharo70-Core +greaseEndsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/base64Encode..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..4cb93d20 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/base64Encode..st @@ -0,0 +1,3 @@ +encoding +base64Encode: aByteArray + ^ aByteArray base64Encoded \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st index ecfdc9d4..01aff905 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/contentsOfFile.binary..st @@ -1,3 +1,3 @@ -file library +files contentsOfFile: aString binary: aBoolean ^ self readFileStreamOn: aString do: [ :stream | stream contents ] binary: aBoolean \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/deleteFile..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/deleteFile..st new file mode 100644 index 00000000..d3c82d99 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/deleteFile..st @@ -0,0 +1,3 @@ +files +deleteFile: aPathString + aPathString asFileReference delete \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/directoriesIn..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/directoriesIn..st index c5beee09..a6e6c3d1 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/directoriesIn..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/directoriesIn..st @@ -1,4 +1,4 @@ -file library +files directoriesIn: aPathString "Answer a collection of absolute paths for all the directories (no files) in the directory given by aPathString must not include directory names that start with ." diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st index 907e0168..ef505d70 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/ensureExistenceOfFolder..st @@ -1,4 +1,4 @@ -file library +files ensureExistenceOfFolder: aString "creates a folder named aString in the image directory" FileSystem disk ensureCreateDirectory: aString \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/fileExists..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/fileExists..st index 2a02cc3f..e12b7927 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/fileExists..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/fileExists..st @@ -1,3 +1,3 @@ -file library +files fileExists: aString ^ aString asFileReference exists \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/filesIn..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/filesIn..st index e3b9a6b0..230ea184 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/filesIn..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/filesIn..st @@ -1,4 +1,4 @@ -file library +files filesIn: aPathString "Return a collection of absolute paths for all the files (no directories) in the directory given by aPathString must not include file names that start with ." diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/localNameOf..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/localNameOf..st index 8f4efb85..64db9825 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/localNameOf..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/localNameOf..st @@ -1,3 +1,3 @@ -file library +files localNameOf: aFilename ^ (FileSystem disk resolveString: aFilename) basename \ 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 index 272bb249..cd503715 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReference.st @@ -1,8 +1,8 @@ -file library +files 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 + ^ self newTemporaryFileReferenceNamed: UUID new asString \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st new file mode 100644 index 00000000..5f4d0602 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/newTemporaryFileReferenceNamed..st @@ -0,0 +1,8 @@ +files +newTemporaryFileReferenceNamed: aName + "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 / aName \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/pathSeparator.st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/pathSeparator.st index 10f88300..2da9f364 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/pathSeparator.st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/pathSeparator.st @@ -1,3 +1,3 @@ -file library +files pathSeparator ^ String with: FileSystem disk delimiter \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st index 1852f83e..6324baf5 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/readFileStreamOn.do.binary..st @@ -1,4 +1,4 @@ -file library +files readFileStreamOn: aString do: aBlock binary: aBoolean ^ aBoolean diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/stackDepth.st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/stackDepth.st index d7e6feab..7b994393 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/stackDepth.st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/stackDepth.st @@ -1,6 +1,6 @@ exceptions stackDepth - + | depth current | depth := 0. current := thisContext. diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/thisContext.st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/thisContext.st index c936ecad..97018fc5 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/thisContext.st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/thisContext.st @@ -1,4 +1,4 @@ processes thisContext - + ^ thisContext sender \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st index bbde965a..6a1bd7a0 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/write.toFile.inFolder..st @@ -1,4 +1,4 @@ -file library +files write: aStringOrByteArray toFile: aFileNameString inFolder: aFolderString "writes aStringOrByteArray to a file named aFilenameString in the folder aFolderString" ^ self diff --git a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st index 0b43135e..43d33949 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoPlatform.class/instance/writeFileStreamOn.do.binary..st @@ -1,4 +1,4 @@ -file library +files writeFileStreamOn: aString do: aBlock binary: aBoolean ^ aBoolean ifTrue: [ aString asFileReference binaryWriteStreamDo: aBlock ] diff --git a/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/greaseNext.putAll.startingAt..st b/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/greaseNext.putAll.startingAt..st index 73411a20..eed7aded 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/greaseNext.putAll.startingAt..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/greaseNext.putAll.startingAt..st @@ -1,3 +1,3 @@ accessing greaseNext: anInteger putAll: aCollection startingAt: startIndex - self nextPutAll: (aCollection copyFrom: startIndex to: startIndex + anInteger - 1) \ No newline at end of file + encoder next: anInteger putAll: aCollection startingAt: startIndex toStream: stream \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/nextPutAll..st b/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/nextPutAll..st index f8f3e8e4..f7494a83 100644 --- a/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/nextPutAll..st +++ b/repository/Grease-Pharo90-Core.package/GRPharoZnUtf8CodecStream.class/instance/nextPutAll..st @@ -1,3 +1,5 @@ streaming nextPutAll: aString - aString asString do:[ :each | self nextPut: each ] \ No newline at end of file + | string | + string := aString asString. + encoder next: string size putAll: string startingAt: 1 toStream: stream \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st index 7d00507d..290ebb62 100644 --- a/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st +++ b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st @@ -1,4 +1,8 @@ *Grease-Pharo90-Core beginsWithSubCollection: aSequenceableCollection + + self + greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:' + details: 'Use SequenceableCollection>>#greaseBeginsWith:'. "Some platforms implement #beginsWith: to answer true for an empty argument." ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st index 1fe4f069..72070fe2 100644 --- a/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st +++ b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st @@ -1,4 +1,8 @@ *Grease-Pharo90-Core endsWithSubCollection: aSequenceableCollection + + self + greaseDeprecatedApi: 'SequenceableCollection>>#endsWithSubCollection:' + details: 'Use SequenceableCollection>>#greaseEndsWith:'. "Some platforms implement #endsWith: to answer true for an empty argument." ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st new file mode 100644 index 00000000..ccc6dad0 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st @@ -0,0 +1,5 @@ +*Grease-Pharo90-Core +greaseBeginsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st new file mode 100644 index 00000000..49a39d31 --- /dev/null +++ b/repository/Grease-Pharo90-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st @@ -0,0 +1,5 @@ +*Grease-Pharo90-Core +greaseEndsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRAnsiCharactersRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRAnsiCharactersRule.class/instance/initialize.st index 2742a93f..ce50f833 100644 --- a/repository/Grease-Pharo90-Slime.package/GRAnsiCharactersRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRAnsiCharactersRule.class/instance/initialize.st @@ -3,11 +3,11 @@ initialize super initialize. self rewriteRule replace: 'Character value: ``@expr' with: 'Character codePoint: ``@expr'; - replace: '`#source to: `#target' + replace: '`#source to: `#target' withValueFrom: [ :node | RBLiteralNode value: (String streamContents: [ :stream | node receiver value codePoint to: node arguments first value codePoint do: [ :code | stream nextPut: (Character codePoint: code) ] ]) ] - when: [ :node | + when: [ :node | node receiver value isCharacter - and: [ node arguments first value isCharacter ] ] \ No newline at end of file + and: [ node arguments first value isCharacter ] ] \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRAnsiCollectionsRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRAnsiCollectionsRule.class/instance/initialize.st index 1e93cbc8..00acba63 100644 --- a/repository/Grease-Pharo90-Slime.package/GRAnsiCollectionsRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRAnsiCollectionsRule.class/instance/initialize.st @@ -23,7 +23,7 @@ initialize replace: '``@collection valuesDo: ``@block' with: '``@collection do: ``@block'; replace: '``@collection reversed' - with: '``@collection reverse'; + with: '``@collection reverse'; replace: '``@dictionary keysSortedSafely' with: '``@dictionary keys asSortedCollection'; replace: '``@collectionClass new: ``@size withAll: ``@character' diff --git a/repository/Grease-Pharo90-Slime.package/GRAnsiStringsRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRAnsiStringsRule.class/instance/initialize.st index af1892f0..1256fabc 100644 --- a/repository/Grease-Pharo90-Slime.package/GRAnsiStringsRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRAnsiStringsRule.class/instance/initialize.st @@ -14,7 +14,7 @@ initialize replace: '``@string findTokens: ``@arg' withValueFrom: [ :node | | argument | argument := node arguments first. - argument isLiteralNode ifTrue: [ + argument isLiteralNode ifTrue: [ argument value isArray ifTrue: [ argument replaceWith: (RBLiteralNode value: (String withAll: argument value)) ]. argument value isCharacter diff --git a/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/checkClass..st b/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/checkClass..st index b5489e28..1b916f3c 100644 --- a/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/checkClass..st +++ b/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/checkClass..st @@ -1,13 +1,13 @@ running -checkClass: aContext +checkClass: aContext (aContext isMeta not and: [ (aContext includesSelector: #initialize) and: [ (#(GRObject GRNotification GRNotification GRError RBLintRule RBTransformationRule) noneSatisfy: [ :each | aContext includesBehavior: (Smalltalk globals at: each) ]) - and: [ aContext class methodDictionary noneSatisfy: [ :each | - matcher + and: [ aContext class methodDictionary noneSatisfy: [ :each | + matcher executeTree: each parseTree initialAnswer: false ] ] ] ]) ifTrue: [ - result + result addClass: aContext selector: #initialize ] \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/initialize.st index 10faf254..40611cde 100644 --- a/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRBasicNewInitializeMissingRule.class/instance/initialize.st @@ -2,6 +2,6 @@ initialization initialize super initialize. matcher := RBParseTreeSearcher new. - matcher + matcher matches: 'self basicNew initialize' do: [ :node :answer | true ] \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRBlockFormattingRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRBlockFormattingRule.class/instance/initialize.st index c9bda0fc..857cfe81 100644 --- a/repository/Grease-Pharo90-Slime.package/GRBlockFormattingRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRBlockFormattingRule.class/instance/initialize.st @@ -4,7 +4,7 @@ initialize self matcher matches: '[ :`@args | | `@temps | ``@.stmts ]' do: [ :node :answer | - answer isNil + answer isNil ifFalse: [ answer ] ifTrue: [ | source | @@ -16,7 +16,7 @@ initialize (before isSeparator and: [ after isSeparator ]) ifFalse: [ node ] ifTrue: [ - node bar notNil ifTrue: [ + node bar notNil ifTrue: [ before := source at: node bar - 1 ifAbsent: [ $ ]. after := source at: node bar + 1 ifAbsent: [ $ ]. (before isSeparator and: [ after isSeparator ]) diff --git a/repository/Grease-Pharo90-Slime.package/GRDeprecatedApiProtocolRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRDeprecatedApiProtocolRule.class/instance/initialize.st index 64cfada8..9fb5c9de 100644 --- a/repository/Grease-Pharo90-Slime.package/GRDeprecatedApiProtocolRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRDeprecatedApiProtocolRule.class/instance/initialize.st @@ -2,7 +2,7 @@ initialization initialize super initialize. matcher := RBParseTreeSearcher new. - matcher + matcher matchesAnyOf: #( '``@receiver greaseDeprecatedApi: ``@arg1' '``@receiver greaseDeprecatedApi: ``@arg1 details: ``@arg2' ) diff --git a/repository/Grease-Pharo90-Slime.package/GREmptyStatementsRule.class/instance/checkMethod..st b/repository/Grease-Pharo90-Slime.package/GREmptyStatementsRule.class/instance/checkMethod..st index 0bc1862a..a2a96832 100644 --- a/repository/Grease-Pharo90-Slime.package/GREmptyStatementsRule.class/instance/checkMethod..st +++ b/repository/Grease-Pharo90-Slime.package/GREmptyStatementsRule.class/instance/checkMethod..st @@ -1,5 +1,5 @@ running -checkMethod: aContext +checkMethod: aContext | periods position | aContext parseTree nodesDo: [ :node | (node isSequence and: [ node periods notEmpty ]) ifTrue: [ diff --git a/repository/Grease-Pharo90-Slime.package/GRInvalidObjectInitializationRule.class/instance/checkMethod..st b/repository/Grease-Pharo90-Slime.package/GRInvalidObjectInitializationRule.class/instance/checkMethod..st index 63c04fdc..30369982 100644 --- a/repository/Grease-Pharo90-Slime.package/GRInvalidObjectInitializationRule.class/instance/checkMethod..st +++ b/repository/Grease-Pharo90-Slime.package/GRInvalidObjectInitializationRule.class/instance/checkMethod..st @@ -1,10 +1,10 @@ running -checkMethod: aContext - (aContext methodClass isMeta not - and: [ (aContext selector beginsWithSubCollection: #initialize) +checkMethod: aContext + (aContext methodClass isMeta not + and: [ (aContext selector beginsWithSubCollection: #initialize) and: [ aContext selector numArgs > 0 and: [ aContext methodClass ~= GRObject and: [ (aContext methodClass includesBehavior: GRObject) - and: [ (aContext superMessages includes: aContext selector) not - and: [ aContext selfMessages noneSatisfy: [ :each | each beginsWithSubCollection: #initialize ] ] ] ] ] ] ]) + and: [ (aContext superMessages includes: aContext selector) not + and: [ aContext selfMessages noneSatisfy: [ :each | each beginsWithSubCollection: #initialize ] ] ] ] ] ] ]) ifTrue: [ result addClass: aContext methodClass selector: aContext selector ] \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRNonPortableMessageRule.class/instance/checkClass..st b/repository/Grease-Pharo90-Slime.package/GRNonPortableMessageRule.class/instance/checkClass..st index 4c871460..6d276d6c 100644 --- a/repository/Grease-Pharo90-Slime.package/GRNonPortableMessageRule.class/instance/checkClass..st +++ b/repository/Grease-Pharo90-Slime.package/GRNonPortableMessageRule.class/instance/checkClass..st @@ -3,7 +3,7 @@ checkClass: aContext | selectors | selectors := self methodNames inject: Set new - into: [ :set :each | + into: [ :set :each | set addAll: (aContext whichSelectorsReferTo: each); yourself ]. diff --git a/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkClass..st b/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkClass..st index dc83677f..95b1d5c1 100644 --- a/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkClass..st +++ b/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkClass..st @@ -1,7 +1,7 @@ running -checkClass: aContext +checkClass: aContext | comment | - aContext isMeta + aContext isMeta ifTrue: [ ^ self ]. comment := aContext organization classComment asString. comment isWideString ifTrue: [ diff --git a/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkMethod..st b/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkMethod..st index 8d1ad057..ae19cb73 100644 --- a/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkMethod..st +++ b/repository/Grease-Pharo90-Slime.package/GRNonPortableSourceFormatRule.class/instance/checkMethod..st @@ -3,14 +3,14 @@ checkMethod: aContext | foundLiteral | foundLiteral := false. "check individual literals first" - aContext literals do: [ :each | + aContext literals do: [ :each | (each isString and: [ each isWideString ]) ifTrue: [ - result + result addClass: aContext methodClass selector: aContext selector. result addSearchString: each. foundLiteral := true ] ]. - + "now check the whole method, could be in comments" foundLiteral ifFalse: [ aContext sourceCode asString isWideString ifTrue: [ diff --git a/repository/Grease-Pharo90-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st index 643668f1..776d58af 100644 --- a/repository/Grease-Pharo90-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st @@ -3,6 +3,6 @@ initialize super initialize. self rewriteRule replace: '`@collection beginsWith: `@subCollection' - with: '`@collection beginsWithSubCollection: `@subCollection'; + with: '`@collection greaseBeginsWith: `@subCollection'; replace: '`@collection endsWith: `@subCollection' - with: '`@collection endsWithSubCollection: `@subCollection' \ No newline at end of file + with: '`@collection greaseEndsWith: `@subCollection' \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRParensFormattingRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRParensFormattingRule.class/instance/initialize.st index a9bf5bdb..c8c72c58 100644 --- a/repository/Grease-Pharo90-Slime.package/GRParensFormattingRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRParensFormattingRule.class/instance/initialize.st @@ -4,7 +4,7 @@ initialize self matcher matches: '`{ :node | node isValue and: [ node hasParentheses ] }' do: [ :node :answer | - answer isNil + answer isNil ifFalse: [ answer ] ifTrue: [ | found start stop | diff --git a/repository/Grease-Pharo90-Slime.package/GRReturnFormattingRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRReturnFormattingRule.class/instance/initialize.st index a488a67f..500df13d 100644 --- a/repository/Grease-Pharo90-Slime.package/GRReturnFormattingRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRReturnFormattingRule.class/instance/initialize.st @@ -4,8 +4,8 @@ initialize self matcher matches: '^ ``@expr' do: [ :node :answer | - answer isNil + answer isNil ifFalse: [ answer ] - ifTrue: [ + ifTrue: [ node start + 2 ~= node value start ifTrue: [ node ] ] ] \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRTempsFormattingRule.class/instance/initialize.st b/repository/Grease-Pharo90-Slime.package/GRTempsFormattingRule.class/instance/initialize.st index 447c54de..a0f0b5a3 100644 --- a/repository/Grease-Pharo90-Slime.package/GRTempsFormattingRule.class/instance/initialize.st +++ b/repository/Grease-Pharo90-Slime.package/GRTempsFormattingRule.class/instance/initialize.st @@ -4,14 +4,14 @@ initialize self matcher matches: '| `temp `@temps | ``@.stmts' do: [ :node :answer | - answer isNil + answer isNil ifFalse: [ answer ] - ifTrue: [ + ifTrue: [ (node leftBar notNil and: [ node rightBar notNil ]) ifTrue: [ | found position | found := false. position := node leftBar. - node temporaries do: [ :each | + node temporaries do: [ :each | found := found or: [ position + 2 ~= each start ]. position := each stop ]. found := found or: [ position + 2 ~= node rightBar ]. diff --git a/repository/Grease-Pharo90-Slime.package/GRTestAssertionsRule.class/instance/checkMethod..st b/repository/Grease-Pharo90-Slime.package/GRTestAssertionsRule.class/instance/checkMethod..st index cd33b84b..bab892c3 100644 --- a/repository/Grease-Pharo90-Slime.package/GRTestAssertionsRule.class/instance/checkMethod..st +++ b/repository/Grease-Pharo90-Slime.package/GRTestAssertionsRule.class/instance/checkMethod..st @@ -1,7 +1,7 @@ running -checkMethod: aContext +checkMethod: aContext aContext methodClass isMeta ifTrue: [ ^ self ]. (aContext methodClass allSuperclasses includes:(Smalltalk at: #TestCase)) ifFalse: [ ^ self ]. - ^ super checkMethod: aContext \ No newline at end of file + ^ super checkMethod: aContext \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRUnnecessaryLastPeriodRule.class/instance/checkMethod..st b/repository/Grease-Pharo90-Slime.package/GRUnnecessaryLastPeriodRule.class/instance/checkMethod..st index 5fc9a25b..954a79b9 100644 --- a/repository/Grease-Pharo90-Slime.package/GRUnnecessaryLastPeriodRule.class/instance/checkMethod..st +++ b/repository/Grease-Pharo90-Slime.package/GRUnnecessaryLastPeriodRule.class/instance/checkMethod..st @@ -1,5 +1,5 @@ running -checkMethod: aContext +checkMethod: aContext aContext parseTree nodesDo: [ :node | node isSequence ifTrue: [ (node statements notEmpty and: [ node periods notEmpty ]) ifTrue: [ diff --git a/repository/Grease-Pharo90-Slime.package/GRUsesMethodAnnotationsRule.class/instance/checkMethod..st b/repository/Grease-Pharo90-Slime.package/GRUsesMethodAnnotationsRule.class/instance/checkMethod..st index 0821ec7a..c48f9bf5 100644 --- a/repository/Grease-Pharo90-Slime.package/GRUsesMethodAnnotationsRule.class/instance/checkMethod..st +++ b/repository/Grease-Pharo90-Slime.package/GRUsesMethodAnnotationsRule.class/instance/checkMethod..st @@ -2,7 +2,7 @@ running checkMethod: aContext (self shouldExclude: aContext) ifFalse: [ aContext pragmas do: [ :each | - result + result addClass: aContext methodClass selector: aContext selector. result addSearchString: each selector ] ] \ No newline at end of file diff --git a/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkClass..st b/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkClass..st index c90a5576..674dcf52 100644 --- a/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkClass..st +++ b/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkClass..st @@ -1,5 +1,5 @@ running -checkClass: aContext +checkClass: aContext aContext allSuperclassesDo: [ :each | (self classNames includes: each name) ifTrue: [ result addClass: aContext. diff --git a/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkMethod..st b/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkMethod..st index a40fba21..18cb585b 100644 --- a/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkMethod..st +++ b/repository/Grease-Pharo90-Slime.package/GRUsesNotPortableClassRule.class/instance/checkMethod..st @@ -6,7 +6,7 @@ checkMethod: aContext ifTrue: [ "classes in a -Pharo- package are per definition not portable and therefore allowed to use non-portable classes" ^ self ]. aContext literals - do: [ :each | + do: [ :each | (each isVariableBinding and: [ self classNames includes: each key ]) ifTrue: [ result addClass: aContext methodClass selector: aContext selector. result addSearchString: each key ] ] \ No newline at end of file diff --git a/repository/Grease-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st b/repository/Grease-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st index 643668f1..776d58af 100644 --- a/repository/Grease-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st +++ b/repository/Grease-Slime.package/GRNotPortableCollectionsRule.class/instance/initialize.st @@ -3,6 +3,6 @@ initialize super initialize. self rewriteRule replace: '`@collection beginsWith: `@subCollection' - with: '`@collection beginsWithSubCollection: `@subCollection'; + with: '`@collection greaseBeginsWith: `@subCollection'; replace: '`@collection endsWith: `@subCollection' - with: '`@collection endsWithSubCollection: `@subCollection' \ No newline at end of file + with: '`@collection greaseEndsWith: `@subCollection' \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/base64Encode..st b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..4cb93d20 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/base64Encode..st @@ -0,0 +1,3 @@ +encoding +base64Encode: aByteArray + ^ aByteArray base64Encoded \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/stackDepth.st b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/stackDepth.st index d7e6feab..7b994393 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/stackDepth.st +++ b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/stackDepth.st @@ -1,6 +1,6 @@ exceptions stackDepth - + | depth current | depth := 0. current := thisContext. diff --git a/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/thisContext.st b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/thisContext.st index c936ecad..97018fc5 100644 --- a/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/thisContext.st +++ b/repository/Grease-Squeak5-Core.package/GRPharoPlatform.class/instance/thisContext.st @@ -1,4 +1,4 @@ processes thisContext - + ^ thisContext sender \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st b/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st new file mode 100644 index 00000000..f23ab6a2 --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st @@ -0,0 +1,5 @@ +*grease-squeak5-core +greaseBeginsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st b/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st new file mode 100644 index 00000000..a66b574e --- /dev/null +++ b/repository/Grease-Squeak5-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st @@ -0,0 +1,5 @@ +*grease-squeak5-core +greaseEndsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/instance/base64Encode..st b/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/instance/base64Encode..st new file mode 100644 index 00000000..4cb93d20 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/instance/base64Encode..st @@ -0,0 +1,3 @@ +encoding +base64Encode: aByteArray + ^ aByteArray base64Encoded \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/instance/stackDepth.st b/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/instance/stackDepth.st index d7e6feab..7b994393 100644 --- a/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/instance/stackDepth.st +++ b/repository/Grease-Squeak6-Core.package/GRPharoPlatform.class/instance/stackDepth.st @@ -1,6 +1,6 @@ exceptions stackDepth - + | depth current | depth := 0. current := thisContext. diff --git a/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/instance/thisContext.st b/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/instance/thisContext.st new file mode 100644 index 00000000..360fed0c --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/GRSqueakPlatform.class/instance/thisContext.st @@ -0,0 +1,4 @@ +processes +thisContext + + ^ thisContext sender diff --git a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st index 372efe84..be930027 100644 --- a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st +++ b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/beginsWithSubCollection..st @@ -1,4 +1,8 @@ *grease-squeak6-core beginsWithSubCollection: aSequenceableCollection + self + greaseDeprecatedApi: 'SequenceableCollection>>#beginsWithSubCollection:' + details: 'Use SequenceableCollection>>#greaseBeginsWith:'. "Some platforms implement #beginsWith: to answer true for an empty argument." + aSequenceableCollection isEmpty ifTrue: [ ^ false ]. ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st index efd43298..7eb90e86 100644 --- a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st +++ b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/endsWithSubCollection..st @@ -1,4 +1,8 @@ *grease-squeak6-core endsWithSubCollection: aSequenceableCollection + self + greaseDeprecatedApi: 'SequenceableCollection>>#endsWithSubCollection:' + details: 'Use SequenceableCollection>>#greaseEndsWith:'. "Some platforms implement #endsWith: to answer true for an empty argument." + aSequenceableCollection isEmpty ifTrue: [ ^ false ]. ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st new file mode 100644 index 00000000..428ad0ae --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/greaseBeginsWith..st @@ -0,0 +1,5 @@ +*grease-squeak6-core +greaseBeginsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self beginsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st new file mode 100644 index 00000000..f1b16048 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/SequenceableCollection.extension/instance/greaseEndsWith..st @@ -0,0 +1,5 @@ +*grease-squeak6-core +greaseEndsWith: aSequenceableCollection + + aSequenceableCollection isEmpty ifTrue: [ ^ true ]. + ^ self endsWith: aSequenceableCollection \ No newline at end of file diff --git a/repository/Grease-Squeak6-Core.package/String.extension/instance/substrings..st b/repository/Grease-Squeak6-Core.package/String.extension/instance/substrings..st new file mode 100644 index 00000000..90bc60ae --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/String.extension/instance/substrings..st @@ -0,0 +1,5 @@ +*grease-squeak6-core +substrings: aString + + ^ self subStrings: aString + diff --git a/repository/Grease-Squeak6-Core.package/Symbol.extension/instance/greaseAsMutator.st b/repository/Grease-Squeak6-Core.package/Symbol.extension/instance/greaseAsMutator.st new file mode 100644 index 00000000..075a4ccf --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/Symbol.extension/instance/greaseAsMutator.st @@ -0,0 +1,4 @@ +*grease-squeak6-core +greaseAsMutator + + ^ self asSimpleSetter diff --git a/repository/Grease-Squeak6-Core.package/Symbol.extension/properties.json b/repository/Grease-Squeak6-Core.package/Symbol.extension/properties.json new file mode 100644 index 00000000..565e67b0 --- /dev/null +++ b/repository/Grease-Squeak6-Core.package/Symbol.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "Symbol" } diff --git a/repository/Grease-Tests-Core.package/GRAbstractSequenceableCollectionTest.class/instance/testGreaseBeginsWith.st b/repository/Grease-Tests-Core.package/GRAbstractSequenceableCollectionTest.class/instance/testGreaseBeginsWith.st new file mode 100644 index 00000000..69cd8b12 --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRAbstractSequenceableCollectionTest.class/instance/testGreaseBeginsWith.st @@ -0,0 +1,9 @@ +tests +testGreaseBeginsWith + | collection | + collection := self arbitraryCollection. + self assert: (collection greaseBeginsWith: (collection copyWithout: collection last)). + self assert: (collection greaseBeginsWith: collection). + self deny: (collection greaseBeginsWith: (collection copyWith: collection first)). + self assert: (collection greaseBeginsWith: self emptyCollection). + self deny: (self emptyCollection greaseBeginsWith: collection) \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRAbstractSequenceableCollectionTest.class/instance/testGreaseEndsWith.st b/repository/Grease-Tests-Core.package/GRAbstractSequenceableCollectionTest.class/instance/testGreaseEndsWith.st new file mode 100644 index 00000000..5bf33d8b --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRAbstractSequenceableCollectionTest.class/instance/testGreaseEndsWith.st @@ -0,0 +1,9 @@ +tests +testGreaseEndsWith + | collection | + collection := self arbitraryCollection. + self assert: (collection greaseEndsWith: (collection copyWithout: collection first)). + self assert: (collection greaseEndsWith: collection). + self deny: (collection greaseEndsWith: (collection copyWith: collection first)). + self assert: (collection greaseEndsWith: self emptyCollection). + self deny: (self emptyCollection greaseEndsWith: collection) \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/platform.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/platform.st index fcdd4be5..63cfbfa2 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/platform.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/platform.st @@ -1,3 +1,4 @@ accessing platform + ^ GRPlatform current \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/returnSender.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/returnSender.st index 1b25f567..97bd2a26 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/returnSender.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/returnSender.st @@ -1,3 +1,4 @@ private returnSender + ^ GRPlatform current thisContext sender \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/runCase.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/runCase.st new file mode 100644 index 00000000..9465625f --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/runCase.st @@ -0,0 +1,3 @@ +running +runCase + GRPlatform current doSilently: [ super runCase ] \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/supportsUnicode.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/supportsUnicode.st new file mode 100644 index 00000000..a22719d9 --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/supportsUnicode.st @@ -0,0 +1,10 @@ +private +supportsUnicode + "dynamically try to figure out whether the current dialect supports Unicode" + ^ [ + String + with: (Character value: 16r1F1F3) + with: (Character value: 16r1F1F1). + true + ] on: Error + do: [ :error | false ] \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Encode.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Encode.st new file mode 100644 index 00000000..d1a2b4be --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testBase64Encode.st @@ -0,0 +1,14 @@ +tests +testBase64Encode + | input | + input := #( + (97 110 121 32 99 97 114 110 97 108 32 112 108 101 97 115 117 114 101 46) 'YW55IGNhcm5hbCBwbGVhc3VyZS4=' + (97 110 121 32 99 97 114 110 97 108 32 112 108 101 97 115 117 114 101) 'YW55IGNhcm5hbCBwbGVhc3VyZQ==' + (97 110 121 32 99 97 114 110 97 108 32 112 108 101 97 115 117 114) 'YW55IGNhcm5hbCBwbGVhc3Vy' + (97 110 121 32 99 97 114 110 97 108 32 112 108 101 97 115 117) 'YW55IGNhcm5hbCBwbGVhc3U=' + (97 110 121 32 99 97 114 110 97 108 32 112 108 101 97 115) 'YW55IGNhcm5hbCBwbGVhcw=='). + 1 to: input size by: 2 do: [ :index | + | decoded expected | + decoded := GRPlatform current base64Encode: (input at: index) asByteArray. + expected := input at: index + 1. + self assert: decoded = expected ] \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testCompileAsciiString.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testCompileAsciiString.st new file mode 100644 index 00000000..cfe0c3ff --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testCompileAsciiString.st @@ -0,0 +1,17 @@ +tests-file library +testCompileAsciiString + | selector expected source | + + self supportsUnicode ifFalse: [ + ^ self ]. + + selector := #stringMethod. + expected := 'test ok'. + source := GRPlatform current asMethodReturningString: expected named: selector. + [ + | actual | + GRPlatform current compile: source into: self class classified: 'private'. + actual := self perform: selector. + self assert: expected = actual + ] ensure: [ + GRPlatform current removeSelector: #stringMethod from: self class ] \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testCompileUnicodeString.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testCompileUnicodeString.st new file mode 100644 index 00000000..a02b1ac5 --- /dev/null +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testCompileUnicodeString.st @@ -0,0 +1,15 @@ +tests-file library +testCompileUnicodeString + | selector expected source | + selector := #stringMethod. + expected := String + with: (Character value: 16r1F1F3) + with: (Character value: 16r1F1F1). + source := GRPlatform current asMethodReturningString: expected named: selector. + [ + | actual | + GRPlatform current compile: source into: self class classified: 'private'. + actual := self perform: selector. + self assert: expected = actual + ] ensure: [ + GRPlatform current removeSelector: #stringMethod from: self class ] \ No newline at end of file diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testFileExists.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testFileExists.st index 5d7796bc..2e7a73fa 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testFileExists.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testFileExists.st @@ -1,4 +1,4 @@ -tests-filestreams +tests-files testFileExists | theFileName | self diff --git a/repository/Grease-Tests-Core.package/GRPrinterTest.class/class/packageNamesUnderTest.st b/repository/Grease-Tests-Core.package/GRPrinterTest.class/class/packageNamesUnderTest.st deleted file mode 100644 index ffc11f34..00000000 --- a/repository/Grease-Tests-Core.package/GRPrinterTest.class/class/packageNamesUnderTest.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -packageNamesUnderTest - ^ #('Grease-Core') \ No newline at end of file diff --git a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st index 473591ef..a0977f60 100644 --- a/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st +++ b/repository/Grease-Tests-Slime.package/GRSlimeTest.class/instance/testNotPortableCollectionsRule.st @@ -9,5 +9,5 @@ testNotPortableCollectionsRule self runTransformation: GRNotPortableCollectionsRule changes: #( - 'beginsWith1 ''abc'' beginsWithSubCollection: ''a''' - 'endsWith1 ''abc'' endsWithSubCollection: ''a''') \ No newline at end of file + 'beginsWith1 ''abc'' greaseBeginsWith: ''a''' + 'endsWith1 ''abc'' greaseEndsWith: ''a''') \ No newline at end of file diff --git a/repository/Grease-Tests-Squeak6-Core.package/GRPlatformTest.extension/instance/writeToFile.withFileNameDo..st b/repository/Grease-Tests-Squeak6-Core.package/GRPlatformTest.extension/instance/writeToFile.withFileNameDo..st new file mode 100644 index 00000000..ec976216 --- /dev/null +++ b/repository/Grease-Tests-Squeak6-Core.package/GRPlatformTest.extension/instance/writeToFile.withFileNameDo..st @@ -0,0 +1,12 @@ +*grease-tests-squeak6-core +writeToFile: aStringOrByteArray withFileNameDo: aBlock + | fileName directory | + fileName := 'GRPharoPlatformTest'. + directory := FileSystem disk workingDirectory. + [ GRPlatform current + write: aStringOrByteArray + toFile: fileName + inFolder: directory fullName. + aBlock value: directory fullName, GRPlatform current pathSeparator, fileName + ] ensure: [ + (directory / fileName) delete ]