Skip to content

Commit

Permalink
Fix some more deprecations.
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Oct 10, 2019
1 parent fba0e15 commit 6859b32
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
22 changes: 15 additions & 7 deletions src/CodeExport/ProtocolOrganizer.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ Extension { #name : #ProtocolOrganizer }

{ #category : #'*CodeExport' }
ProtocolOrganizer >> stringForFileOut [

^ String streamContents: [:aStream |
self protocols do: [:p |
aStream << $( << p name printString.
p methods do: [:m |
aStream << ' ' << m asString ].
aStream << $); cr ]]
^ String
streamContents: [ :aStream |
self protocols
do: [ :p |
aStream
nextPut: $(;
nextPutAll: p name printString.
p methodSelectors
do: [ :m |
aStream
space;
nextPutAll: m ].
aStream
nextPut: $);
cr ] ]
]
8 changes: 8 additions & 0 deletions src/Deprecated80/Protocol.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ Protocol >> methods: aCollection [
^ self methodSelectors: aCollection
]

{ #category : #'*Deprecated80' }
Protocol class >> name: nm methods: methods [
self
deprecated: 'Use #name:methodSelectors: instead'
transformWith: '`@receiver name: `@arg1 methods: `@arg2' -> '`@receiver name: `@arg1 methodSelectors: `@arg2'.
^ self name: nm methods: methods
]

{ #category : #'*Deprecated80' }
Protocol >> removeAllMethods [
self deprecated: 'Use #removeAllMethodSelectors instead' transformWith: '`@receiver removeAllMethods' -> '`@receiver removeAllMethodSelectors'.
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel/ClassOrganization.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ ClassOrganization >> renameCategory: oldName toBe: newName [

self notifyOfChangedCategoryFrom: oldName to: newName.
"I need to notify also the selector changes, otherwise RPackage will not notice"
(self protocolOrganizer protocolNamed: newName) methods
(self protocolOrganizer protocolNamed: newName) methodSelectors
do: [ :each | self notifyOfChangedSelector: each from: oldName to: newName ]
]

Expand Down
5 changes: 2 additions & 3 deletions src/Kernel/Protocol.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ Protocol class >> name: nm [
]

{ #category : #'instance creation' }
Protocol class >> name: nm methods: methods [

Protocol class >> name: nm methodSelectors: methods [
^ self new
methods: methods;
methodSelectors: methods;
name: nm asSymbol;
yourself
]
Expand Down
13 changes: 6 additions & 7 deletions src/Kernel/ProtocolOrganizer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,12 @@ ProtocolOrganizer >> extensionProtocols [

{ #category : #importing }
ProtocolOrganizer >> fromSpec: aSpec [

aSpec do: [:spec || name methods |
name := spec first asSymbol.
methods := spec allButFirst asSet.
self addProtocol: (Protocol
name: name
methods: methods) ]
aSpec
do: [ :spec |
| name methods |
name := spec first asSymbol.
methods := spec allButFirst asSet.
self addProtocol: (Protocol name: name methodSelectors: methods) ]
]

{ #category : #protocol }
Expand Down

0 comments on commit 6859b32

Please sign in to comment.