-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move GToolkit-PharoMigrations to releaser [feenkcom/gtoolkit#3736]
- Loading branch information
1 parent
d2cb0e8
commit cb6dd28
Showing
4 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
Extension { #name : #Object } | ||
|
||
{ #category : #'*GToolkit-PharoMigrations' } | ||
Object >> forPharo11: pharo11Block forPharo10: pharo10Block [ | ||
"Evaluate one of the blocks based on the pharo's major version" | ||
| unsupportedVersionBlock | | ||
|
||
unsupportedVersionBlock := [ | ||
self error: 'Unsupported pharo version: ',SystemVersion current major asString ]. | ||
|
||
^ self | ||
forPharo12: unsupportedVersionBlock | ||
forPharo11: pharo11Block | ||
forPharo10: pharo10Block | ||
newer: unsupportedVersionBlock | ||
older: unsupportedVersionBlock | ||
] | ||
|
||
{ #category : #'*GToolkit-PharoMigrations' } | ||
Object >> forPharo11AndPharo12: pharo11AndPharo12Block forPharo10: pharo10Block [ | ||
"Evaluate one of the blocks based on the pharo's major version" | ||
| unsupportedVersionBlock | | ||
|
||
unsupportedVersionBlock := [ | ||
self error: 'Unsupported pharo version: ',SystemVersion current major asString ]. | ||
|
||
^ self | ||
forPharo12: pharo11AndPharo12Block | ||
forPharo11: pharo11AndPharo12Block | ||
forPharo10: pharo10Block | ||
newer: unsupportedVersionBlock | ||
older: unsupportedVersionBlock | ||
] | ||
|
||
{ #category : #'*GToolkit-PharoMigrations' } | ||
Object >> forPharo11OrNewer: pharo11OrNewerBlock forPharo10: pharo10Block [ | ||
"Evaluate one of the blocks based on the pharo's major version" | ||
| unsupportedVersionBlock | | ||
|
||
unsupportedVersionBlock := [ | ||
self error: 'Unsupported pharo version: ',SystemVersion current major asString ]. | ||
|
||
^ self | ||
forPharo12: pharo11OrNewerBlock | ||
forPharo11: pharo11OrNewerBlock | ||
forPharo10: pharo10Block | ||
newer: pharo11OrNewerBlock | ||
older: unsupportedVersionBlock | ||
] | ||
|
||
{ #category : #'*GToolkit-PharoMigrations' } | ||
Object >> forPharo12: pharo12Block forPharo11: pharo11Block forPharo10: pharo10Block [ | ||
"Evaluate one of the blocks based on the pharo's major version" | ||
| unsupportedVersionBlock | | ||
|
||
unsupportedVersionBlock := [ | ||
self error: 'Unsupported pharo version: ',SystemVersion current major asString ]. | ||
|
||
^ self | ||
forPharo12: pharo12Block | ||
forPharo11: pharo11Block | ||
forPharo10: pharo10Block | ||
newer: unsupportedVersionBlock | ||
older: unsupportedVersionBlock | ||
] | ||
|
||
{ #category : #'*GToolkit-PharoMigrations' } | ||
Object >> forPharo12: pharo12Block forPharo11: pharo11Block forPharo10: pharo10Block newer: newerBlock older: olderBlock [ | ||
"Evaluate one of the blocks based on the pharo's major version" | ||
|
||
SystemVersion current major > 12 | ||
ifTrue: [ ^ newerBlock value ]. | ||
|
||
SystemVersion current major = 12 | ||
ifTrue: [ ^ pharo12Block value ]. | ||
SystemVersion current major = 11 | ||
ifTrue: [ ^ pharo11Block value ]. | ||
SystemVersion current major = 10 | ||
ifTrue: [ ^ pharo10Block value ]. | ||
|
||
^ olderBlock value | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : #'GToolkit-PharoMigrations' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters