Skip to content

Commit

Permalink
Move collection extensions to its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Aug 7, 2023
1 parent 8f730b8 commit 191336a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
14 changes: 10 additions & 4 deletions source/BaselineOfBuoy/BaselineOfBuoy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ BaselineOfBuoy >> baselineAssertions: spec [
BaselineOfBuoy >> baselineCollections: spec [

spec
package: 'Buoy-Collections'
with: [ spec requires: #( 'Buoy-Assertions' 'Buoy-Dynamic-Binding' 'Buoy-Comparison' ) ];
package: 'Buoy-Collections' with: [
spec requires:
#( 'Buoy-Assertions' 'Buoy-Dynamic-Binding'
'Buoy-Comparison' ) ];
group: 'Deployment' with: 'Buoy-Collections';
package: 'Buoy-Collections-Tests'
with: [ spec requires: #( 'Buoy-Collections' 'Dependent-SUnit-Extensions' ) ];
package: 'Buoy-Collections-Extensions'
with: [ spec requires: 'Buoy-Collections' ];
group: 'Deployment' with: 'Buoy-Collections-Extensions';
package: 'Buoy-Collections-Tests' with: [
spec requires: #( 'Buoy-Collections' 'Buoy-Collections-Extensions'
'Dependent-SUnit-Extensions' ) ];
group: 'Tests' with: 'Buoy-Collections-Tests'
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Extension { #name : #SequenceableCollection }

{ #category : #'*Buoy-Collections-Extensions' }
SequenceableCollection >> equalityChecker [

^ SequenceableCollectionEqualityChecker new
]

{ #category : #'*Buoy-Collections-Extensions' }
SequenceableCollection >> withoutFirst [

^self withoutFirst: 1
]

{ #category : #'*Buoy-Collections-Extensions' }
SequenceableCollection >> withoutFirst: n [

(self size <= n) ifTrue: [^self species new].
^self copyFrom: n + 1 to: self size
]
1 change: 1 addition & 0 deletions source/Buoy-Collections-Extensions/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Buoy-Collections-Extensions' }
19 changes: 0 additions & 19 deletions source/Buoy-Collections/SequenceableCollection.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,3 @@ SequenceableCollection >> copyNoMoreThanLast: n [

^ self copyLast: ( n min: self size )
]

{ #category : #'*Buoy-Collections' }
SequenceableCollection >> equalityChecker [

^ SequenceableCollectionEqualityChecker new
]

{ #category : #'*Buoy-Collections' }
SequenceableCollection >> withoutFirst [

^self withoutFirst: 1
]

{ #category : #'*Buoy-Collections' }
SequenceableCollection >> withoutFirst: n [

(self size <= n) ifTrue: [^self species new].
^self copyFrom: n + 1 to: self size
]

0 comments on commit 191336a

Please sign in to comment.