Skip to content

Commit

Permalink
Merge pull request #5513 from estebanlm/Pharo8.0
Browse files Browse the repository at this point in the history
update Spec2 to 0.2.0
  • Loading branch information
Ducasse committed Jan 19, 2020
2 parents c115bf4 + 6cf1956 commit bbcdf97
Show file tree
Hide file tree
Showing 154 changed files with 3,105 additions and 1,048 deletions.
21 changes: 15 additions & 6 deletions src/BaselineOfCommander2/BaselineOfCommander2.class.st
Expand Up @@ -7,10 +7,19 @@ Class {
{ #category : #baselines }
BaselineOfCommander2 >> baseline: spec [
<baseline>
spec
for: #common
do: [ spec
package: 'Commander2';
package: 'Commander2-Deprecations' with: [ spec requires: #('Commander2') ];
package: 'Commander2-Tests' with: [ spec requires: #('Commander2') ] ]

spec for: #common do: [
spec
package: 'Commander2';
package: 'Commander2-Deprecations' with: [ spec requires: #('Commander2') ];
package: 'Commander2-UI' with: [ spec requires: #('Commander2') ];
package: 'Commander2-Tests' with: [ spec requires: #('Commander2') ];
package: 'Commander2-UI-Tests' with: [ spec requires: #('Commander2-UI') ];
package: 'Commander2-V2ReleaseMigrator'.
spec
group: 'core' with: #('Commander2' 'Commander2-Deprecations');
group: 'ui' with: #('Commander2-UI');
group: 'tests' with: #('core' 'ui' 'Commander2-Tests' 'Commander2-UI-Tests');
group: 'migration' with: #('Commander2-V2ReleaseMigrator');
group: 'default' with: #('core' 'ui' 'tests'). ]
]
53 changes: 40 additions & 13 deletions src/BaselineOfSpec2/BaselineOfSpec2.class.st
Expand Up @@ -7,43 +7,70 @@ Class {
{ #category : #baseline }
BaselineOfSpec2 >> baseline: spec [
<baseline>
| repository |
repository := self packageRepositoryURL.
spec
for: #common
do: [ "Dependencies"
spec baseline: 'ParametrizedTests' with: [ spec repository: repository ].
spec baseline: 'Commander2' with: [ spec repository: repository ].
do: [ self commander2: spec.

"Packages"
spec
package: 'Spec2-Core' with: [ spec requires: #('Spec2-Layout' 'Spec2-Transmission' 'Spec2-Commands') ];
package: 'Spec2-CommandLine' with: [ spec requires: #('Spec2-Core') ];
"package: 'Spec2-Help';"
package: 'Spec2-Commands' with: [ spec requires: #('Commander2') ];
package: 'Spec2-Inspector' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Deprecated' with: [ spec requires: #('Spec2-Tests' 'Spec2-Adapters-Morphic' 'Spec2-Commander2') ];
package: 'Spec2-ObservableSlot';
package: 'Spec2-Layout' with: [ spec requires: #('Spec2-ObservableSlot') ];
package: 'Spec2-Transmission';
package: 'Spec2-Adapters-Morphic' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Adapters-Stub' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Examples' with: [ spec requires: #('Spec2-Inspector') ];
package: 'Spec2-Examples';
package: 'Spec2-Interactions' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Commander2' with: [ spec requires: #('Commander2' 'Spec2-Core' 'Spec2-Interactions') ];
package: 'Spec2-Commander2' with: [ spec requires: #('Spec2-Core' 'Spec2-Interactions' 'Commander2') ];
package: 'Spec2-Commander2-Tests' with: [ spec requires: #('Spec2-Commander2') ];
package: 'Spec2-Commander2-ContactBook' with: [ spec requires: #('Spec2-Commander2') ];
package: 'Spec2-Commander2-ContactBook-Extensions' with: [ spec requires: #('Spec2-Commander2-ContactBook') ];
package: 'Spec2-Tests' with: [ spec requires: #('Spec2-Examples') ];
package: 'Spec2-Morphic-Backend-Tests' with: [ spec requires: #('Spec2-Backend-Tests') ];
package: 'Spec2-Backend-Tests' with: [ spec requires: #('Spec2-Adapters-Morphic' 'ParametrizedTests') ];
package: 'Spec2-Adapters-Morphic-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Adapters-Morphic') ];
package: 'Spec2-Morphic-Backend-Tests' with: [ spec requires: #('Spec2-Adapters-Morphic') ];
package: 'Spec2-Backend-Tests' with: [ spec requires: #('Spec2-Adapters-Morphic') ];
package: 'Spec2-Adapters-Morphic-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Backend-Tests') ]].

spec
for: #'pharo7.x'
do: [ "Dependencies for Pharo7"
self parametrizedTests: spec.

spec
baseline: 'Commander'
with: [ spec
repository: 'github://pharo-ide/Commander:v0.8.1/src';
loads: #('Commander-Spec2-Compatibility') ].

spec
package: 'Spec2-Pharo7To8Compatibility';
package: 'Spec2-Backend-Tests' with: [ spec requires: #('ParametrizedTests' 'Spec2-Adapters-Morphic') ];
package: 'Spec2-Morphic-Backend-Tests' with: [ spec requires: #('ParametrizedTests' 'Spec2-Adapters-Morphic') ];
package: 'Spec2-Tests' with: [ spec requires: #('Spec2-Examples' 'ParametrizedTests') ] ].
spec
for: #'pharo8.x'
do: [ spec
package: 'Spec2-Tools' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Tools-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Tools') ];
package: 'Spec2-Examples' with: [ spec requires: #('Spec2-Tools') ];

package: 'Spec2-Deprecated' with: [ spec requires: #('Spec2-Tests' 'Spec2-Adapters-Morphic' 'Spec2-Commander2') ];
package: 'Spec2-Deprecated-Tools' with: [ spec requires: #('Spec2-Deprecated' 'Spec2-Tools') ] ]
]

{ #category : #dependencies }
BaselineOfSpec2 >> commander2: spec [
spec
baseline: 'Commander2'
with: [ spec repository: 'github://pharo-spec/Commander2:v2.1.x/src' ]
]

{ #category : #dependencies }
BaselineOfSpec2 >> parametrizedTests: spec [
spec baseline: 'ParametrizedTests' with: [ spec repository: 'github://tesonep/ParametrizedTests/src' ]
]

{ #category : #accessing }
BaselineOfSpec2 >> project [
"Atomic loading is needed for Spec because we are moving classes of package and it breaks their subclasses.
Expand Down
11 changes: 7 additions & 4 deletions src/BaselineOfUI/BaselineOfUI.class.st
Expand Up @@ -36,11 +36,12 @@ BaselineOfUI >> baseline: spec [
spec postLoadDoIt: #'postload:package:'.

"Load morphic before Spec"
spec baseline: 'Morphic' with: [spec repository: repository].
spec baseline: 'Spec2' with: [spec repository: repository].
spec baseline: 'Spec' with: [spec repository: repository].
spec baseline: 'Morphic' with: [ spec repository: repository ].
spec baseline: 'ParametrizedTests' with: [ spec repository: repository ].
spec baseline: 'Spec2' with: [ spec repository: repository ].
spec baseline: 'Spec' with: [ spec repository: repository ].

spec baseline: 'DrTests' with: [spec repository: repository].
spec baseline: 'DrTests' with: [ spec repository: repository ].

spec package: 'StartupPreferences'.

Expand All @@ -65,6 +66,8 @@ BaselineOfUI >> baseline: spec [
spec package: 'WebBrowser-Core'.

spec package: 'HelpSystem-Core'.

spec package: 'Spec2-Inspector'.
].
]

Expand Down
8 changes: 8 additions & 0 deletions src/Commander2/CmAbstractCommand.class.st
Expand Up @@ -9,6 +9,14 @@ Class {
#category : #'Commander2-Commands'
}

{ #category : #'instance creation' }
CmAbstractCommand class >> forContext: anObject [
"Creates a new command with anObject as context."
^ self new
context: anObject;
yourself
]

{ #category : #visiting }
CmAbstractCommand >> acceptVisitor: aCmCommandOrGroup [
^ aCmCommandOrGroup visitCommand: self
Expand Down
2 changes: 0 additions & 2 deletions src/GT-Debugger/GTSpecPreDebugActionsPresenter.class.st
Expand Up @@ -6,8 +6,6 @@ I'll collect the actions via pragmas and create button presenters for them.
Class {
#name : #GTSpecPreDebugActionsPresenter,
#superclass : #SpPresenter,
#traits : 'TSpDynamicPresenter',
#classTraits : 'TSpDynamicPresenter classTrait',
#category : #'GT-Debugger-UI'
}

Expand Down
16 changes: 16 additions & 0 deletions src/Metacello-PharoExtensions/BaselineOf.extension.st
Expand Up @@ -6,6 +6,22 @@ BaselineOf class >> allPackageNames [
^ self version packages collect: #name
]

{ #category : #'*Metacello-PharoExtensions' }
BaselineOf class >> deepPackagesOfGroupNamed: aName [
"Traverses the group tree to collect packages"
| allGroups group |

allGroups := self version groups.
group := allGroups detect: [ :eachGroup | eachGroup name = aName ].

^ (group includes
collect: [ :each |
(allGroups anySatisfy: [ :eachGroup | eachGroup name = each ])
ifTrue: [ self deepPackagesOfGroupNamed: each ]
ifFalse: [ { each } ] ])
flattened
]

{ #category : #'*Metacello-PharoExtensions' }
BaselineOf >> packageRepository [

Expand Down
8 changes: 8 additions & 0 deletions src/Spec2-Adapters-Morphic/FTTableMorph.extension.st
@@ -0,0 +1,8 @@
Extension { #name : #FTTableMorph }

{ #category : #'*Spec2-Adapters-Morphic' }
FTTableMorph >> hasFilter [

function ifNil: [ ^ false ].
^ function isKindOf: FTFilterFunction
]
12 changes: 12 additions & 0 deletions src/Spec2-Adapters-Morphic/SpAbstractMorphicAdapter.class.st
Expand Up @@ -423,6 +423,18 @@ SpAbstractMorphicAdapter >> transferFor: passenger from: source [
^ (self transferBlock cull: passenger cull: self model) buildWithSpec
]

{ #category : #emulating }
SpAbstractMorphicAdapter >> type: aString [

aString do: [ :each |
self
keyPressed: each asciiValue
shift: each isUppercase
meta: false
control: false
option: false ]
]

{ #category : #protocol }
SpAbstractMorphicAdapter >> useProportionalLayout [

Expand Down
Expand Up @@ -44,5 +44,13 @@ SpAbstractMorphicListAdapter >> updateItemFilterBlockWith: block [
enableFilter: (SpFTSpecFilter block: block);
explicitFunction ]
ifNil: [
widget disableFunction ]
self updateSearch ]
]

{ #category : #factory }
SpAbstractMorphicListAdapter >> updateSearch [

self presenter isSearchEnabled
ifTrue: [ widget enableSearch ]
ifFalse: [ widget disableFunction ]
]
@@ -1,5 +1,5 @@
Class {
#name : #SpComponentListFastTableDataSource,
#name : #SpComponentListDataSource,
#superclass : #FTDataSource,
#instVars : [
'model'
Expand All @@ -8,7 +8,7 @@ Class {
}

{ #category : #accessing }
SpComponentListFastTableDataSource >> cellColumn: column row: rowIndex [
SpComponentListDataSource >> cellColumn: column row: rowIndex [
| cell item |

item := self elementAt: rowIndex.
Expand All @@ -21,19 +21,19 @@ SpComponentListFastTableDataSource >> cellColumn: column row: rowIndex [
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> elementAt: rowIndex [
SpComponentListDataSource >> elementAt: rowIndex [

^ self presenters at: rowIndex
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> elements [
SpComponentListDataSource >> elements [

^ self presenters
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> headerColumn: column [
SpComponentListDataSource >> headerColumn: column [

column id ifNil: [ ^ nil ].
^ FTCellMorph new
Expand All @@ -43,7 +43,7 @@ SpComponentListFastTableDataSource >> headerColumn: column [
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> menuColumn: column row: rowIndex [
SpComponentListDataSource >> menuColumn: column row: rowIndex [
| menuPresenter |

menuPresenter := self model contextMenu.
Expand All @@ -59,17 +59,17 @@ SpComponentListFastTableDataSource >> menuColumn: column row: rowIndex [
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> model [
SpComponentListDataSource >> model [
^ model
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> model: anObject [
SpComponentListDataSource >> model: anObject [
model := anObject
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> newDataSourceMatching: aFTFilter [
SpComponentListDataSource >> newDataSourceMatching: aFTFilter [
| newElements wrappedItem text newDataSource modelCopy |

newElements := self elements select: [ :each |
Expand All @@ -87,28 +87,28 @@ SpComponentListFastTableDataSource >> newDataSourceMatching: aFTFilter [
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> numberOfRows [
SpComponentListDataSource >> numberOfRows [

^ model
ifNil: [ 0 ]
ifNotNil: [ self presenters size ]
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> presenters [
SpComponentListDataSource >> presenters [

^ self model presenters
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> rowHeight: rowIndex [
SpComponentListDataSource >> rowHeight: rowIndex [

rowIndex = 0 ifTrue: [ ^ super rowHeight: rowIndex ].
^ (self widgetFor: (self elementAt: rowIndex)) height
]

{ #category : #accessing }
SpComponentListFastTableDataSource >> searchText: aString [
SpComponentListDataSource >> searchText: aString [
| search text result |
aString isEmptyOrNil ifTrue: [ ^ #() ].
result := OrderedCollection new.
Expand All @@ -121,12 +121,12 @@ SpComponentListFastTableDataSource >> searchText: aString [
]

{ #category : #'drag and drop' }
SpComponentListFastTableDataSource >> transferFor: passenger from: aMorph [
SpComponentListDataSource >> transferFor: passenger from: aMorph [
^(self model transferFor: passenger from: self table) buildWithSpec
]

{ #category : #private }
SpComponentListFastTableDataSource >> widgetFor: aPresenter [
SpComponentListDataSource >> widgetFor: aPresenter [

aPresenter adapter ifNotNil: [ :adapter | ^ adapter widget ].
^ aPresenter buildWithSpec
Expand Down
5 changes: 5 additions & 0 deletions src/Spec2-Adapters-Morphic/SpDropListMorph.class.st
Expand Up @@ -10,6 +10,11 @@ Class {
#category : #'Spec2-Adapters-Morphic-Support'
}

{ #category : #configuring }
SpDropListMorph >> configureWith: displayModel item: itemPresenter [
displayModel configureDropList: self item: itemPresenter
]

{ #category : #private }
SpDropListMorph >> currentIcon [

Expand Down
13 changes: 13 additions & 0 deletions src/Spec2-Adapters-Morphic/SpMorphicAllItemsStrategy.class.st
@@ -0,0 +1,13 @@
Class {
#name : #SpMorphicAllItemsStrategy,
#superclass : #FTAllItemsStrategy,
#category : #'Spec2-Adapters-Morphic-Table'
}

{ #category : #accessing }
SpMorphicAllItemsStrategy >> isMatching: anItem [

^ dataSource model
performSearch: anItem data
matching: pattern
]
7 changes: 4 additions & 3 deletions src/Spec2-Adapters-Morphic/SpMorphicBackend.class.st
Expand Up @@ -16,9 +16,10 @@ SpMorphicBackend >> adapterBindingsClass [
^ SpMorphicAdapterBindings
]

{ #category : #'as yet unclassified' }
SpMorphicBackend >> defer: aBlockClosure [
UIManager default defer: aBlockClosure.
{ #category : #accessing }
SpMorphicBackend >> defer: aBlock [

UIManager default defer: aBlock
]

{ #category : #'private notifying' }
Expand Down
Expand Up @@ -44,7 +44,7 @@ SpMorphicComponentListAdapter >> isNonEditableRow: aRow column: aColumn [
{ #category : #factory }
SpMorphicComponentListAdapter >> newDataSource [

^ SpComponentListFastTableDataSource new
^ SpComponentListDataSource new
model: self presenter;
yourself
]
Expand Down

0 comments on commit bbcdf97

Please sign in to comment.