From 8cedce2e5d3badbf158a421285ca918a37f42062 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 7 Aug 2023 17:58:05 -0300 Subject: [PATCH] Move extension already present in GS64 to a Pharo package --- source/BaselineOfBuoy/BaselineOfBuoy.class.st | 4 ++++ .../SequenceableCollection.extension.st | 6 ------ .../SequenceableCollection.extension.st | 7 +++++++ source/Buoy-Collections-Pharo-Extensions/package.st | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 source/Buoy-Collections-Pharo-Extensions/SequenceableCollection.extension.st create mode 100644 source/Buoy-Collections-Pharo-Extensions/package.st diff --git a/source/BaselineOfBuoy/BaselineOfBuoy.class.st b/source/BaselineOfBuoy/BaselineOfBuoy.class.st index d8b0788..ec7394d 100644 --- a/source/BaselineOfBuoy/BaselineOfBuoy.class.st +++ b/source/BaselineOfBuoy/BaselineOfBuoy.class.st @@ -58,8 +58,12 @@ BaselineOfBuoy >> baselineCollections: spec [ package: 'Buoy-Collections-Extensions' with: [ spec requires: 'Buoy-Collections' ]; group: 'Deployment' with: 'Buoy-Collections-Extensions'; + package: 'Buoy-Collections-Pharo-Extensions' + with: [ spec requires: 'Buoy-Collections' ]; + group: 'Deployment' with: 'Buoy-Collections-Pharo-Extensions'; package: 'Buoy-Collections-Tests' with: [ spec requires: #( 'Buoy-Collections' 'Buoy-Collections-Extensions' + 'Buoy-Collections-Pharo-Extensions' 'Dependent-SUnit-Extensions' ) ]; group: 'Tests' with: 'Buoy-Collections-Tests' ] diff --git a/source/Buoy-Collections-Extensions/SequenceableCollection.extension.st b/source/Buoy-Collections-Extensions/SequenceableCollection.extension.st index 67a34ac..77c3880 100644 --- a/source/Buoy-Collections-Extensions/SequenceableCollection.extension.st +++ b/source/Buoy-Collections-Extensions/SequenceableCollection.extension.st @@ -6,12 +6,6 @@ SequenceableCollection >> copyFirst: n [ ^ [ self copyFrom: 1 to: n ] unless: n = 0 inWhichCase: [ self species new ] ] -{ #category : #'*Buoy-Collections-Extensions' } -SequenceableCollection >> copyLast: n [ - - ^ [ self copyFrom: self size - n + 1 to: self size ] unless: n = 0 inWhichCase: [ self species new ] -] - { #category : #'*Buoy-Collections-Extensions' } SequenceableCollection >> copyNoMoreThanFirst: n [ diff --git a/source/Buoy-Collections-Pharo-Extensions/SequenceableCollection.extension.st b/source/Buoy-Collections-Pharo-Extensions/SequenceableCollection.extension.st new file mode 100644 index 0000000..9c8bf53 --- /dev/null +++ b/source/Buoy-Collections-Pharo-Extensions/SequenceableCollection.extension.st @@ -0,0 +1,7 @@ +Extension { #name : #SequenceableCollection } + +{ #category : #'*Buoy-Collections-Pharo-Extensions' } +SequenceableCollection >> copyLast: n [ + + ^ [ self copyFrom: self size - n + 1 to: self size ] unless: n = 0 inWhichCase: [ self species new ] +] diff --git a/source/Buoy-Collections-Pharo-Extensions/package.st b/source/Buoy-Collections-Pharo-Extensions/package.st new file mode 100644 index 0000000..754df3d --- /dev/null +++ b/source/Buoy-Collections-Pharo-Extensions/package.st @@ -0,0 +1 @@ +Package { #name : #'Buoy-Collections-Pharo-Extensions' }