Skip to content

Commit b6eff22

Browse files
authored
Merge pull request #19 from JanBliznicenko/master
Fixed inspections
2 parents 2919860 + 48da603 commit b6eff22

16 files changed

+178
-147
lines changed
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
Extension { #name : 'GHTMinimalGhost' }
22

33
{ #category : '*Ghost-NewToolsSupport' }
4-
GHTMinimalGhost >> ghostInspectionRaw [
4+
GHTMinimalGhost >> ghostInspectionRaw: aBuilder [
55
"This is the most basic presentation showing the state of the object"
6+
67
<inspectorPresentationOrder: 900 title: 'Raw'>
8+
^ aBuilder instantiate: GHGhostRawInspection on: self
9+
]
710

8-
^ GHGhostRawInspection on: self
11+
{ #category : '*Ghost-NewToolsSupport' }
12+
GHTMinimalGhost >> inspectorIconName [
13+
14+
^ nil
915
]
1016

1117
{ #category : '*Ghost-NewToolsSupport' }
12-
GHTMinimalGhost >> inspectorIcon [
13-
^nil
18+
GHTMinimalGhost >> inspectorPerform: aSymbol with: anObject [
19+
"This method is required by the inspector infrastructure (in order to inspect properly
20+
ProtoObject and its direct decendants).
21+
DO NOT USE IT!"
22+
23+
<primitive: 83>
24+
^ self primitiveFailed
1425
]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Extension { #name : 'UndefinedObject' }
2+
3+
{ #category : '*Ghost-NewToolsSupport' }
4+
UndefinedObject >> ghostPrintString [
5+
6+
^ self printString
7+
]

Ghost-ObjectGhost/GHCurrentMetaLevelDepth.class.st

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,37 @@ I am used to prevent calls from meta level to domain level because domain level
66
it increases current meta level depth for given block of code
77
"
88
Class {
9-
#name : #GHCurrentMetaLevelDepth,
10-
#superclass : #ProcessLocalVariable,
11-
#category : 'Ghost-ObjectGhost'
9+
#name : 'GHCurrentMetaLevelDepth',
10+
#superclass : 'ProcessLocalVariable',
11+
#category : 'Ghost-ObjectGhost',
12+
#package : 'Ghost-ObjectGhost'
1213
}
1314

14-
{ #category : #private }
15+
{ #category : 'private' }
1516
GHCurrentMetaLevelDepth class >> decrease [
1617
self value: self value - 1
1718
]
1819

19-
{ #category : #evaluating }
20+
{ #category : 'evaluating' }
2021
GHCurrentMetaLevelDepth class >> decreaseFor: aBlock [
2122

2223
self decrease.
2324
^aBlock ensure: [ self increase ]
2425
]
2526

26-
{ #category : #private }
27+
{ #category : 'private' }
2728
GHCurrentMetaLevelDepth class >> increase [
2829
self value: self value + 1
2930
]
3031

31-
{ #category : #evaluating }
32+
{ #category : 'evaluating' }
3233
GHCurrentMetaLevelDepth class >> increaseFor: aBlock [
3334

3435
self increase.
3536
^aBlock ensure: [ self decrease ]
3637
]
3738

38-
{ #category : #default }
39+
{ #category : 'default' }
3940
GHCurrentMetaLevelDepth >> default [
4041
^0
4142
]

Ghost-ObjectGhost/GHDelegatorBehaviour.class.st

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,61 @@ Internal Representation and Key Implementation Points.
1212
target: <Object>
1313
"
1414
Class {
15-
#name : #GHDelegatorBehaviour,
16-
#superclass : #GHGhostBehaviour,
15+
#name : 'GHDelegatorBehaviour',
16+
#superclass : 'GHGhostBehaviour',
1717
#instVars : [
1818
'metaLevel',
1919
'target'
2020
],
21-
#category : 'Ghost-ObjectGhost'
21+
#category : 'Ghost-ObjectGhost',
22+
#package : 'Ghost-ObjectGhost'
2223
}
2324

24-
{ #category : #'instance creation' }
25+
{ #category : 'instance creation' }
2526
GHDelegatorBehaviour class >> metaLevel: aGHMetaLevel target: anObject [
2627
^(self target: anObject)
2728
metaLevel: aGHMetaLevel
2829
]
2930

30-
{ #category : #'instance creation' }
31+
{ #category : 'instance creation' }
3132
GHDelegatorBehaviour class >> target: anObject [
3233
^self new
3334
target: anObject
3435
]
3536

36-
{ #category : #accessing }
37+
{ #category : 'accessing' }
3738
GHDelegatorBehaviour >> currentMetaLevel [
3839
^metaLevel
3940
]
4041

41-
{ #category : #initialization }
42+
{ #category : 'initialization' }
4243
GHDelegatorBehaviour >> initialize [
4344
super initialize.
4445

4546
metaLevel := GHMetaLevel empty
4647
]
4748

48-
{ #category : #accessing }
49+
{ #category : 'accessing' }
4950
GHDelegatorBehaviour >> metaLevel [
5051
^ metaLevel
5152
]
5253

53-
{ #category : #accessing }
54+
{ #category : 'accessing' }
5455
GHDelegatorBehaviour >> metaLevel: anObject [
5556
metaLevel := anObject
5657
]
5758

58-
{ #category : #'message interception' }
59+
{ #category : 'message interception' }
5960
GHDelegatorBehaviour >> send: aMessage to: aGhost [
6061
^aMessage sendTo: target
6162
]
6263

63-
{ #category : #accessing }
64+
{ #category : 'accessing' }
6465
GHDelegatorBehaviour >> target [
6566
^ target
6667
]
6768

68-
{ #category : #accessing }
69+
{ #category : 'accessing' }
6970
GHDelegatorBehaviour >> target: anObject [
7071
target := anObject
7172
]

Ghost-ObjectGhost/GHEmptyMetaMessages.class.st

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
I represent empty meta level for ghosts
33
"
44
Class {
5-
#name : #GHEmptyMetaMessages,
6-
#superclass : #GHMetaMessages,
7-
#category : 'Ghost-ObjectGhost'
5+
#name : 'GHEmptyMetaMessages',
6+
#superclass : 'GHMetaMessages',
7+
#category : 'Ghost-ObjectGhost',
8+
#package : 'Ghost-ObjectGhost'
89
}
910

10-
{ #category : #testing }
11+
{ #category : 'testing' }
1112
GHEmptyMetaMessages class >> includes: aSymbol [
1213
^false
1314
]

Ghost-ObjectGhost/GHGhostBehaviour.class.st

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ it should process intercepted domain messages. It should be implemented by subcl
2222
it should return GHMetaLevel instance which make sense for concrete ghost implementation
2323
"
2424
Class {
25-
#name : #GHGhostBehaviour,
26-
#superclass : #Object,
27-
#category : 'Ghost-ObjectGhost'
25+
#name : 'GHGhostBehaviour',
26+
#superclass : 'Object',
27+
#category : 'Ghost-ObjectGhost',
28+
#package : 'Ghost-ObjectGhost'
2829
}
2930

30-
{ #category : #accessing }
31+
{ #category : 'accessing' }
3132
GHGhostBehaviour >> currentMetaLevel [
3233
^GHMetaLevel standard
3334
"Standard meta level disables interception of messages from standard dev tools.
@@ -36,31 +37,31 @@ GHGhostBehaviour >> currentMetaLevel [
3637

3738
]
3839

39-
{ #category : #'meta level' }
40+
{ #category : 'meta level' }
4041
GHGhostBehaviour >> executeMetaMessage: aMessage on: anObject [
4142

4243
^GHCurrentMetaLevelDepth increaseFor: [
4344
self currentMetaLevel executeMetaMessage: aMessage on: anObject
4445
]
4546
]
4647

47-
{ #category : #'message interception' }
48+
{ #category : 'message interception' }
4849
GHGhostBehaviour >> intercept: aMessage to: anObject [
4950

5051
^(self isMetaMessage: aMessage)
5152
ifTrue: [ self executeMetaMessage: aMessage on: anObject ]
5253
ifFalse: [ self send: aMessage to: anObject ]
5354
]
5455

55-
{ #category : #'meta level' }
56+
{ #category : 'meta level' }
5657
GHGhostBehaviour >> isMetaMessage: aMessage [
5758

5859
GHCurrentMetaLevelDepth value > 0 ifTrue: [ ^true ].
5960

6061
^self currentMetaLevel isMetaMessage: aMessage
6162
]
6263

63-
{ #category : #'message interception' }
64+
{ #category : 'message interception' }
6465
GHGhostBehaviour >> send: aMessage to: aGhost [
6566

6667
nil subclassResponsibility

Ghost-ObjectGhost/GHMetaLevel.class.st

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,36 @@ Internal Representation and Key Implementation Points.
1818
metaMessages: <GHMetaMessages class>
1919
"
2020
Class {
21-
#name : #GHMetaLevel,
22-
#superclass : #Object,
21+
#name : 'GHMetaLevel',
22+
#superclass : 'Object',
2323
#instVars : [
2424
'metaMessages'
2525
],
2626
#classVars : [
2727
'Empty',
2828
'Standard'
2929
],
30-
#category : 'Ghost-ObjectGhost'
30+
#category : 'Ghost-ObjectGhost',
31+
#package : 'Ghost-ObjectGhost'
3132
}
3233

33-
{ #category : #accessing }
34+
{ #category : 'accessing' }
3435
GHMetaLevel class >> empty [
3536
^Empty ifNil: [ Empty := GHMetaLevel with: GHEmptyMetaMessages ]
3637
]
3738

38-
{ #category : #accessing }
39+
{ #category : 'accessing' }
3940
GHMetaLevel class >> standard [
4041
^Standard ifNil: [ Standard := GHMetaLevel with: GHStandardMetaMessages ]
4142
]
4243

43-
{ #category : #'instance creation' }
44+
{ #category : 'instance creation' }
4445
GHMetaLevel class >> with: aMetaMessagesClass [
4546
^self new
4647
metaMessages: aMetaMessagesClass
4748
]
4849

49-
{ #category : #operations }
50+
{ #category : 'operations' }
5051
GHMetaLevel >> executeMetaMessage: aMessage on: aGhost [
5152

5253
| metaMessageImplementor |
@@ -55,24 +56,24 @@ GHMetaLevel >> executeMetaMessage: aMessage on: aGhost [
5556
^metaMessageImplementor executeMetaMessage: aMessage
5657
]
5758

58-
{ #category : #initialize }
59+
{ #category : 'initialize' }
5960
GHMetaLevel >> initialize [
6061
super initialize.
6162

6263
metaMessages := GHEmptyMetaMessages
6364
]
6465

65-
{ #category : #testing }
66+
{ #category : 'testing' }
6667
GHMetaLevel >> isMetaMessage: aMessage [
6768
^metaMessages includes: aMessage selector
6869
]
6970

70-
{ #category : #accessing }
71+
{ #category : 'accessing' }
7172
GHMetaLevel >> metaMessages [
7273
^ metaMessages
7374
]
7475

75-
{ #category : #accessing }
76+
{ #category : 'accessing' }
7677
GHMetaLevel >> metaMessages: anObject [
7778
metaMessages := anObject
7879
]

0 commit comments

Comments
 (0)